Skip to main content
Four steps: install the SDK, show your shopper their payment methods, take the payment, and know it went through. Yuno handles the forms, the routing, and 3DS in between.
1

Install

Add the SDK to your platform and initialize it with your public API key.
2

Show payment methods

Your backend creates a checkout session; the SDK shows the methods.
3

Take the payment

Start the transaction. Yuno renders the form and runs 3DS.
4

Know it went through

The SDK tells you the outcome; your server confirms it.

Before you begin

You need:
  • A Yuno account and your public API key, available in the Yuno Dashboard under Developers > Credentials.
  • A backend that can call Yuno’s API to create checkout sessions and, optionally, payments.

Install

Add the SDK for your platform, then initialize it once, at app or page startup. The constructor only takes your public API key. All payment-specific configuration comes later.
Load the SDK from the CDN. It exposes a global SdkPayments and dispatches a sdk-payments-ready event on window once it’s ready to use.
Each release has its own full-version path. To move to a newer release, change the version in the src.Then initialize the SDK. The bundle sets window.SdkPayments synchronously and fires sdk-payments-ready on window once, right as it loads. If your code runs after the script has already loaded, that event has passed — so check for the global first and fall back to the event only while the script is still loading:
This works whichever way you load the script — synchronous, async, or defer. SdkPayments.initialize returns a Promise; await it before using the SDK.
The SDK targets the environment from your API key’s prefix: sandbox_ keys use sandbox, prod_ keys use production.

Show payment methods

Ask Yuno which methods this shopper can use, and put them on screen. Your backend first creates a checkout session (the payment’s identity) and hands it to your app.

Create the checkout session (backend)

A checkout session is Yuno’s record of this one payment: your server asks Yuno for it and hands the ID to your app.
  • Endpoint: POST /v1/checkout/sessions
  • Auth: public-api-key and private-secret-key headers (from the Dashboard under Developers > Credentials)
  • Required: account_id, merchant_order_id, payment_description, country
  • Optional: customer_id (gives the session access to that customer’s enrolled methods), amount, workflow
  • Returns: checkout_session (the value you pass as checkoutSession)
  • Reference: POST /v1/checkout/sessions, with full request/response and auth details
Create the session with workflow: "SDK_SEAMLESS", a field on the session-create body above, not on TransactionConfig. It is what lets the SDK create the payment for you. Without it, the transaction ends in INTERNAL_ERROR. See the workflow field.

Put the methods on screen

The shopper’s choice reaches the SDK as a PaymentMethodSelected: only paymentMethodType (type on Web) is required; vaultedToken and transactionData (data on Web) are optional. Two ways to get it:
  • Use the SDK’s pre-built methods list. Call getPaymentMethodsViews to render a list of methods. When the user picks one, your onPaymentSelected controller receives a PaymentMethodSelected you can pass to start(). See Payment Methods List.
  • Build your own list. Fetch the available payment methods from Yuno’s API and construct PaymentMethodSelected yourself based on the user’s choice. See GET /v1/checkout/sessions/{checkout_session}/payment-methods.

Take the payment

When the shopper confirms, start the payment. Yuno renders the method’s form, runs 3DS if the bank asks for it, and creates the payment. A complete transaction has three pieces:
  1. A checkout session created by your backend.
  2. A TransactionConfig with the session, country, language, and controllers.
  3. A Transaction that you start with a PaymentMethodSelected.
Controllers are how your code receives the SDK’s events. At minimum onStatus, which delivers the final result of the transaction. Provide them through a TransactionController object passed in the config.
TransactionConfig on web is a plain object. Pass it directly to sdkPayments.transaction(...).
On Web, start() without data mounts the method’s form into elementSelector and resolves once the form is on the page. The form has its own Pay button. The shopper taps it, and the result arrives later in onStatus. To use your own button, pass showPayButton: false in the config and call transaction.submit() from it. To pay with details you collected yourself, pass data on paymentMethod, and the SDK runs the payment with no form.

TransactionConfig fields used here

For the full list of fields, see TransactionConfig.

Know it went through

The SDK presents the form, tokenizes the input, creates the payment, handles 3DS if required, and emits the final status to onStatus. Use it to show the shopper the receipt. On Web the SDK shows its own result screen by default. To draw the receipt yourself, pass showStatusScreen: false in the transaction config.
onStatus drives your UI. For fulfillment (shipping goods, granting access), confirm the outcome server-side via webhooks or the payments API; see Confirm on your server.

Creating the payment yourself (optional)

By default, the SDK creates the payment for you. You don’t need this endpoint. If you override createPayment to take control of payment creation, your backend calls this endpoint with the One-Time Token delivered by the SDK.
  • Endpoint: POST /v1/payments
  • Required: One-Time Token, checkout session, account_id, merchant_order_id, description, country, and amount (value + currency)
  • Reference: POST /v1/payments
See createPayment for the override flow.

Test cards

Test cards are provider-specific. The cards below only work when your sandbox routes card payments to the Yuno Test Payment Gateway. If your routing points to another provider (Adyen, Stripe, etc.), these cards are declined, often without an error message. In that case, use that provider’s own test cards instead.
Use these in sandbox to exercise different scenarios. Enter the full tuple exactly as listed: For the full list of cards and scenarios (Mastercard, Amex, more decline codes), see Card detail. For 3DS flows, use the 3DS test cards.

Next steps