Diagrams
Payment intent
Create, confirm, 3D Secure, provider webhook, charge paid and captured, intent succeeded, merchant webhook.
A payment intent is created, then confirmed. Confirming creates a charge at the provider. When
the card needs 3D Secure, the intent comes back as requires_action and the payer completes
the challenge at the provider.
What to rely on
- The return URL only redirects.
/callbacks/{provider}sends the payer back to yourreturn_urlwithout settling anything; the charge is usually still pending at that moment. - The provider webhook settles the charge. It publishes
charge.paid, posts the ledger and publishescharge.captured, then the intent's status is derived from the charge. - One event per change. A successful payment sends
charge.paid,charge.capturedandpayment_intent.succeeded; a canceled or expired intent sendspayment_intent.canceled. Each is sent once, however often the provider repeats its webhook. - Retrieving reconciles. If a webhook is late,
GET /payment_intents/{id}asks the provider about a pending charge and settles it when it was paid. - Deliveries are signed and retried. Each event is a POST signed in
X-Webhook-Signature, retried with backoff and dead-lettered after the last attempt.