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

View File

@ -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%;
}
}

View File

@ -22,7 +22,7 @@
<th:block layout:fragment="content">
<div th:if="${#authorization.expression('isAuthenticated()')}">
<div class="container-fluid">
<!-- contenido para usuario logueado -->
</div>
</div>
<div th:unless="${#authorization.expression('isAuthenticated()')}">
@ -36,8 +36,10 @@
<div th:unless="${#authorization.expression('isAuthenticated()')}">
<script th:src="@{/assets/js/pages/imprimelibros/presupuestador/imagen-selector.js}"></script>
<script type="module" th:src="@{/assets/js/pages/imprimelibros/presupuestador/wizard-home.js}"></script>
<script type="module" th:src="@{/assets/js/pages/imprimelibros/presupuestador/presupuesto-maquetacion.js}"></script>
<script type="module" th:src="@{/assets/js/pages/imprimelibros/presupuestador/presupuesto-marcapaginas.js}"></script>
<script type="module"
th:src="@{/assets/js/pages/imprimelibros/presupuestador/presupuesto-maquetacion.js}"></script>
<script type="module"
th:src="@{/assets/js/pages/imprimelibros/presupuestador/presupuesto-marcapaginas.js}"></script>
</div>
<script th:inline="javascript">
window.languageBundle = /*[[${languageBundle}]]*/ {};