Okra Widget Flutter SDK

alt text

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: ^1.0.0

On iOS, opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file with the key io.flutter.embedded_views_preview and the value true.

<dict>  
  <key>io.flutter.embedded_views_preview</key>
  <true/>  
</dict>

Usage

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"
                  ];


                  var okraOptions = {
                    "key": "public key",
                    "token": "client token",
                    "products": [
                      "auth",
                      "balance",
                      "identity",
                      "transactions"
                    ],
                    "environment": "production",
                    "clientName": "Bassey",
                    "color" : "#9013FE",
                    "limit" : "3",
                    "isCorporate" : false,
                    "connectMessage" : "Which account do you want to connect with?",
                    "callback_url" : "",
                    "redirect_url" : "",
                    "logo" : "https://dash.okra.ng/static/media/okra-logo.514fd943.png",
                    "widget_success" : "Your account was successfully linked to SwipeNG",
                    "widget_failed" : "An unknown error occurred, please try again.",
                    "currency" : "NGN",
                    "noPeriodic" : true,
                    "exp" : "",
                    "success_title" : "null",
                    "success_message" : "null",
                    "guarantors" : {
                      "status": false,
                      "message": "Okra requires you to add guarantors",
                      "number": 3,
                    },
                    "filter" : {
                      "industry_type": "all",
                      "banks": banks
                    }
                  };

                  OkraHandler reply = await Okra.create(context, okraOptions);

OkraOptions

NameTypeRequiredDefault ValueDescription
isWebviewbooleantruetrue
keyStringtrueundefinedYour public key from Okra.
tokenStringtrueundefinedYour pubic Key from Okra dashboard. Use test key for test mode and live key for live mode
productsArrayList<Enums.Product>trueundefinedThe Okra products you want to use with the widget.
envEnums.Environmenttrueundefined
clientNameStringtrueundefinedName of the customer using the widget on the application
webhookStringtrueundefinedThe Url that Okra send the client's data to.

Data Dictionary

Auth

FieldRequiredDescription
id
ObjectID
YesUnique Auth ID (Unique Okra Identifier)
validated
Boolean
YesCustomer authentication status
bank
ObjectID
YesUnique Bank ID (Unique Okra Identifier)
customer
ObjectID
YesUnique Customer ID (Unique Okra Identifier)
record
ObjectID
YesUnique Record ID (Unique Okra Identifier)
owner
ObjectID
YesUnique Company ID (Unique Okra Identifier) (Your Client Token)
created_at
Object
YesDate Auth was fetched
last_updated
Object
YesLast Date Auth was fetched

Balance

FieldRequiredDescription
id
ObjectID
YesUnique Balance ID (Unique Okra Identifier)
available_balance
Integer
YesAmount of available funds in account
ledger_balance
Integer
YesClosing balance of account
currency
String
YesThe currency of the account
connected
Boolean
YesCustomer connection status (Did they choose to connect this account to you)
env
String
YesOkra API Env the transaction was pulled from production or production-sandbox
bank
ObjectID
YesUnique Bank ID (Unique Okra Identifier)
accounts
ObjectID
YesUnique Account ID (Unique Okra Identifier)
customer
ObjectID
YesUnique Customer ID (Unique Okra Identifier)
record
Array of ObjectID
YesUnique Record ID (Unique Okra Identifier)
created_at
Object
YesDate Balance was fetched
last_updated
Object
YesLast Date Balance was fetched

Identity

FieldRequiredDescription
id
ObjectID
YesUnique Identifier ID (Unique Okra Identifier)
firstname
String
YesCustomer First Name
middlename
String
YesCustomer Middle Name
lastname
String
YesCustomer Last Name
next_of_kins
Identity Object
YesCustomer Next of Kins
dob
Date
YesCustomer Date of Birth
verified
String
YesBVN Validation status
score
String
YesUnique Okra Score
dti
String
YesCustomer Debt to Income Score
fullname
String
YesCustomer Fullname
company_name
String
**YesCompany Name if Corporate Identity
nin
String
YesCustomer NIN Number
national_id
String
YesCustomer National ID Number
drivers_lisence
String
YesCustomer Driver's License Number
nimc
String
YesCustomer National Identity Management Commission (NIMC) Number
voters_id
String
YesCustomer Voter's ID Number
rc_number
String
YesCompany's Registered Company Number if Corporate Identity
phone
Array of String
YesCustomer Phone Number
last_login
String
YesCustomer Last Login via Okra
email
Array of String
YesCustomer Email address
address
Array of String
YesCustomer
mothers_maiden
String
YesCustomer Mother's Maiden Name
photo_ids
Array of Object
YesCustomer's photo ID
env
String
YesOkra API Env the transaction was pulled from production or production-sandbox
bank
ObjectID
YesUnique Bank ID (Unique Okra Identifier)
accounts
ObjectID
YesUnique Account ID (Unique Okra Identifier)
customer
ObjectID
YesUnique Customer ID (Unique Okra Identifier)
record
Array of ObjectID
YesUnique Record ID (Unique Okra Identifier)
created_at
Object
YesDate Balance was fetched
last_updated
Object
YesLast Date Balance was fetched

Transaction

FieldRequiredDescription
id
ObjectID
YesUnique Transaction ID (Unique Okra Identifier)
debit
Integer
NoAmount deducted from account
credit
Integer
NoAmount credited to account
trans_date
Date
YesDate transaction occurred
cleared_date
Date
YesDate transaction cleared at bank
unformatted_trans_date
String
YesDate transaction occurred (from bank)
unformatted_cleared_date
String
YesDate transaction cleared (from bank)
branch
String
NoBranch transactions occurred
ref
String
NoBank reference ID (from bank)
env
String
YesOkra API Env the transaction was pulled from production or production-sandbox
code
String
NoBank Code (from bank)
benefactor
ObjectID
NoCustomer ID of sender (within Okra)
code
String
NoBank Code (from bank)
notes
Object
YesBreakdown of Narrative from bank
bank
ObjectID
YesUnique Bank ID (Unique Okra Identifier)
account
ObjectID
YesUnique Account ID (Unique Okra Identifier)
record
Array of ObjectID
YesUnique Record ID (Unique Okra Identifier)
created_at
Object
YesDate transactions was fetched
last_updated
Object
YesLast Date transactions was fetched

Notes Data Dictionary

FieldRequiredDescription
desc
String
YesNarrative / Description of transaction (combination of bank and user entered information)
topics
Array of String
YesTopics within the desc
places
Array of String
YesPlaces mentioned within the desc
people
Array of String
YesPeople mentioned within the desc
actions
Array of String
YesActions mentioned within the desc
subject
Array of String
YesSubject of the desc
preposition
Array of String
YesPrepositions within desc to understand intent

Libraries

helper
okra
okra_handler
okra_widget
web