Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng.okra.com:okra

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng.okra.com:okra

Okra’s API empowers companies and developers to build products with seamless access to inclusive financial data and secure payments..

  • 1.0.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Okra Widget Android SDK

Official Okra SDK for Android applications. Don't forget to star ✨

About Okra

Okra’s API empowers companies and developers to build products with seamless access to inclusive financial data and secure payments.

alt text

Andoird SDK for implementing the OkraJS widget - OkraJS is a safe and secure web drop-in module and this library provides a front-end web (also available in iOS and Android) 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.

buildWithShortURL

  • If you are using the buildWithShortURL version, you will first need to create a link on your dashboard, and use the short url returend at the end of the creation flow.

Bonus Points

Install

gradle
  1. Add it in your root build.gradle at the end of repositories:
allprojects {
  repositories {
   ...
   maven { url 'https://jitpack.io' }
  }
}

  1. Add the dependency:
dependencies {
  implementation 'ng.okra.com:okra:1.0.0'
 }

Usuage

    val activityResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()
    ) {
        if (it.resultCode == RESULT_OK && it.data != null) {
            val okraResult = it.data!!.getStringExtra(OkraMainActivity.OKRA_RESULT)
            //Successful operation, get the data and do whatever you want with it.
            Toast.makeText(this, okraResult, Toast.LENGTH_SHORT).show()
        } else {
            val okraResult = it.data!!.getStringExtra(OkraMainActivity.OKRA_RESULT)
            Toast.makeText(this, okraResult, Toast.LENGTH_SHORT).show()
        }
    }


    val okraOptions = OkraOptions.ShortUrlBuilder("INSERT SHORT URL")
            .build()

    val intent = OkraMainActivity.newIntent(this, okraOptions)
    activityResultLauncher.launch(intent)

For options, just use

    val activityResultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()
    ) {
        if (it.resultCode == RESULT_OK && it.data != null) {
            val okraResult = it.data!!.getStringExtra(OkraMainActivity.OKRA_RESULT)
            //Successful operation, get the data and do whatever you want with it.
            Toast.makeText(this, okraResult, Toast.LENGTH_SHORT).show()
        } else {
            val okraResult = it.data!!.getStringExtra(OkraMainActivity.OKRA_RESULT)
            Toast.makeText(this, okraResult, Toast.LENGTH_SHORT).show()
        }
    }

    val okraOptions = OkraOptions.OptionsBuilder("INSERT KEY HERE","INSERT TOKEN","INSERT ENV HERE","INSERT NAME HERE", "INSERT PRODUCTS HERE")
                    //Add additional properties here.
                    .appId("")
                    .color("")
                    .connectMessage("")
                    .currency("")
                    .isCorporate(true)
                    .build()
    val intent = OkraMainActivity.newIntent(this, okraOptions)
    activityResultLauncher.launch(intent)


Okra.buildWithOptions Options

NameTypeRequiredDefault ValueDescription
app_id StringtrueYour app id from your Okra Dashboard.
okraKey StringtrueYour public key from your Okra Dashboard.
token StringtrueYour token from your Okra Dashboard.
env Stringfalseproductionproduction(live)/production-sandbox (test)
productsArraytrue['Auth']The Okra products you want to use with the widget.
paymentBooelanfalseWhether you want to initiate a payment (https://docs.okra.ng/docs/payments)
charge ObjectfalsePayment charge opject (https://docs.okra.ng/docs/widget-properties#set-up-payments)
productsArraytrue['Auth']The Okra products you want to use with the widget.
logo String(URL)falseOkra's Logo
name StringfalseYour Company's nameName on the widget
colorHEX false#3AB795Theme on the widget
limitNumberfalse24Statement length
filterObjectfalseFilter for widget
isCorporateBoolenfalsefalseCorporate or Individual account
connectMessageStringfalseInstruction to connnect account
widget_successStringfalseWidget Success Message
widget_failedStringfalseWidget Failed Message
callback_urlString(Url)false
currencyStringfalseNGNWallet to bill
expDatefalseWon't expireExpirary date of widget
optionsObjectfalseYou can pass a object custom values eg id
onSuccessFunctionfalseAction to perform after widget is successful
onCloseFunctionfalseAction to perform if widget is closed
onErrorFunctionfalseAction to perform on widget Error
BeforeCloseFunctionfalseAction to perform before widget close
onEventFunctionfalseAction to perform on widget event

View a complete list of customizable options here

Okra.buildWithShortUrl Options

NameTypeRequiredDescription
short_urlStringtrueYour generated url from our App builder.
onSuccessFunctionfalseAction to perform after widget is successful
onCloseFunctionfalseAction to perform if widget is closed
onErrorFunctionfalseAction to perform on widget Error
BeforeCloseFunctionfalseAction to perform before widget close
onEventFunctionfalse

Done connecting?

Checkout our API Overiview and see how to use the data you've received and other products you can use to create more personalized experiences for your customers!

Not a developer?

Get started without writing a single line of code, Try our App Builder! Click here to get started

Contributions

Want to help make this package even more awesome? feel free to send in your PR to dev branch and we'd review it and ensure it gets added to the next release 😊

Licensing

This project is licensed under MIT license.

FAQs

Package last updated on 05 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc