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.
FlutterFragmentActivityforMainActivityon 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-levelandroid/build.gradle:
FlutterFragmentActivity in MainActivity.kt:
Application and initialize the native SDK:
AndroidManifest.xml:
iOS configuration
No additional iOS-specific configuration is required beyond the Flutter package installation. iOS appearance customization is configured throughIosConfig 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.
- Use Create customer to represent the person making the payment.
- Use Create checkout session to define transaction details.
Keep the returned
checkout_sessionID for the next steps.
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
PENDINGuntil PSP timeout or merchant cancellation - Important: The SDK will not return
rejectorprocessingin this scenario
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 asCLOSED_BY_USER - Backend payment status: Remains
PENDINGand 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
Expired async payments
If a PIX QR code expires naturally:- Backend status: Updated to
EXPIRED - SDK status: SDK callbacks and polling endpoints return
EXPIREDconsistently
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:YunoConfigfor language, save card, and loader handlingIosConfig.appearancefor iOS UI styling- Android styling through native configuration (see below)
iOS customization
iOS appearance is fully customizable through theIosConfig.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 throughYunoSdkAndroidPlugin.initSdk().
YunoConfig (Android)
The Android SDK supports comprehensive styling through theYunoConfig data class:
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).
Environment variables (recommended)
Use--dart-define to avoid hardcoding keys:
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/YunoEnrollmentListenerto receive OTT/status updates and drive backend calls.
Supported languages
The Flutter SDK supports the followingYunoLanguage values:
en (English), es (Spanish), pt (Portuguese), ms (Malay), id (Indonesian), th (Thai), ar (Arabic).