From 69a4076e28b319040992e751730f2ab5de2de9fb Mon Sep 17 00:00:00 2001 From: jjimenez Date: Wed, 12 Nov 2025 15:04:16 +0100 Subject: [PATCH] trabajando en respuesta ok tras el pago con tarjeta --- .../erp/redsys/RedsysController.java | 8 +-- .../static/assets/css/imprimelibros.css | 62 +++++++++++++++---- .../templates/imprimelibros/home/home.html | 8 ++- 3 files changed, 58 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/imprimelibros/erp/redsys/RedsysController.java b/src/main/java/com/imprimelibros/erp/redsys/RedsysController.java index 9f89508..0cafbf1 100644 --- a/src/main/java/com/imprimelibros/erp/redsys/RedsysController.java +++ b/src/main/java/com/imprimelibros/erp/redsys/RedsysController.java @@ -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 diff --git a/src/main/resources/static/assets/css/imprimelibros.css b/src/main/resources/static/assets/css/imprimelibros.css index 30737c5..72c5a73 100644 --- a/src/main/resources/static/assets/css/imprimelibros.css +++ b/src/main/resources/static/assets/css/imprimelibros.css @@ -4,7 +4,8 @@ body { /* botón base */ .btn-opcion-presupuesto { - --vz-btn-color: #92b2a7; /* texto y borde */ + --vz-btn-color: #92b2a7; + /* texto y borde */ --vz-btn-border-color: #92b2a7; --vz-btn-hover-color: #fff; --vz-btn-hover-bg: #92b2a7; @@ -18,12 +19,13 @@ body { --vz-btn-disabled-border-color: #92b2a7; --vz-gradient: none; - background-color: rgba(146, 178, 167, 0.2); /* no seleccionado */ + background-color: rgba(146, 178, 167, 0.2); + /* no seleccionado */ color: #92b2a7; } /* cuando el radio/checkbox está checked */ -.btn-check:checked + .btn-opcion-presupuesto, +.btn-check:checked+.btn-opcion-presupuesto, .btn-opcion-presupuesto.active { background-color: #92b2a7; color: #fff; @@ -32,18 +34,22 @@ body { /* Solo dentro del modal */ .swal2-popup .form-switch-custom { - font-size: 1rem; /* clave: fija el tamaño base del switch */ + font-size: 1rem; + /* clave: fija el tamaño base del switch */ line-height: 1.5; } + .swal2-popup .form-switch-custom .form-check-input { - float: none; /* por si acaso */ + float: none; + /* por si acaso */ margin: 0; } -.swal2-popup .form-switch-custom .form-check-input:checked{ +.swal2-popup .form-switch-custom .form-check-input:checked { border-color: #92b2a7; background-color: #cbcecd; } + .swal2-popup .form-switch-custom .form-check-input:checked::before { color: #92b2a7; } @@ -58,12 +64,46 @@ body { } .alert-fadeout { - opacity: 1; - transition: opacity 1s ease; - animation: fadeout 4s forwards; + opacity: 1; + transition: opacity 1s ease; + animation: fadeout 4s forwards; } @keyframes fadeout { - 0%, 70% { opacity: 1; } - 100% { opacity: 0; } + + 0%, + 70% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} + +.progress-container { + width: 300px; + height: 20px; + background-color: #e0e0e0; + border-radius: 10px; + overflow: hidden; + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1); +} + +.progress-bar-custom { + height: 100%; + background-color: #92b2a7; + border-radius: 10px; + width: 0; + animation: fillProgress 5s ease-in-out forwards; +} + +@keyframes fillProgress { + from { + width: 0%; + } + + to { + width: 100%; + } } \ No newline at end of file diff --git a/src/main/resources/templates/imprimelibros/home/home.html b/src/main/resources/templates/imprimelibros/home/home.html index 0f4fd43..a1b3acb 100644 --- a/src/main/resources/templates/imprimelibros/home/home.html +++ b/src/main/resources/templates/imprimelibros/home/home.html @@ -22,7 +22,7 @@
- +
@@ -36,8 +36,10 @@
- - + +