Skip to main content
Orientation: Choosing Your Integration Flow, before you begin, please review the Official Integration Flow.
  • Standard Flow (Full Checkout): Recommended for most merchants. Yuno handles the UI, security, and automatic updates for payment methods.
  • Custom Flow (This SDK): Use this only if you require full control over the UX. Note: You will be responsible for manually handling payment statuses, 3DS transitions, and fraud routing data collection.
Integrate Yuno’s Flutter SDK Lite payment and enrollment flows by following these steps.

Requirements

  • Flutter SDK installed (Dart included).
  • iOS 14.0 or above.
  • Android minSdkVersion 21 or above.
  • Java 8 enabled and AndroidX enabled.
  • Android Gradle plugin 4.0.0 or above.
  • Proguard 6.2.2 or above.
  • Kotlin Gradle plugin 1.4.0 or above.
  • FlutterFragmentActivity for MainActivity on Android.

Adding the SDK to your project

This section applies to both Payment and Enrollment flows. Complete these steps before implementing either flow.

Flutter package

Add the Yuno package to your Flutter project:

Android configuration

Add the Yuno Maven repository to your project-level android/build.gradle:
Use FlutterFragmentActivity in MainActivity.kt:
Create a custom Application and initialize the native SDK:
Then register the application class in AndroidManifest.xml:

iOS configuration

No additional iOS-specific configuration is required beyond the Flutter package installation. iOS appearance customization is configured through IosConfig during SDK initialization (see customizations section).

Payment

Follow these steps to integrate the Yuno payment flow in your Flutter application.
1

Create a customer and checkout session

Before initiating a payment, create a customer and checkout session using Yuno’s server-side API.
2

Initialize the SDK

Initialize the Yuno SDK in your Flutter app, typically before runApp in main.dart.
3

Start the checkout process

Set up a payment listener (e.g., YunoPaymentListener) in your widget tree to receive events.
4

Initiate payment

Start the Lite payment flow by calling startPaymentLite with the selected payment method.
5

Get the OTT (one-time token)

After the user completes the form, the SDK generates an OTT delivered to your YunoPaymentListener.
6

Create the payment

Use the OTT from Step 5 to create the payment in your backend via the Create payment endpoint.
7

Continue payment

If the response includes sdk_action_required: true, call continuePayment to handle 3DS or redirects.

Payment status validation

The SDK manages the relationship between frontend SDK status and backend payment status when users interact with payment flows. Understanding this distinction helps you handle payment states correctly in your application.

Sync payment methods (Apple Pay and Google Pay)

For synchronous payment methods like Apple Pay and Google Pay, when a user cancels or closes the wallet UI before a payment service provider (PSP) response is received:
  • SDK status: Returns cancelByUser (CANCELLED_BY_USER)
  • Backend payment status: Remains PENDING until PSP timeout or merchant cancellation
  • Important: The SDK will not return reject or processing in this scenario
This ensures that the backend payment remains in a pending state and can be properly handled by the merchant’s system.

Async payment methods (PIX and QR-based methods)

For asynchronous payment methods like PIX, when a user closes the QR code window before completing the payment:
  • SDK status: Returns processing, optionally with a sub-status such as CLOSED_BY_USER
  • Backend payment status: Remains PENDING and the QR code remains valid until expiry
  • Checkout session reuse: Re-opening the same checkout session can display the same valid QR code
  • No automatic cancellation: The PIX payment is not automatically cancelled when the user closes the QR window
This behavior allows users to return to the payment flow and complete the transaction using the same QR code before it expires.

Expired async payments

If a PIX QR code expires naturally:
  • Backend status: Updated to EXPIRED
  • SDK status: SDK callbacks and polling endpoints return EXPIRED consistently
This ensures merchants receive accurate status information when a payment method has expired.

Enrollment

Follow these steps to enroll payment methods in your Flutter application.
1

Create customer and session

Create a customer and a customer_session in your backend using the Create customer session endpoint.
2

Initialize the SDK

Ensure the SDK is initialized with your API key and configuration.
3

Start enrollment process

Set up a YunoEnrollmentListener to receive status updates.
4

Initiate enrollment

Call enrollmentPayment with the customer session ID.
5

Listen for status

Monitor the enrollment status through your listener callback.
6

Handle deep links (optional)

For methods using external authentication, pass the redirect URL to the SDK.

Parameters

For the full list of parameters and options, see the subsections that follow.

Yuno.init

YunoConfig

IosConfig

Appearance (iOS)

StartPayment (Lite)

MethodSelected

EnrollmentArguments

customizations

You can customize SDK behavior and appearance using the configuration options:
  • YunoConfig for language, save card, and loader handling
  • IosConfig.appearance for iOS UI styling
  • Android styling through native configuration (see below)

iOS customization

iOS appearance is fully customizable through the IosConfig.appearance parameter in Yuno.init(). You can modify visual styling to match your brand identity, including colors, fonts, and button designs.

Available iOS customization options

When using Color(0xFF...) for iOS appearance customization, add import 'dart:ui'; at the top of your file. For more iOS customization options, see SDK customizations (iOS).

Android customization

For Android, the Flutter SDK uses the native Android SDK’s styling system. customization is performed in the native Android layer using Kotlin/Java code when initializing the SDK through YunoSdkAndroidPlugin.initSdk().

YunoConfig (Android)

The Android SDK supports comprehensive styling through the YunoConfig data class:
cardFlow removed from YunoConfig (Android 2.11.0+)Card flow configuration is now handled exclusively through the CheckoutBuilder in the Dashboard. Omit cardFlow from YunoConfig.

YunoStyles

Control the visual appearance of SDK components:

YunoButtonStyles

Fine-tune button appearance with these options:
Configure styles in your Application class during SDK initialization in MyApp.kt. For more Android customization options including XML themes and drawable customization, see SDK customizations (Android). Use --dart-define to avoid hardcoding keys:
Then read it in Dart:
If you also need the key on the Android native side, map dart-defines into BuildConfig and read BuildConfig.YUNO_API_KEY in MyApp (see the Flutter SDK README for the full snippet).

Troubleshooting

Notes

  • The Lite payment flow requires you to render the payment method list and pass the selected paymentMethodType.
  • Use YunoPaymentListener/YunoEnrollmentListener to receive OTT/status updates and drive backend calls.

Supported languages

The Flutter SDK supports the following YunoLanguage values: en (English), es (Spanish), pt (Portuguese), ms (Malay), id (Indonesian), th (Thai), ar (Arabic).