Integra Battlepay con SumUp (órdenes battlepay_orders)

- pagos_sumup.py: crear_checkout_battlepay(reference,...) y obtener_checkout()
- battlepay_view: lista las órdenes PENDING de la cuenta de juego
- battlepay_pay_view: crea checkout SumUp para una orden concreta (checkout_reference=reference)
- sumup_webhook: marca la orden PAID (valida estado contra la API de SumUp si falta)
- plantillas account/battlepay.html y partials/pago_sumup.html
- sql/battlepay_sumup.sql (tablas battlepay_orders/battlepay_price) y docs actualizados

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-12 16:48:16 +00:00
parent 215061776b
commit 0fef9ac35b
7 changed files with 317 additions and 60 deletions
+8 -2
View File
@@ -10,7 +10,12 @@
{% if error %}
<p style="color: red;">Error: {{ error }}</p>
<p><a href="battlepay">Volver a mis compras</a></p>
{% else %}
{% if product_name %}
<p>Producto: <strong>{{ product_name }}</strong></p>
<p>Importe: <strong>{{ price_eur }} €</strong></p>
{% endif %}
<div id="sumup-card"></div>
<script>
@@ -18,8 +23,8 @@
checkoutId: "{{ checkout_id }}",
onResponse: function (type, body) {
if (type === 'success') {
alert("Pago exitoso. ID de transacción: " + body.transaction_code);
console.log("Pago exitoso:", body);
alert("Pago exitoso. El producto se entregará en el juego en breve.");
window.location = "battlepay";
} else if (type === 'error') {
alert("Error en el pago: " + body.message);
console.error("Error en el pago:", body);
@@ -27,6 +32,7 @@
}
});
</script>
<p><a href="battlepay">Cancelar y volver</a></p>
{% endif %}
</body>
</html>