Flutter
Fiuu Mobile XDK Flutter plugin for Android and iOS.
Repository: Mobile-XDK-Fiuu_Flutter
Package: fiuu_mobile_xdk_flutter on pub.dev (3.34.36)
Wiki: Installation Guidance
Requirements
| Requirement | Version |
|---|---|
| Flutter | 3.24.5+ |
| Dart | 3.4.0+ |
| Plugin | 3.34.36 |
Minimum Android SDK (minSdkVersion) | 26+ |
| Android compile SDK | 37+ (required by Fiuu Android Library 3.34.41+) |
| Android Gradle Plugin | 9.1.1+ |
| Gradle | 9.0+ |
| JDK | 17 |
| Xcode | 13+ |
| Minimum iOS | 16+ |
Bundled native SDK versions
| Platform | Dependency | Version |
|---|---|---|
| Android | com.github.FiuuPayment:Mobile-XDK-Fiuu_Android_Library (JitPack) | 3.34.41 |
| iOS | Fiuu iOS XDK (via plugin) | Bundled with plugin release |
Installation
1. Add Dependency
In pubspec.yaml:
dependencies:
fiuu_mobile_xdk_flutter: "^3.34.36"
Run:
flutter pub get
2. Import
import 'package:fiuu_mobile_xdk_flutter/fiuu_mobile_xdk_flutter.dart';
3. iOS Info.plist
Add the following keys:
- App Transport Security Settings → Allow Arbitrary Loads →
YES - NSPhotoLibraryUsageDescription →
Payment images - NSPhotoLibraryAddUsageDescription →
Payment images
4. Android Setup
Ensure your host app meets the shared Android requirements:
minSdkVersion = 26compileSdkVersion = 37- JitPack in root
android/build.gradlerepositories:
maven { url 'https://jitpack.io' }
5. Android Release Build (ProGuard)
Create android/app/proguard-rules.pro:
-keep class com.fiuu.xdk.** { *; }
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
Enable in android/app/build.gradle:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Payment Details Object
var paymentDetails = {
'mp_dev_mode': false,
'mp_username': 'username',
'mp_password': 'password',
'mp_merchant_ID': 'merchantid',
'mp_app_name': 'appname',
'mp_verification_key': 'vkey123',
'mp_amount': '1.10', // Minimum 1.01
'mp_order_ID': 'orderid123', // Must be unique per payment attempt
'mp_currency': 'MYR',
'mp_country': 'MY',
'mp_channel': 'multi',
'mp_bill_description': 'bill description',
'mp_bill_name': 'bill name',
'mp_bill_email': 'email@domain.com',
'mp_bill_mobile': '+1234567',
'mp_channel_editing': false,
'mp_editing_enabled': false,
'mp_express_mode': false,
'mp_allowed_channels': ['credit', 'credit3'],
'mp_language': 'EN',
};
See Payment Parameters for the complete parameter list.
Generate a new mp_order_ID for every payment attempt. Reusing an order ID can cause transaction failures.
Start Payment
String? result = await MobileXDK.start(paymentDetails);
print("Result: $result");
The result is a JSON string. Standard checkout returns the status_code format — parse and verify the chksum on your backend. See Response Handling.
Google Pay (Android only)
Use MobileXDK.googlePay() for express Google Pay. Results use the StatCode format — verify with VrfKey.
import 'dart:io' show Platform;
// Show Google Pay button on Android only
if (Platform.isAndroid) {
var paymentDetails = {
'mp_sandbox_mode': true,
'mp_core_env': '4', // Sandbox
'mp_merchant_ID': 'YOUR_MERCHANT_ID',
'mp_verification_key': 'YOUR_VERIFICATION_KEY',
'mp_order_ID': '${DateTime.now().millisecondsSinceEpoch}',
'mp_currency': 'MYR',
'mp_country': 'MY',
'mp_amount': '1.01',
'mp_bill_description': 'Test Google Pay',
'mp_bill_name': 'Google Pay',
'mp_bill_email': 'example@gmail.com',
'mp_bill_mobile': '123456789',
'mp_company': 'Your Company Name',
'mp_gpay_channel': ['SHOPEEPAY', 'TNG-EWALLET', 'CC'],
'mp_extended_vcode': false,
};
String? result = await MobileXDK.googlePay(paymentDetails);
print('Google Pay result: $result');
}
Production requirements:
- Follow Google's production access guide (Gateway integration type).
- Use a signed release build with production credentials (
mp_sandbox_mode: false,mp_core_env: '2'or omit). SHOPEEPAYandTNG-EWALLETapply toMY/MYRonly.
For non-express Google Pay (standard checkout with Google Pay hidden/shown via parameters), use MobileXDK.start() with mp_hide_googlepay, mp_sandbox_mode, and related params. See Payment Parameters.
Express Mode
paymentDetails['mp_express_mode'] = true;
paymentDetails['mp_channel'] = 'TNG-EWALLET';
Credit channels cannot use express mode. See Core Integration.
Environment Configuration
Set mp_core_env to select the XDK environment. See Core Integration.
mp_core_env | Environment | Base URL |
|---|---|---|
"1" | Production - V1 | https://pay.fiuu.com/RMS/API/xdk/ |
"2" | Production - V2 | https://xdk.fiuu.com/ |
"3" | UAT - V2 | https://uat-xdk.fiuu.com/ |
"4" | Sandbox - V2 | https://sandbox-xdk.fiuu.com/ |
| (default) | Production - V2 | https://xdk.fiuu.com/ |
paymentDetails['mp_core_env'] = '4'; // Sandbox
Deeplink Setup
Configure deeplinks for e-wallet redirection. See Deeplink Setup.
Test with:
flutter run --release
Related Guides
- Payment Parameters — Full parameter reference
- Core Integration
- Response Handling
- Deeplink Setup
- Installation Guidance (Wiki)