How card payments work
The standard card flow follows three stages:- Create a checkout session — your backend calls
POST /v1/checkout/sessionsand returns a session ID to the frontend. - Customer enters card details — the Yuno SDK collects the card data in a PCI-compliant iframe and produces a one-time-use token (OTT).
- Your backend creates the payment — using the OTT, your server calls
POST /v1/payments. Yuno routes to the configured provider.
One-time tokens expire after a single use. If the payment creation fails, the SDK generates a new token automatically when the customer retries.
Integration steps
Create a checkout session (backend)
Call
POST /v1/checkout/sessions with your customer ID, amount, and country. Return the checkout_session value to your frontend.Initialize the Yuno SDK (frontend)
Pass the
checkout_session to the SDK. The SDK renders the payment method list, including the card form.3D Secure (3DS)
3DS authentication is triggered automatically by Yuno when required by the card issuer, the acquirer, or regional regulation (e.g., PSD2 in Europe). You do not need to detect or initiate it manually. How it works:- Your backend creates the payment normally.
- If 3DS is required, the API response includes
sdk_action_required: true. - You must call
yuno.continuePayment()in the SDK callback. Yuno opens the 3DS challenge in an iframe and waits for completion. - After the customer authenticates, the SDK fires
yunoPaymentResultwith the final status.
Card vaulting
To save a card for future payments without requiring the customer to re-enter details, setvault_on_success: true in the payment request:
vaulted_token you can store in your database and reuse for subsequent payments. The customer does not need to re-enter their card.
Vaulting requires a
customer_payer.id in the checkout session. The vaulted token is scoped to that customer.Sandbox test cards
Use these card numbers in the sandbox environment. Use any future expiry date and any 3-digit CVV (4 digits for Amex).| Card number | Result |
|---|---|
4111 1111 1111 1111 | Approved |
4000 0000 0000 0002 | Declined |
4000 0000 0000 3063 | 3DS required (challenge flow) |
4000 0000 0000 3220 | 3DS required (frictionless) |