Webhooks & Reconciliation
Payment providers settle asynchronous events (3DS completions, delayed bank transfers, recurring renewals, disputes, and refunds) via webhooks. Payments handles verification, deduplication, async queueing, and periodic reconciliation out of the box.
Inbound Webhook Endpoint
Section titled “Inbound Webhook Endpoint”Every configured gateway instance receives its own dedicated URL:
https://your-site.example/_payments/webhook/{gatewayHandle}Print the exact URL for any configured gateway with:
php vendor/bin/wire payments:webhook:url stripe-eur --jsonVerification & Async Queueing
Section titled “Verification & Async Queueing”- Payload Size Guard: Enforces the configured maximum payload byte size (default
1048576bytes) before parsing, returning HTTP413on oversized bodies. - Signature Verification: Delegates cryptographic signature verification to the gateway driver (
WebhookGatewayInterface) using its sealedSecretBoxwebhook secret. - Deduplication & Storage: Logs the event by provider
event_idin Setup -> Payments -> Webhooks so duplicate provider retries are idempotently ignored. - Optional Async Dispatch: When Async Webhook Queue Processing is enabled in Setup -> Payments -> Settings, verified events are pushed onto
ProcessWebhookQueue(queue namepayments-webhooks) so the endpoint returns HTTP200immediately while background workers update the ledger and fire hooks.
Scheduled Reconciliation
Section titled “Scheduled Reconciliation”Even with reliable webhooks, network drops or provider outages can leave a pending transaction or subscription renewal out of sync. Payments ships two scheduled tasks and matching CLI commands:
ReconcileSubscriptionsTask(payments:subscriptions:sync): Syncs due, trialing, and past-due subscriptions with remote providers.ReconcileTransactionsTask(payments:transactions:reconcile): Polls drivers implementingTransactionStatusGatewayInterfacefor pending transactions older than--older-thanminutes and expires abandoned intents after--expire-afterminutes.
# Preview subscription sync without mutating local rowsphp vendor/bin/wire payments:subscriptions:sync --dry-run --json
# Reconcile pending transactions older than 30 minutes and expire after 24 hoursphp vendor/bin/wire payments:transactions:reconcile \ --older-than=30 \ --expire-after=1440 \ --limit=100 \ --dry-run \ --json