How It Works
The payment lifecycle from checkout to cash — big picture first, then details.
Big Picture
Every payment flows through three objects:
| Object | What it is | You create it? |
|---|---|---|
| Checkout Session | A payment page for your customer | Yes — POST/v1/checkout-sessions |
| Payment Intent | Tracks the payment through its lifecycle | Auto-created with the session |
| Charge | The actual money movement (auth, capture, settle) | Auto-created when customer pays |
Create the session, then check its PaymentIntent from your server to confirm the payment result. CX Pay handles the payer-facing payment flow.
Payment Intent Lifecycle
The Payment Intent is the source of truth for "did they pay?" Here are the states you'll see:
The states that matter to you:
| Status | What it means | What to do |
|---|---|---|
succeeded | Money captured. Done. | Fulfill the order |
processing | Payment submitted, waiting on the network. No fixed time limit: it does not expire and cannot be canceled. With no result after about 24 hours, it moves to uncertain | Wait for the webhook or retrieve the PaymentIntent |
uncertain | The gateway result is not yet known. No webhook is sent for this status | Retrieve the PaymentIntent; do not create another charge |
requires_review | Automated recovery exhausted; manual review required. No webhook is sent for this status | Keep the order pending and contact support |
requires_payment_method | Waiting for the customer to enter a card | Nothing — they haven't paid yet |
requires_action | Customer needs to complete 3DS | Nothing — we handle it |
requires_capture | Auth held, awaiting capture (manual capture flow) | Call capture when you're ready to take the funds |
canceled | Customer or session expired | Show "payment canceled" |
expired | Session timed out | Offer to try again |
Payment Intent vs Charge
- Payment Intent = the intention to collect money. Tracks the full lifecycle.
- Charge = the actual money movement. Created when the payment is attempted.
A Payment Intent can have multiple Charges (e.g., if the first attempt fails and the customer retries). You almost never need to think about Charges — just check the Payment Intent status.
Rule of thumb: Check payment_intent.status to know if you got paid. Ignore Charges unless you're debugging.
Checkout Session vs Payment Intent
"When do I use which?"
- Checkout Session = what you create. Use its
urlfor hosted checkout or itsidwithCxPay.embed()for the payment form. - Payment Intent = what you check. The
payment_intentID from the session response is your reference for payment status.
You create the session. You check the intent. You ignore the charge. Simple.