Transaction class. What changes between
integrations is which parameters you pass and which controllers you
override. Each decision is independent. Combine them freely.
This page walks through the decisions you’ll make and points you to the
relevant documentation for each.
Flip the switch in each step and the code on the right assembles itself for your platform. Every block the code uses is also written under its step, so you can compose by hand: start from the base, then add the block of each step where you chose the non-default answer. A configuration block replaces the TransactionConfig, a payment-method block replaces the PaymentMethodSelected, a flag line goes inside TransactionConfig, and a controller block goes inside your controller class, or inside the transaction options on Web.
Base
The SDK does everything: it shows the form, creates the payment, handles 3DS and reports the result toonStatus. Create the checkout session with workflow: "SDK_SEAMLESS" for this base.Base code
Base code
- iOS
- Android
- Web
1. Are you processing a payment or saving a payment method?
This decision affects which session type you create on your backend and pass to the SDK.- To process a payment, create a checkout session and pass it to
TransactionConfigascheckoutSession. Use this when you want to charge the customer. - To save a payment method without charging, create a customer
session and pass it as
customerSession. Use this when you want to enroll a card or other method for future use. - To pay and enroll at the same time, pass
checkoutSessiononly:- Cards. Enable the “save card on payment” flag in your Checkout Builder. The SDK charges the customer and stores the card for future use.
- Other payment methods. Make sure the enrollable variant of
the method is added in your connections. When it is, the SDK
handles payment and enrollment together based on the checkout
session alone. On Web, also pass
savePaymentMethodEnabled: trueinTransactionConfigand create the checkout session with acustomer_id. The SDK then adds a save option to the form.
checkoutSession and customerSession at the same
time.See Sessions and
Enrollment.Use this configuration to enroll instead of charging
Use this configuration to enroll instead of charging
- iOS
- Android
- Web
2. Who creates the payment?
This decision affects whether you overridecreatePayment.- Default. The SDK creates the payment. After tokenization, the
SDK calls Yuno to create the payment, handles 3DS if needed, and
emits the final status to
onStatus. You don’t override anything. Create the checkout session withworkflow: "SDK_SEAMLESS"so the SDK can drive payment creation end-to-end. See theworkflowfield. - You create the payment. Override
createPaymentto receive the token. Send it to your backend, create the payment by callingPOST /v1/payments, and resolve the Promise/Task. The SDK then queries the status and continues the flow.
In an enrollment flow (when you pass
customerSession),
createPayment is not invoked with payment data. There is no
payment to create. Overriding this controller has no effect for
enrollment.createPayment.Add this block to your controller when you create the payment
Add this block to your controller when you create the payment
- iOS
- Android
- Web
3. Who collects the payment data?
This decision affects whether you passtransactionData in
PaymentMethodSelected.- Default. The SDK shows forms. The SDK presents the appropriate form (card form, APM data form, etc.) and collects input from the user.
- You provide the data. Pass
transactionData(dataon Web) inPaymentMethodSelectedwith the values already collected (for example, card details captured by your own UI). The SDK skips the forms and tokenizes directly.
PaymentMethodSelected
and TransactionData.Use this PaymentMethodSelected when you collected the data yourself
Use this PaymentMethodSelected when you collected the data yourself
- iOS
- Android
- Web
4. Who controls the form’s UI? (iOS, Android)
This decision affects whether you overrideshowView.- Default. The SDK presents the form full-screen. The SDK shows the form with its own header and submit button.
- You embed the form. Override
showViewto receive the form view and aTransactionProcesscontrol. Place the view in your own layout and callprocess.onSubmit()to control submission.
On Web: your own pay button instead of showView
On Web the SDK renders the form inside the element you pass as elementSelector, so the form already sits in your layout. To use your own submit button, set showPayButton: false in TransactionConfig and call transaction.submit() from your button after start() has resolved. If the form is incomplete, submit() reports INTERNAL_ERROR with code FORM_INVALID through onStatus and keeps the form mounted. submit() is not available for enrollment transactions.See showView.Add this block to your controller when you embed the form
Add this block to your controller when you embed the form
- iOS
- Android
5. Who shows the loader?
This decision affects whether you overrideshowLoading.- Default. The SDK shows its own loader during tokenization, payment creation, and status polling.
- You show your own loader. Override
showLoadingto receiveisLoading: true | falseand render your own UI.
showLoading.Add this block to your controller when you show your own loader
Add this block to your controller when you show your own loader
- iOS
- Android
- Web
6. Should the SDK show a result screen after the transaction?
This decision is controlled by a flag inTransactionConfig, not by
overriding a controller.- Default. The SDK does not show a result screen. The transaction
finishes silently and you receive the final status through
onStatus. - The SDK shows a result screen. Set
showStatusScreen: trueinTransactionConfigand the SDK will present its built-in success/failure screen after the transaction finishes.
showStatusScreen: false in TransactionConfig.On iOS, put the flag after controller, as the last argument. Swift
requires the arguments in the order the initializer declares them.onStatus is always called when the transaction finishes, regardless
of this flag. It’s the controller you use to know the final result and
react accordingly.See TransactionConfig
and onStatus.Add this line to TransactionConfig to show the SDK's result screen
Add this line to TransactionConfig to show the SDK's result screen
- iOS
- Android
- Web
Always implement onStatus
Regardless of which decisions you make above, you should always
implement onStatus. It’s the only way to know whether the transaction
succeeded, failed, was rejected, or ended in any other final state.
You’ll typically use that information to navigate, refresh data,
or update your own UI.onStatus is invoked when the SDK has finished all its work
(tokenization, payment creation, 3DS, status polling).On iOS, asynchronous methods such as PIX or boleto also report
PENDING before the final status. Treat PENDING as not final. See
onStatus.On Web, onStatus can report more than once on one transaction. A
submit with an incomplete form reports INTERNAL_ERROR with code
FORM_INVALID and keeps the form mounted. A declined card can be
retried in place, and the retry reports its own status.See onStatus and
Status.Quick reference
Next steps
- Get Started. Install the SDK and run your first transaction.
- Configuration. Full reference for
TransactionConfig,PaymentMethodSelected, andTransactionData. - Controllers. Full reference for each controller and what changes when you override it.