Okra Widget Flutter SDK
Flutter SDK for implementing the Okra widget - Okra is a safe and secure web drop-in module and this library provides a front-end web (also available in iOS, Android, and JavaScript) SDK for account authentication and payment initiation for each bank that Okra supports.
Try the demo
Checkout the widget flow to view how the Okra Widget works. Click "See How it Works"
Before getting started
- Checkout our get started guide to create your developer account and retrieve your Client Token, API Keys, and Private Keys.
- Create a sandbox customer, so you can get connecting immediately.
Bonus Points
- Setup Slack Notifications so you can see your API call statuses and re-run calls in real-time!
Getting Started
This library would help you add Okra widget to your hybrid android/ios application in no time. All you need to do is ...
Install
To use this plugin, add okra_widget
as a dependency in your pubspec.yaml file.
dependencies:
okra_widget: ^3.1.6
On iOS, opt-in to the embedded views preview and also enable Arbitrary loads by adding the following configs to the app's Info.plist file
<key>io.flutter.embedded_views_preview</key>
<string>YES</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
Usage
Build with options
var banks = [
"ecobank-nigeria",
"fidelity-bank",
"first-bank-of-nigeria",
"first-city-monument-bank",
"guaranty-trust-bank",
"access-bank",
"unity-bank",
"alat",
"polaris-bank",
"stanbic-ibtc-bank",
"standard-chartered-bank",
"sterling-bank",
"union-bank-of-nigeria",
"united-bank-for-africa",
"wema-bank",
"rubies-bank",
"kuda-bank"
];
Okra.buildWithOptions(context,
key: "3f52ee9d-f081-55a7-a9d8-73d4b5878bd2",
token: "5da6358130a943486f33dced",
color: "#3AB795",
products: ['auth', 'identity', 'balance', 'transactions'],
chargeAmount: 1000,
chargeNote: "testing",
chargeType: "one-time",
chargeCurrency: "NGN",
environment: "production",
clientName: "clientName",
customerBvn: "22188789177",
meta: "Dynamic data type",
options: {
"name": "Test Map"
}
logo:
"https://dash.okra.ng/static/media/okra-logo.514fd943.png",
limit: 3,
currency: "NGN",
isCorporate: false,
showBalance: true,
geoLocation: true,
payment: false,
connectMessage:
"Which account do you want to connect with?",
callbackUrl: "",
redirectUrl: "",
widgetSuccess:
"Your account was successfully linked to SwipeNG",
widgetFailed:
"An unknown error occurred, please try again.",
guarantors: {
"status": false,
"message": "Okra requires you to add guarantors",
"number": 3,
},
filters: {"industry_type": "all", "banks": banks},
onSuccess: (data) {
print("Success");
print(data);
}, onError: (message) {
print("error");
print(message);
}, onClose: (message) {
print("close");
print(message);
});
Build with shortUrl
Okra.buildWithShortUrl(
context,
shortUrl: "ns_aIEz8r",
onSuccess: (data) {
print("Success");
print(data);
},
onError: ( message) {
print("error");
print(message);
},
onClose: (message) {
print("close");
print(message);
}
);
OkraOptions
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
key |
String |
true | undefined | Your public key from Okra. |
token |
String |
true | undefined | Your pubic Key from Okra dashboard. Use test key for test mode and live key for live mode |
products |
ArrayList<Enums.Product> |
true | undefined | The Okra products you want to use with the widget. |
env |
Enums.Environment |
true | undefined | |
clientName |
String |
true | undefined | Name of the customer using the widget on the application |
webhook |
String |
true | undefined | The Url that Okra send the client's data to. |
Data Dictionary
Auth
Field | Required | Description |
---|---|---|
idObjectID |
Yes | Unique Auth ID (Unique Okra Identifier) |
validatedBoolean |
Yes | Customer authentication status |
bankObjectID |
Yes | Unique Bank ID (Unique Okra Identifier) |
customerObjectID |
Yes | Unique Customer ID (Unique Okra Identifier) |
recordObjectID |
Yes | Unique Record ID (Unique Okra Identifier) |
ownerObjectID |
Yes | Unique Company ID (Unique Okra Identifier) (Your Client Token) |
created_atObject |
Yes | Date Auth was fetched |
last_updatedObject |
Yes | Last Date Auth was fetched |
Balance
Field | Required | Description |
---|---|---|
idObjectID |
Yes | Unique Balance ID (Unique Okra Identifier) |
available_balanceInteger |
Yes | Amount of available funds in account |
ledger_balanceInteger |
Yes | Closing balance of account |
currencyString |
Yes | The currency of the account |
connectedBoolean |
Yes | Customer connection status (Did they choose to connect this account to you) |
envString |
Yes | Okra API Env the transaction was pulled from production or production-sandbox |
bankObjectID |
Yes | Unique Bank ID (Unique Okra Identifier) |
accountsObjectID |
Yes | Unique Account ID (Unique Okra Identifier) |
customerObjectID |
Yes | Unique Customer ID (Unique Okra Identifier) |
recordArray of ObjectID |
Yes | Unique Record ID (Unique Okra Identifier) |
created_atObject |
Yes | Date Balance was fetched |
last_updatedObject |
Yes | Last Date Balance was fetched |
Identity
Field | Required | Description |
---|---|---|
idObjectID |
Yes | Unique Identifier ID (Unique Okra Identifier) |
firstnameString |
Yes | Customer First Name |
middlenameString |
Yes | Customer Middle Name |
lastnameString |
Yes | Customer Last Name |
next_of_kinsIdentity Object |
Yes | Customer Next of Kins |
dobDate |
Yes | Customer Date of Birth |
verifiedString |
Yes | BVN Validation status |
scoreString |
Yes | Unique Okra Score |
dtiString |
Yes | Customer Debt to Income Score |
fullnameString |
Yes | Customer Fullname |
company_nameString |
**Yes | Company Name if Corporate Identity |
ninString |
Yes | Customer NIN Number |
national_idString |
Yes | Customer National ID Number |
drivers_lisenceString |
Yes | Customer Driver's License Number |
nimcString |
Yes | Customer National Identity Management Commission (NIMC) Number |
voters_idString |
Yes | Customer Voter's ID Number |
rc_numberString |
Yes | Company's Registered Company Number if Corporate Identity |
phoneArray of String |
Yes | Customer Phone Number |
last_loginString |
Yes | Customer Last Login via Okra |
emailArray of String |
Yes | Customer Email address |
addressArray of String |
Yes | Customer |
mothers_maidenString |
Yes | Customer Mother's Maiden Name |
photo_idsArray of Object |
Yes | Customer's photo ID |
envString |
Yes | Okra API Env the transaction was pulled from production or production-sandbox |
bankObjectID |
Yes | Unique Bank ID (Unique Okra Identifier) |
accountsObjectID |
Yes | Unique Account ID (Unique Okra Identifier) |
customerObjectID |
Yes | Unique Customer ID (Unique Okra Identifier) |
recordArray of ObjectID |
Yes | Unique Record ID (Unique Okra Identifier) |
created_atObject |
Yes | Date Balance was fetched |
last_updatedObject |
Yes | Last Date Balance was fetched |
Transaction
Field | Required | Description |
---|---|---|
idObjectID |
Yes | Unique Transaction ID (Unique Okra Identifier) |
debitInteger |
No | Amount deducted from account |
creditInteger |
No | Amount credited to account |
trans_dateDate |
Yes | Date transaction occurred |
cleared_dateDate |
Yes | Date transaction cleared at bank |
unformatted_trans_dateString |
Yes | Date transaction occurred (from bank) |
unformatted_cleared_dateString |
Yes | Date transaction cleared (from bank) |
branchString |
No | Branch transactions occurred |
refString |
No | Bank reference ID (from bank) |
envString |
Yes | Okra API Env the transaction was pulled from production or production-sandbox |
codeString |
No | Bank Code (from bank) |
benefactorObjectID |
No | Customer ID of sender (within Okra) |
codeString |
No | Bank Code (from bank) |
notesObject |
Yes | Breakdown of Narrative from bank |
bankObjectID |
Yes | Unique Bank ID (Unique Okra Identifier) |
accountObjectID |
Yes | Unique Account ID (Unique Okra Identifier) |
recordArray of ObjectID |
Yes | Unique Record ID (Unique Okra Identifier) |
created_atObject |
Yes | Date transactions was fetched |
last_updatedObject |
Yes | Last Date transactions was fetched |
Notes Data Dictionary
Field | Required | Description |
---|---|---|
descString |
Yes | Narrative / Description of transaction (combination of bank and user entered information) |
topicsArray of String |
Yes | Topics within the desc |
placesArray of String |
Yes | Places mentioned within the desc |
peopleArray of String |
Yes | People mentioned within the desc |
actionsArray of String |
Yes | Actions mentioned within the desc |
subjectArray of String |
Yes | Subject of the desc |
prepositionArray of String |
Yes | Prepositions within desc to understand intent |