Skip to content

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.

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:

Terminal window
php vendor/bin/wire payments:webhook:url stripe-eur --json
  1. Payload Size Guard: Enforces the configured maximum payload byte size (default 1048576 bytes) before parsing, returning HTTP 413 on oversized bodies.
  2. Signature Verification: Delegates cryptographic signature verification to the gateway driver (WebhookGatewayInterface) using its sealed SecretBox webhook secret.
  3. Deduplication & Storage: Logs the event by provider event_id in Setup -> Payments -> Webhooks so duplicate provider retries are idempotently ignored.
  4. Optional Async Dispatch: When Async Webhook Queue Processing is enabled in Setup -> Payments -> Settings, verified events are pushed onto ProcessWebhookQueue (queue name payments-webhooks) so the endpoint returns HTTP 200 immediately while background workers update the ledger and fire hooks.
Inspect verified inbound webhook events, timestamps, and processing states in Setup -> Payments -> Webhooks.

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 implementing TransactionStatusGatewayInterface for pending transactions older than --older-than minutes and expires abandoned intents after --expire-after minutes.
Terminal window
# Preview subscription sync without mutating local rows
php vendor/bin/wire payments:subscriptions:sync --dry-run --json
# Reconcile pending transactions older than 30 minutes and expire after 24 hours
php vendor/bin/wire payments:transactions:reconcile \
--older-than=30 \
--expire-after=1440 \
--limit=100 \
--dry-run \
--json

Next steps