fix(payments): reconcile with gateway before expiring unpaid holds

Replace the fixed 5-minute grace with a settlement check at expiry:
expire() calls the payment API's reconcile endpoint — paid intents are
kept and allocated via payment.succeeded, unverifiable results defer
expiry to the next tick, only verifiably unpaid holds expire.
This commit is contained in:
Marshal
2026-07-30 12:01:59 +00:00
parent 22de05fe8e
commit acb6f286d4
8 changed files with 130 additions and 42 deletions

View File

@@ -9,14 +9,6 @@
export const BATCH_TIMEZONE = 'Africa/Addis_Ababa';
/**
* Slack after a booking's paymentDeadline before the settle sweep expires it.
* Covers gateway/webhook lag for a payment STARTED inside the window —
* initiation itself is hard-blocked at the deadline (BillingService.payInvoice),
* so this never extends the time a customer has to begin paying.
*/
export const PAYMENT_GRACE_MS = 5 * 60_000;
/** How long before the pay deadline the one reminder notification goes out. */
export const PAYMENT_REMINDER_LEAD_MS = 10 * 60_000;