Permitir pagar los servicios con PD, Stripe o SumUp (elección)

Los 9 servicios con precio en euros (rename, customize, change-race,
change-faction, level-up, gold, transfer, restore-item, send-gift) ahora
ofrecen un selector de forma de pago con las 3 opciones: saldo PD, tarjeta
(Stripe) o tarjeta (SumUp).

- lib/dpoints: spendDPoints() descuenta PD de forma atómica (FOR UPDATE).
- lib/pay-with-dpoints: paga con saldo PD, ejecuta la acción al momento y
  reembolsa si la ejecución falla; 100 PD = 1 €.
- rutas checkout (character/[service] y gift): rama provider='pd' que valida
  saldo, descuenta, ejecuta fulfill y devuelve la URL de éxito (sin pasarela).
- service-success: rama provider='pd' (la entrega ya se hizo en el checkout).
- PaymentMethodSelect: componente compartido con coste por método y saldo;
  desactiva PD si no hay saldo suficiente.
- Formularios (PaidServiceForm, Gold, Transfer, RestoreItems, SendGift) y sus
  páginas pasan el saldo PD y envían el método elegido + locale.
- i18n: namespace Pay (es/en); añadidas claves Paid.restore-item que faltaban.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 21:44:31 +00:00
parent 942fe2e397
commit 1b0920d11f
24 changed files with 420 additions and 66 deletions
+23
View File
@@ -354,6 +354,11 @@
"send-gift": {
"title": "Send gift",
"success": "The gift has been mailed to character {name}."
},
"restore-item": {
"title": "Restore item",
"pay": "Restore for {price} €",
"success": "The item has been returned to character {name}."
}
},
"SecurityToken": {
@@ -1894,5 +1899,23 @@
"disabling": "Disabling...",
"disable": "Disable 2FA"
}
},
"Pay": {
"method": "Payment method",
"pd": "PD balance",
"stripe": "Card (Stripe)",
"sumup": "Card (SumUp)",
"pdCost": "{cost} PD",
"eur": "{price} €",
"balance": "Available balance: {balance} PD",
"insufficient": "Insufficient balance ({cost} PD)",
"confirm": "Confirm the payment of {amount}?",
"errors": {
"insufficientPd": "You don't have enough PD balance for this service.",
"fulfillFailed": "The service could not be completed. Your PD balance has been refunded.",
"notConfigured": "This payment method is not available right now.",
"invalidRequest": "Invalid request.",
"genericError": "An error occurred. Please try again."
}
}
}
+23
View File
@@ -354,6 +354,11 @@
"send-gift": {
"title": "Enviar regalo",
"success": "El regalo ha sido enviado por correo al personaje {name}."
},
"restore-item": {
"title": "Recuperar ítem",
"pay": "Recuperar por {price} €",
"success": "El ítem ha sido devuelto al personaje {name}."
}
},
"SecurityToken": {
@@ -1894,5 +1899,23 @@
"disabling": "Desactivando...",
"disable": "Desactivar 2FA"
}
},
"Pay": {
"method": "Forma de pago",
"pd": "Saldo PD",
"stripe": "Tarjeta (Stripe)",
"sumup": "Tarjeta (SumUp)",
"pdCost": "{cost} PD",
"eur": "{price} €",
"balance": "Saldo disponible: {balance} PD",
"insufficient": "Saldo insuficiente ({cost} PD)",
"confirm": "¿Confirmas el pago de {amount}?",
"errors": {
"insufficientPd": "No tienes saldo PD suficiente para este servicio.",
"fulfillFailed": "No se pudo completar el servicio. Se te ha devuelto el saldo PD.",
"notConfigured": "Esta forma de pago no está disponible ahora mismo.",
"invalidRequest": "Solicitud no válida.",
"genericError": "Ha ocurrido un error. Inténtalo de nuevo."
}
}
}