Payment — Architecture & data
Shared checkout flow
Method-specific flows
| Method | Flow |
|---|---|
| PayLater | Validate availability, persist selected/pending option, continue the booking/subscription flow. |
| PayNow/Windcave | Init checkout, redirect customer, process result/webhook, avoid duplicate retries. |
| Direct Debit/Kiwi | Create/read payment customer by account+BU+provider, create debit batch, process provider status. |
| Deposit | Check whole-batch eligibility, snapshot amount/percentage, lock order, checkout, confirm by webhook. |
Guardrails
AccountPaymentCustomeraccess must be BU-scoped.- Provider callbacks must be idempotent.
- Master toggles/settings must be checked before exposing a method.
- Deposit eligibility fails the whole batch if any booking is ineligible.
- Controllers orchestrate; service/domain boundaries own payment rules.
Main data
| Group | Data |
|---|---|
| Customer token | AccountPaymentCustomer by account, BU, provider. |
| Payment batch | DirectPaymentBatch, DirectPayment, status/error/provider reference. |
| Checkout lock | Booking/order lock or deposit snapshot. |
| Settings | BU/provider settings, method toggle, category availability. |
| Provider callbacks | Result URL, notification URL, webhook payload/error. |