1. Documentation

Bohudur Integration Guide


This guide provides step-by-step instructions to integrate the Bohudur payment gateway into your Android application.

First add Bohudur library on your Android Studio project.

implementation 'com.github.BohudurOne:Android-Studio-Library:1.0'

Step 1: Initialize Bohudur

First, initialize the Bohudur object with your API key.

String API_KEY = "YOUR_API_KEY";
Bohudur bohudur = new Bohudur(this, API_KEY);

Step 2: Create A Request

This code is enough for making a successful payment request.

bohudur.setFullName("Jane Doe");
bohudur.setEmail("[email protected]");
bohudur.setAmount(10);
bohudur.setReturnType(Bohudur.Type.GET());
bohudur.request(new PaymentResponse(){ @Override public void onPaymentSuccess(SuccessResponse response) { // handle success } @Override public void onPaymentCancelled(FailureResponse response) { // handle cancellation } });

Verify Payment

bohudur.verify("YOUR_PAYMENT_KEY", new VerifyResponse() {
  @Override
  public void onPaymentVerified(SuccessResponse arg0) {
        // handle verified payment
  }

  @Override
  public void onPaymentError(FailureResponse arg0) {
        // handle error
  }
});

Key Features:

If you need to use webhook or metadata you can use in this way.

bohudur.addMetadata("data1", "value1");
bohudur.addMetadata("data2", "value2");
bohudur.setWebhookCancelUrl("https://example.com/cancel.php");
bohudur.setWebhookSuccessUrl("https://example.com/success.php");

Java Classes:

These are the classes of Bohudur library. These are automatically imported by Android Studio.

import bohudur.payment.sdk.Bohudur;
import bohudur.payment.sdk.FailureResponse;
import bohudur.payment.sdk.PaymentResponse;
import bohudur.payment.sdk.SuccessResponse;
import bohudur.payment.sdk.VerifyResponse;

These data you will get after user payment done.

response.getAmount()
response.getCancelledUrl()
response.getConvertedAmount()
response.getCurrency()
response.getCurrencyValue()
response.getEmail()
response.getMFS()
response.getMetadata()
response.getMethod()
response.getName()
response.getNumber()
response.getRedirectUrl()
response.getStatus()
response.getTime()
response.getTotalAmount()
response.getTrx()

These data you will get if user cancelled payment.

response.getErrorCode()
response.getMessage()
response.getStatus()