Integrate the Nimbbl Android SDK with your android app and start accepting payments from your customers.
- You can refer to the Nimbbl sample app to learn how the SDK has been integrated.
- Nimbbl Android Sample App
Compatibilities and Dependencies
- The minsdk for your app should target Android version 22+
Install the Nimbbl Android SDK
To add the SDK to your app, add following change in app/build.gradle file:
dependencies {
implementation 'tech.nimbbl.sdk:nimbbl-checkout-sdk:3.0.4'
}
Changes in project build.gradle
repositories {
maven { url "https://gitlab.com/api/v4/projects/25847308/packages/maven" }
}
Initialise the Nimbbl Android SDK
You can choose to do this on app launch or any other point before you will be invoking the checkout
- Kotlin
- Java
NimbblCheckoutSDK.instance?.init(this)
NimbblCheckoutSDK.getInstance().init(this)
Launching the Checkout
Understanding Checkout Options
Nimbbl lets you enforce a payment mode on the Checkout. This can be done by setting up the setPaymentModeCode
property. There are other related properties in to each different payment mode, you can read it in the table below. If you don't set setPaymentModeCode
the consumer is shown the full Checkout with all available payment modes.
Option Properties | Type | Mandatory? | Description |
---|---|---|---|
setOrderToken | string | true | This would have been generated from your server during order creation using V3 create-order API. |
setPaymentModeCode | string | false | In case of specific payment mode, this property is mandatory. Possible values net_banking , card , upi , wallet . If you don't pass payment_mode_code the consumer is shown the full Checkout with all available payment modes. |
setBankCode | string | false | Only to be passed in case of net_banking . Example: hdfc . To get the full list of banks supported for you, please use this API. If it isn't passed, Checkout will open with a page for the user to choose their bank from enabled banks |
setWalletCode | string | false | Only to be passed in case of wallet . Example: jio_money . To get the full list of wallets supported for you, please use this API. If it isn't passed, Checkout will open with a page for the user to choose their wallet from enabled wallets |
setPaymentFlow | string | false | Only to be passed in case of upi to determine the flow. Possible values collect , intent . If it isn't passed, Checkout will open with page for the user to enter their UPI ID or pay using a QR or choose a UPI app |
Setting the Checkout Options
- Kotlin
- Java
val options = builder.setOrderToken(<orderToken | mandatory>)
// only if you want to enforce a specific payment method
.setPaymentModeCode(<string | optional>)
.setBankCode(<string | optional>)
.setPaymentFlow(<string | optional>)
.setWalletCode(<string | optional>)
.build()
NimblCheckoutOptions options = builder.setOrderToken(<orderToken | mandatory>)
// only if you want to enforce a specific payment method
.setPaymentModeCode(<string | optional>)
.setBankCode(<string | optional>)
.setPaymentFlow(<string | optional>)
.setWalletCode(<string | optional>)
.build();
Invoking the Checkout
- Kotlin
- Java
val builder = NimbblCheckoutOptions.Builder()
NimbblCheckoutSDK.instance?.checkout(options)
NimblCheckoutOptions.Builder builder = new NimblCheckoutOptions.Builder();
if (NimbblCheckoutSDK.getInstance() != null) {
NimbblCheckoutSDK.getInstance().checkout(options);
}
- You will need to get your app package name whitelisted by our team.
- Please drop an email to help@nimbbl.biz to get this whitelisting done.
Capture Transaction Response
You have to implement NimbblCheckoutPaymentListener to receive callbacks for the payment result.
- Kotlin
- Java
class CatalogPage : AppCompatActivity(), NimbblCheckoutPaymentListener {
override fun onPaymentFailed(data: String) {
}
override fun onPaymentSuccess(data: MutableMap<String, Any>?) {
}
}
class CatalogPage extends AppCompatActivity implements NimbblCheckoutPaymentListener {
@override
void onPaymentFailed(String data) {
}
@override
void onPaymentSuccess(Map<String, Object> data) {
}
}
A successful payment returns response to the Checkout Form, for details related to processing response check Completing the Integration.
- Share the response parameters received to your server
- This will need to be validated on your server before you decide to provide goods or services
- More details available on processing the response in Completing the Integration