mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 00:48:49 +00:00
sistema de pedidos pendientes de pago hechos
This commit is contained in:
@ -70,7 +70,8 @@ public class RedsysController {
|
||||
if ("bank-transfer".equalsIgnoreCase(method)) {
|
||||
|
||||
// 1) Creamos el Payment interno SIN orderId (null)
|
||||
Payment p = paymentService.createBankTransferPayment(cartId, dirFactId, amountCents, "EUR", locale, order.getId());
|
||||
Payment p = paymentService.createBankTransferPayment(cartId, dirFactId, amountCents, "EUR", locale,
|
||||
order.getId());
|
||||
|
||||
pedidoService.markPedidoAsProcesingPayment(order.getId());
|
||||
|
||||
@ -104,7 +105,8 @@ public class RedsysController {
|
||||
}
|
||||
|
||||
// Tarjeta o Bizum (Redsys)
|
||||
FormPayload form = paymentService.createRedsysPayment(cartId, dirFactId, amountCents, "EUR", method, order.getId());
|
||||
FormPayload form = paymentService.createRedsysPayment(cartId, dirFactId, amountCents, "EUR", method,
|
||||
order.getId());
|
||||
|
||||
String html = """
|
||||
<html><head><meta charset="utf-8"><title>Redirigiendo a Redsys…</title></head>
|
||||
@ -132,7 +134,6 @@ public class RedsysController {
|
||||
.body(body);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/reintentar", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||
@ResponseBody
|
||||
public ResponseEntity<byte[]> reintentarPago(@RequestParam("amountCents") Long amountCents,
|
||||
@ -153,19 +154,20 @@ public class RedsysController {
|
||||
Long cartId = null;
|
||||
Long dirFactId = null;
|
||||
// Find payment transaction details from failedPayment if needed
|
||||
try{
|
||||
Map<String, Long> transactionDetails = paymentService.getPaymentTransactionData(failedPayment.getId());
|
||||
cartId = transactionDetails.get("cartId");
|
||||
dirFactId = transactionDetails.get("dirFactId");
|
||||
try {
|
||||
Map<String, Long> transactionDetails = paymentService.getPaymentTransactionData(failedPayment.getId());
|
||||
cartId = transactionDetails.get("cartId");
|
||||
dirFactId = transactionDetails.get("dirFactId");
|
||||
} catch (Exception e) {
|
||||
throw new Exception("No se pudieron obtener los detalles de la transacción para el pago " + failedPayment.getId());
|
||||
throw new Exception(
|
||||
"No se pudieron obtener los detalles de la transacción para el pago " + failedPayment.getId());
|
||||
}
|
||||
|
||||
|
||||
if ("bank-transfer".equalsIgnoreCase(method)) {
|
||||
|
||||
// 1) Creamos el Payment interno SIN orderId (null)
|
||||
Payment p = paymentService.createBankTransferPayment(cartId, dirFactId, amountCents, "EUR", locale, order.getId());
|
||||
Payment p = paymentService.createBankTransferPayment(cartId, dirFactId, amountCents, "EUR", locale,
|
||||
order.getId());
|
||||
|
||||
pedidoService.markPedidoAsProcesingPayment(order.getId());
|
||||
|
||||
@ -199,7 +201,8 @@ public class RedsysController {
|
||||
}
|
||||
|
||||
// Tarjeta o Bizum (Redsys)
|
||||
FormPayload form = paymentService.createRedsysPayment(cartId, dirFactId, amountCents, "EUR", method, order.getId());
|
||||
FormPayload form = paymentService.createRedsysPayment(cartId, dirFactId, amountCents, "EUR", method,
|
||||
order.getId());
|
||||
|
||||
String html = """
|
||||
<html><head><meta charset="utf-8"><title>Redirigiendo a Redsys…</title></head>
|
||||
|
||||
Reference in New Issue
Block a user