arreglados varios temas además del DL (redsys, etc)

This commit is contained in:
2025-11-15 10:59:05 +01:00
parent 6bd36dbe8c
commit 69f27df98b
15 changed files with 720 additions and 3238 deletions

View File

@ -273,6 +273,14 @@ public class PaymentService {
throw new IllegalStateException("Error al solicitar la devolución a Redsys", e);
}
// 🔧 NORMALIZAR ANTES DE GUARDAR
if (gatewayRefundId != null) {
gatewayRefundId = gatewayRefundId.trim();
if (gatewayRefundId.isEmpty() || "000000".equals(gatewayRefundId)) {
gatewayRefundId = null; // → múltiples NULL NO rompen el UNIQUE
}
}
PaymentTransaction tx = new PaymentTransaction();
tx.setPayment(p);
tx.setType(PaymentTransactionType.REFUND);