The code below is the PUSH created so that PAGSeguro sends me notification of the status of my payment. But the error returned is 500, and in their forum there are no answers so far. Anyone who has ever had this problem can help me?
@PostMapping(value="/pagseguro-notificacao")
public @ResponseBody
String resgistrarNotificacao(
@RequestParam(value = "notificationCode") String nCode,
@RequestParam(value = "notificationType") String nType) {
try {
final PagSeguro pagSeguro = PagSeguro.instance(Credential.sellerCredential(sellerEmail,
sellerToken), PagSeguroEnv.PRODUCTION);
TransactionDetail transaction = pagSeguro.transactions().search().byNotificationCode(nCode);
if (transaction != null) {
atualizarStatusDoAnuncio(transaction);
}
} catch (Exception e) {
Logger.getLogger(e.getLocalizedMessage());
}
return null;
}