Seamless (Flutter)
This page provides step-by-step instructions for integrating the Seamless Flutter SDK payment functionalities into your application.
Prerequisites
Ensure all required Flutter SDK dependencies are included in your project before following the setup example.
Step 1: Add the SDK Dependency
To add the Yuno SDK to your Flutter project, run the following command:
dart pub add yuno
Step 2: Initialize the SDK with the Public Key
Create an instance of Yuno.init
by providing a valid PUBLIC_API_KEY
. Refer to the Yuno documentation for details on obtaining API credentials.
await Yuno.init(
apiKey: 'your_api_key_here',
country_code: 'your_country_code', // The complete list of country_codes is available on https://docs.y.uno/docs/country-coverage-yuno-sdk
yunoConfig: YunoConfig(
lang: YunoLanguage.en, // supported languages: ENGLISH, SPANISH, PORTUGUESE, MALAY, INDONESIAN, THAI
cardflow: CardFlow.multiStep, // default cardflow
saveCardEnable: true, // default saveCardEnable
keepLoader: true, // default saveCardEnable
),
iosConfig: IosConfig(), // Optional, can use default value
);
Below is a table describing the parameters required for initializing the Yuno SDK in your Flutter application. These settings allow you to customize the SDK behavior to align with your application needs:
Parameter | Description |
---|---|
| Your unique public API key for authentication. |
| The user’s country code. Refer to the Country Coverage page for a complete list of supported country codes. |
| Configures various SDK settings. Contains additional parameters listed below. |
| The language for SDK content. Supported options include: |
| |
| |
| |
| |
| |
| |
| Defines the card flow type for the payment process. The default is |
| Specifies whether to enable the "Save Card" option. Defaults to |
| Controls whether to keep the loader visible. Defaults to |
| Optional iOS-specific configurations. If omitted, the default configuration is used. |
Step 3: Initialize Seamless SDK
The seamless checkout and payment process is initiated with a single method Yuno.startPaymentSeamlessLite
. Use it with async/await
:
Future<YunoStatus> startPaymentSeamlessLite(
arguments: SeamlessArguments(
showPaymentStatus: true, // optional parameter by default is true
checkoutSession: 'YOUR_CHECKOUT_SESSION',
methodSelected: MethodSelected(
vaultedToken: 'YOUR_VAULTED_TOKEN',
paymentMethodType: 'YOUR_PAYMENT_METHOD_TYPE',
),
)
);
// use
final yunoStatus = await Yuno.startPaymentSeamlessLite(arguments: ...);
Seamless Arguments
Parameter | Description |
---|---|
showPaymentStatus | Optional. When true , displays the SDK’s default result screen. Default: true . |
checkoutSession | Refers to the current payment's checkout session. |
methodSelected | Accepts vaultedToken and paymentMethodType parameters. |
Transaction States
After the payment is completed, the SDK returns different transaction states:
Transaction State | Description |
---|---|
succeeded | Transaction completed successfully. |
fail | Payment process failed due to an error. |
processing | Payment is being processed, awaiting approval. |
reject | Transaction was rejected due to various reasons (e.g., insufficient funds, fraud detection). |
internalError | Unexpected error occurred on the backend. |
userCancell | User voluntarily canceled the payment. |
Additional Features
- Continue Payment: Use
continuePayment
to handle asynchronous payment steps if required. - Customizations: Configure SDK appearance, update payment status, or integrate 3DS into your flow.
For a full implementation example, refer to the Demo App on GitHub.
Updated about 21 hours ago