trabajando en respuesta ok tras el pago con tarjeta

This commit is contained in:
2025-11-12 15:04:16 +01:00
parent b52f5e7d4f
commit 69a4076e28
3 changed files with 58 additions and 20 deletions

View File

@ -71,7 +71,7 @@ public class RedsysController {
String importeFormateado = Utils.formatCurrency(amountCents / 100.0, locale);
ctx.setVariable("importe", importeFormateado);
ctx.setVariable("concepto", "TRANSF-" + p.getId());
ctx.setVariable("concepto", "TRANSF-" + p.getOrderId());
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
boolean isAuth = auth != null
&& auth.isAuthenticated()
@ -119,11 +119,7 @@ public class RedsysController {
// GET: cuando el usuario cae aquí sin parámetros, o Redsys redirige por GET
@GetMapping("/ok")
public String okGet(RedirectAttributes redirectAttrs, Model model, Locale locale) {
String msg = messageSource.getMessage("checkout.success.payment", null,
"Pago realizado con éxito. Gracias por su compra.", locale);
model.addAttribute("successPago", msg);
redirectAttrs.addFlashAttribute("successPago", msg);
return "redirect:/cart";
return "imprimelibros/pagos/pago-ok";
}
// POST: si Redsys envía Ds_Signature y Ds_MerchantParameters (muchas