Skip to main content

Overview

The Yuno Flutter SDK provides a cross-platform payment integration that works on both iOS and Android from a single Dart codebase. It wraps the native iOS and Android SDKs, providing a Flutter-idiomatic API with widgets and streams.
The Flutter SDK maintains SAQ-A PCI compliance on both platforms. Card data never touches your servers.

Prerequisites

  • Flutter 3.16+
  • Dart 3.2+
  • iOS 14.0+ deployment target
  • Android minimum SDK: API 21 (Android 5.0)
  • Xcode 15+ (for iOS builds)
  • Android Studio (for Android builds)
  • Yuno API keys (Authentication)
  • At least one payment method enabled in your Dashboard

Installation

1

Add the dependency

Add yuno_sdk_flutter to your pubspec.yaml:
Then run:
2

iOS platform setup

Set the minimum iOS deployment target in ios/Podfile:
Install iOS dependencies:
If using Apple Pay, add the following to ios/Runner/Info.plist:
3

Android platform setup

Set the minimum SDK version in android/app/build.gradle.kts:
Add the Yuno Maven repository in android/build.gradle.kts:
If using Google Pay, add to android/app/src/main/AndroidManifest.xml:

SDK Initialization

Initialize the SDK early in your app, typically in main.dart:

Configuration options

Never embed your private secret key in the Flutter app. Use only the public API key for client-side initialization.

Full Checkout

Full Checkout renders all enabled payment methods with a single widget.
1

Create a checkout session (server-side)

Create a session from your backend:
Pass the checkout_session token to your Flutter app.
2

Launch Full Checkout

3

Verify payment (server-side)

Always confirm the payment status from your backend:
Client-side callbacks indicate the UI outcome only. Always verify the final payment status server-side via webhooks or the GET Payment API.

Using the YunoCheckout widget

For declarative integration, use the YunoCheckout widget:

Seamless Checkout

Seamless Checkout gives you control over payment method selection while Yuno handles the payment form.
1

Retrieve available payment methods

2

Launch Seamless Checkout for selected method

Payment callbacks via streams

For reactive architectures, listen to the payment event stream:

3DS Handling

The SDK handles 3D Secure authentication automatically on both platforms. When a payment requires 3DS, the SDK presents the authentication challenge within the checkout flow. No additional code is required. The payment result includes the final outcome after 3DS completes.
Test 3DS flows in sandbox using Yuno’s test card numbers. Check the Testing guide for available test credentials.

Platform Channels for Native Features

Apple Pay (iOS only)

Google Pay (Android only)

Customization

Customize the checkout appearance to match your app’s design:

Localization

The SDK supports automatic localization based on the device locale. Override with:
Supported languages: English, Spanish, Portuguese, Indonesian, Malay, Thai.

Error Handling

Common error codes

Testing in Sandbox

1

Use sandbox environment

Set environment: YunoEnvironment.sandbox during initialization.
2

Use test credentials

Use sandbox API keys from Dashboard > API Keys > Sandbox.
3

Test on both platforms

Run tests on both iOS simulator and Android emulator to verify platform-specific behavior:
4

Test with Yuno test cards

Use Yuno-provided test card numbers to simulate different outcomes. See Testing.
Sandbox transactions use simulated providers. Some payment methods may have limited availability in sandbox compared to production.

Troubleshooting

SDK not initializing

  • Verify YunoSDK.initialize() is called before runApp() in main.dart
  • Ensure WidgetsFlutterBinding.ensureInitialized() is called first
  • Confirm the public API key is correct and matches your environment

iOS build fails

  • Verify platform :ios, '14.0' is set in ios/Podfile
  • Run cd ios && pod install --repo-update && cd ..
  • Clean the build: flutter clean && flutter pub get

Android build fails

  • Verify minSdk = 21 is set in android/app/build.gradle.kts
  • Ensure the Yuno Maven repository is added to project-level build.gradle.kts
  • Sync Gradle: cd android && ./gradlew clean && cd ..

Checkout not appearing

  • Ensure the checkout session token is valid and not expired
  • Verify context is from a mounted widget when calling startFullCheckout
  • Check that at least one payment method is enabled in Dashboard for the specified country

Platform-specific issues

  • Use flutter doctor to verify your development environment
  • Test on physical devices in addition to simulators/emulators
  • Check platform-specific logs:
    • iOS: Xcode console
    • Android: Logcat with tag filter YunoSDK

Hot reload limitations

SDK initialization state is preserved during hot reload but not hot restart. If checkout behavior is unexpected during development, perform a full restart:

Next steps

Mobile SDK Overview

Compare all mobile SDK options.

iOS SDK

Need native iOS integration instead?

Android SDK

Need native Android integration instead?

Testing

Test card numbers and sandbox setup.