oneapp_sdk 0.0.7
oneapp_sdk: ^0.0.7 copied to clipboard
OneApp Cobranding SDK - Flutter plugin for payment processing.
oneapp_sdk β Flutter Integration Guide #
The OneApp Cobranding SDK provides secure mobile authentication, payments, device binding, user profile access, wallet balance inquiry, TPIN management, and more.
This SDK is designed for FinTech, Payments, and Wallet applications.
Important Note #
Our company will provide the Organization ID and Secret Key to integrate this SDK.
Without these values, the SDK will not function.
- Always call modesetup() first before any SDK action.
- Do not call SDK methods without a valid BuildContext.
- Organization credentials are required from the company.
- SDK handles permission dialogs automatically.
Installation #
Add this to your pubspec.yaml:
dependencies:
oneapp_sdk:
path: ./oneapp_sdk # OR use git/path based on your setup
Import package:
import 'package:oneapp_sdk/oneapp_sdk.dart';
Android Setup #
Add required permissions in your AndroidManifest.xml:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
The SDK automatically requests these permissions when needed.
Initialize OneApp SDK #
Call modesetup() before using any other SDK method.
bool status = await OneAppSdk.modesetup(
context,
"TEST", // or "LIVE"
"ORG_ID", // Provided by company
"SECRET_KEY", // Provided by company
"9999999999", // User Mobile Number
"TOKEN_HERE", // Token from your backend
false, // isRegistration
Colors.green, // optional theme color
);
if (status) {
}
π± Available SDK Methods #
1. Change TPIN #
var result = await OneAppSdk.ChnageTpin(
context: context,
mobileNumber: "9999999999",
organizationId: "ORG_ID",
);
2. Mini Statement #
var result = await OneAppSdk.statement(
context: context,
mobileNumber: "9999999999",
organizationId: "ORG_ID",
);
3. Registration #
var result = await OneAppSdk.registration(
context,
"9999999999",
"ORG_ID",
);
4. Add Money (TaPay) #
var response = await OneAppSdk.initiateTaPayAddMoney(
context: context,
orderId: "ORD123",
amount: "500",
mobilenum: "9999999999",
mode: "TEST",
orgID: "ORG_ID",
);
5. Balance Enquiry #
var result = await OneAppSdk.BalanceEnquiry(
context: context,
MobileNumber: "9999999999",
orgID: "ORG_ID",
);
6. Validate Mobile Number #
var result = await OneAppSdk.ValidateUser(
context: context,
MobileNumber: "9999999999",
orgID: "ORG_ID",
);
7. Update Profile #
var result = await OneAppSdk.updateProfile(
context,
"9999999999",
"User Name",
"email@example.com",
"1995-01-01",
);
8. Fund Limit Checking #
String? result = await OneAppSdk.fundCheckingAPI(
context,
"9999999999",
"1000",
);
9. View Profile #
var result = await OneAppSdk.viewProfile(
context,
"9999999999",
);
10. Payment Initiation #
var result = await OneAppSdk.initiatePaymet(
context: context,
orderId: "ORD123",
amount: "1000",
mobilenum: "9999999999",
orgID: "ORG_ID",
SchemeID: "SCH001",
Narration: "Bill Payment",
BTNumber: "BT123",
MerchantID: "M123",
);
11. Device Binding #
var result = await OneAppSdk.devicebinding(
context: context,
PhoneNumber: "9999999999",
orgID: "ORG_ID",
);
Runtime Permissions #
SDK automatically handles required permissions:
- Location
- Camera
- SMS
- Phone
If the user permanently denies a permission, the SDK automatically shows an Open Settings dialog.
π Environment Modes #
| Mode | Description |
|---|---|
TEST |
QA environment |
LIVE |
Production environment |
Use the correct ORG_ID and SECRET_KEY provided by the company.
π¨ Theme Customization #
You can customize the SDK theme color:
OneAppSdk.modesetup(context, "TEST", ORG_ID, KEY, number, token, false, Colors.blue);