Local Payment Methods
En resumen
Local Payment Methods covers the country-specific rails the petanque ecosystem needs — Swish QR (Sweden), iDEAL (Netherlands), Bancontact (Belgium), Bizum (Spain), SEPA Direct Debit with mandate management, and Klarna BNPL across 18 countries — each modelled with its own currency-validated request collection, idempotent webhook handler, and Payment+Receipt creation on success.
Cómo funciona
Each rail is an isolated collection so per-method invariants are explicit. SwishPaymentRequest holds the swish_instruction_uuid, payee_alias, payer_alias, amount as Decimal, currency=SEK (validated), message (max 50 chars), status (created, paid, declined, error, cancelled), base64 QR code data, callback_url, and SwishPaymentMetadata; Swish callbacks land at POST /swish/callbacks/, are idempotency-checked by callback_identifier, and on PAID create both Payment and Receipt while updating the request. iDEAL and Bancontact share a similar shape with provider (stripe or mollie), bank metadata (BIC for iDEAL, cardholder language for Bancontact), EUR-only validation, and webhook-driven Payment+Receipt creation on succeeded. Bizum mirrors the model with provider (stripe or redsys), payer_phone, base64 QR data, and EUR-only validation.
SepaDirectDebitPayment is the most elaborate — mandate_id with mandate_status (pending, active, revoked, expired), debtor_iban, debtor_name, creditor_id, sequence_type (OOFF, RCUR, FRST, FNAL), description capped at 140 chars per SEPA rules, and a return_code field that captures the full R01–R99 SEPA return-code spectrum so reversals can be diagnosed. KlarnaPayment supports purchase_country across 18 jurisdictions, multi-currency (EUR, SEK, NOK, DKK, GBP, USD, CHF, PLN, CZK), payment_type (pay_later, pay_over_time, direct_debit, direct_bank_transfer), installment_count between 2 and 36, and a two-stage authorize→capture flow. All rails expose CRUD with status/invoice_id filters, dedicated sync endpoints to pull provider state on demand, and webhook endpoints with idempotency to absorb retries without double-booking payments.
Capacidades clave
- Swish QR with base64 QR generation, SEK validation, and PAID-driven Payment+Receipt
- iDEAL and Bancontact via stripe/mollie with bank metadata and EUR-only validation
- Bizum via stripe/redsys with payer_phone and QR generation
- SEPA Direct Debit with mandate lifecycle, sequence types, and R01–R99 return codes
- Klarna BNPL across 18 countries, 9 currencies, and authorize→capture two-stage flow
- Idempotent webhook handlers per rail with identifier deduplication
- Per-rail currency validation and provider-specific configuration
En la práctica
A Swedish club configures Swish for tournament fees. A player on the registration page picks Swish; the API creates a SwishPaymentRequest, generates the base64 QR code, and renders it in the browser. The player scans with the Swish app, approves the 250 SEK payment, and the bank posts a callback to /swish/callbacks/ with event_status=PAID.
The handler verifies the callback_identifier hasn't been seen before, updates the request to paid, and creates a Payment and a Receipt linked to the invoice. Three weeks later the same club adds Klarna for hardware sales — a player selects pay_over_time with 6 installments, Klarna authorises the order via webhook, the admin captures it on shipment, and the captured webhook drives Payment+Receipt creation just like Swish.
Funcionalidades de este subsistema
7| ID | Status | Funcionalidades |
|---|---|---|
| F14.09.01 | Entregado | Swish QR-betalningar (Sverige) — SwishPaymentRequest-samling tenant-scopad med swish_instruction_uuid indexed/payee_alias/payer_alias/amount Decimal/currency SEK/message (max 50)/status (created/paid/declined/error/cancelled)/qr_code_data base64/qr_format/callback_url/invoice_id/payment_id/payment_reference/payer_payment_reference/error_code/error_message/paid_at/metadata (SwishPaymentMetadata invoice_id/debtor_id/debtor_type/fee_category/season_id/custom); CRUD /swish/payments/ med filtrering status/invoice_id, cancel/sync-endpoints; valutavalidering (enbart SEK); QR-kodgenerering vid skapande ✅ PL-F1409a |
| F14.09.02 | Entregado | Swish webhook callbacks — SwishCallbackEvent-samling tenant-scopad med swish_instruction_uuid indexed/event_status (PAID/DECLINED/ERROR/CANCELLED)/callback_identifier indexed för idempotens/status (received/verified/processed/processing_failed)/payload_summary saniterad/processing_error/payer_alias/payment_reference/amount/date_paid; POST /swish/callbacks/ tar emot Swish-callbacks med idempotens-kontroll, dispatch till handlers som uppdaterar SwishPaymentRequest och skapar Payment+Receipt vid PAID; GET /swish/callbacks/events för audit-loggning ✅ PL-F1409a |
| F14.09.03 | Entregado | iDEAL (Nederländerna) — IDealPayment-samling tenant-scopad med ideal_transaction_id indexed/provider (stripe/mollie)/provider_payment_id/bank_bic/bank_name/amount Decimal/currency EUR/status (created/pending/succeeded/failed/expired/canceled)/invoice_id/payment_id/redirect_url/return_url/webhook_url/description/metadata (IDealPaymentMetadata)/succeeded_at/failed_at/error_code/error_message; CRUD /ideal/payments/ med filtrering status/invoice_id, sync-endpoint, webhook-endpoint; valutavalidering (enbart EUR); skapar Payment+Receipt vid succeeded ✅ PL-F1409a |
| F14.09.04 | Entregado | Bancontact (Belgien) — BancontactPayment-samling tenant-scopad med bancontact_transaction_id indexed/provider (stripe/mollie)/provider_payment_id/cardholder_name/preferred_language (nl/fr/de/en)/amount Decimal/currency EUR/status (created/pending/authorized/succeeded/failed/expired/canceled)/invoice_id/payment_id/redirect_url/return_url/description/metadata (BancontactPaymentMetadata)/succeeded_at/failed_at/error_code/error_message; CRUD /bancontact/payments/ med filtrering status/invoice_id, sync-endpoint, webhook-endpoint; valutavalidering (enbart EUR); skapar Payment+Receipt vid succeeded ✅ PL-F1409a |
| F14.09.05 | Entregado | Bizum (Spanien) — BizumPayment-samling tenant-scopad med bizum_transaction_id indexed/provider (stripe/redsys)/provider_payment_id/payer_phone/amount Decimal/currency EUR/status (created/pending/paid/failed/cancelled/timeout)/qr_code_data base64/qr_format/invoice_id/payment_id/redirect_url/return_url/description/metadata (BizumPaymentMetadata)/paid_at/failed_at/error_code/error_message; CRUD /bizum/payments/ med filtrering status/invoice_id, sync-endpoint, webhook-endpoint; valutavalidering (enbart EUR); QR-kodgenerering; skapar Payment+Receipt vid paid ✅ PL-F1409b |
| F14.09.06 | Entregado | SEPA Direct Debit (EUR-länder) — SepaDirectDebitPayment-samling tenant-scopad med sepa_transaction_id indexed/provider (stripe/mollie)/provider_payment_id/mandate_id indexed/mandate_status (pending/active/revoked/expired)/debtor_iban/debtor_name/creditor_id/amount Decimal/currency EUR/status (pending/authorized/processing/succeeded/failed/reversed/cancelled)/sequence_type (OOFF/RCUR/FRST/FNAL)/invoice_id/payment_id/description (max 140)/return_url/redirect_url/return_code (R01-R99)/metadata (SepaDirectDebitMetadata)/succeeded_at/failed_at/error_code/error_message; CRUD /sepa-direct-debit/payments/ med filtrering status/invoice_id/mandate_id, sync-endpoint, webhook-endpoint; mandathantering; SEPA-returkoder; valutavalidering (enbart EUR); skapar Payment+Receipt vid succeeded ✅ PL-F1409b |
| F14.09.07 | Entregado | Klarna BNPL (EU) — KlarnaPayment-samling tenant-scopad med klarna_order_id indexed/provider (klarna/stripe)/provider_payment_id/klarna_session_id/purchase_country (18 länder)/purchase_language/amount Decimal/currency (EUR/SEK/NOK/DKK/GBP/USD/CHF/PLN/CZK)/status (created/authorized/captured/failed/cancelled/expired)/payment_type (pay_later/pay_over_time/direct_debit/direct_bank_transfer)/installment_count (2–36)/invoice_id/payment_id/redirect_url/return_url/description/customer_email/metadata (KlarnaPaymentMetadata)/authorized_at/captured_at/failed_at/error_code/error_message; CRUD /klarna/payments/ med filtrering status/invoice_id/payment_type, capture-endpoint, sync-endpoint, webhook-endpoint; lands- och valutavalidering; tvåstegsflöde (authorize→capture); skapar Payment+Receipt vid captured ✅ PL-F1409b |