Integrate the Nimbbl Android SDK with your android app and start accepting payments from your customers.
SAMPLE EXPERIENCE
- You can refer to the Nimbbl sample app to learn how the SDK has been integrated.
- Nimbbl Android Sample App (Kotlin)
- Nimbbl Android Sample App (java)
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:2.0.3'
}
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.getInstance().init(this)
NimbblCheckoutSDK.getInstance().init(this)
Invoke the Checkout
IMPORTANT
In order to invoke the checkout, your server should provide you the following information:
order_id
- this would have been generated from your server.token
- this would be the token with which you would have generated the order.
- Kotlin
- Java
val builder = NimbblCheckoutOptions.Builder()
val options = builder.setPackageName(appPackageName).setOrderId(orderId).setToken(token)
NimbblCheckoutSDK.getInstance().checkout(options)
NimblCheckoutOptions.Builder builder = new NimblCheckoutOptions.Builder();
NimblCheckoutOptions options = builder.setPackageName(appPackageName).setOrderId(orderId).setToken(token);
NimbblCheckoutSDK.getInstance().checkout(options)
INFO
- You will need to provide your app package name to the SDK.
- You will also 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 the following fields to the Checkout Form.
{
"nimbbl_order_id": "order_RoQ7Zl92G2qqB3rg",
"nimbbl_transaction_id": "order_RoQ7Zl92G2qqB3rg-20210217071936",
"nimbbl_signature": "hmac_sha256"
}
IMPORTANT
- 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