The default payment flow
When a customer reaches your checkout, here’s what happens:- Your server creates a client session and returns a
clientToken - The SDK initializes and loads available payment methods
- Customer selects a method and enters their details
- Customer submits and the SDK processes the payment
- Your app receives the result via events
Create a Client Session (Server-Side)
Create a client session on your server using the Client Session API. This returns aclientToken that you pass to your client.
Initialize and Show Checkout
- Web
- Android
- iOS
What Primer handles for you
Out of the box, Primer Checkout manages:| Concern | What Primer Does |
|---|---|
| Validation | Real-time input validation with inline error messages |
| Error display | Payment failures shown automatically in the UI |
| Redirects | 3DS challenges, bank redirects, and wallet flows |
| Loading states | Visual feedback during processing |
| Payment method logic | Each method’s specific requirements and flows |
Listening for results
To react to payment outcomes, listen for payment events:- Web
- Android
- iOS
Testing in sandbox
Use these test cards to verify your integration:| Card Number | Result |
|---|---|
4111 1111 1111 1111 | Success |
4000 0000 0000 0002 | Declined |
See also
Styling
Match the checkout to your brand
Layout
Control the structure of checkout components
Core Concepts
Understand the architecture
Track in Analytics
Send events to your analytics platform