Welcome to the Zaakpay developer hub!

You'll find comprehensive guides and documentation to help you start integrating Zaakpay Payment gateway as quickly as possible, as well as support if you get stuck. Let's jump right in!

Guides would be the best place to start.
Checkout "Discussions" forum for frequently asked questions or simply use the search option if you're unsure of where to look.
Api Endpoints provides the specification on our APIs with an option to explore the API

Guides    Discussions

Android SDK Integration

Install SDK

  1. Add the authToken for the repository access to your project’s gradle.properties file :
authToken=jp_nvgg9iebmirqko7uo25n0ssc9b
  1. Add the Jitpack repository url along with the authToken to your project level build.gradle file :
allprojects{
  repositories{
    maven{
      url"https://jitpack.io"
      credentials{
        usernameauthToken
      }
    }
  }
}
  1. Add the SDK dependency to your app level build.gradle file :
implementation 'com.github.Mobikwik:Android-SDK:3.13'

Sync your gradle files after adding the dependencies and you should now be able to use the SDK in your application.

Initiate Payment

For initiating a payment through the SDK in your application, please undertake the following steps:

  1. Create an instance of TransactionData by using TransactionDataBuilder :
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
/***** 
 application logic 
 ****/
        TransactionData transactionDataInstance = getTransactionDataInstance();
    }

    private TransactionData getTransactionDataInstance() {
        TransactionDataBuilder transactionDataBuilder = TransactionDataBuilder()
                .withAmount(amount) // BigInteger
                .withChecksum(checksum) // String
                .withChecksumPO(checksumPO) // String
                .withCurrency("INR") // String
                .withOrderId(orderId) // String
                .withUserEmail(userEmail) // String
                .withReturnUrl(returnUrl) // Url on which the txn response will be posted (String)
                .withMerchantIconUrl(iconUrl) // Merchant Icon to be displayed in the SDK (String)
                .withMerchantName(merchantName) // String
                .withMerchantId(merchantIdentifier) // String
                .withUserPhoneNumber() //String
                .withEnvironment(Enums.Environment.STAGING); // Enum to configure the server environment

The checksum and checksumPO values used here must be calculated and fetched from the merchant’s server. Details on how to create the checksum and checksumPO on the merchant server can be found here :

The return url is the url on which the response of the transaction will be posted. Details on the construction of the return url response can be found here :

The above example shows the mandatory params needed for the SDK transaction. You can check the full list of params supported by the TransactionData object here : https://github.com/Mobikwik/Integration-Documents/blob/master/PG-Integration-Document/TransactD-V8%20Flow.pdf

  1. The TransactionData object created above should then be passed in the startPayment of the PaymentCheckout class :
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
/***** 
 application logic 
 *****/
        TransactionData transactionDataInstance = getTransactionDataInstance();
        PaymentCheckout paymentCheckout = new PaymentCheckout(this);
        paymentCheckout.startPayment(transactionDataInstance);
    }

This will trigger the SDK flow inside your application and present a list of payment options to the user.

Register Callback Listener

To be able to receive the final transaction response from the SDK, you must implement the PaymentCheckout.ZaakPayPaymentListener inside your activity/fragment from which you initiated the payment :

public class PaymentActivity extends AppCompatActivity implements PaymentCheckout.ZaakPayPaymentListener {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /* application checkout flow logic */
        TransactionData transactionDataInstance = getTransactionDataInstance();
        PaymentCheckout paymentCheckout = new PaymentCheckout(this);
        paymentCheckout.startPayment(transactionDataInstance);
    }

    @Override
    public void onPaymentSuccess(TransactionResponse response) {
// extract the checksum from the response using response.getChecksum() and verify it on your server before further processing the success response
    }

    @Override
    public void onPaymentFailure(String responseCode, String responseDescription) {
        //handle payment failure 
    }
}

To verify the authenticity of the response received in case of payment success it is recommended to extract the checksum from the response and verify it on your server before any further processing. This helps fight against MITM attacks or network fiddling. The specifics on verifying the response checksum on the merchant server is available in next section.

Following sample response should be returned in response of return url. You will get the values of these parameters in the request parameters of return url hit.

Sample Response:

{
  "orderId": "1601294679223",
  "responseCode": "100",
  "responseDescription": "The transaction was completed successfully. ",
  "checksum": "1b6f38fca8ceb319218d806f79f7e163de595eb8b3753c976441733028f186b8",
  "amount": "100",
  "doRedirect": "false",
  "paymentMode": "UPI",
  "cardId": "NA",
  "cardScheme": "NA",
  "cardToken": "NA",
  "bank": "ICICIUPI",
  "bankid": "ICIUPI",
  "paymentMethod": "N1064",
  "cardhashid": "NA",
  "product1Description": "NA",
  "product2Description": "NA",
  "product3Description": "NA",
  "product4Description": "NA",
  "pgTransId": "ZP5b05e7c3666b8",
  "pgTransTime": "09/28/2020 17:35:54"
}

👍

Note

In case you face Manifest merger failed : Attribute [email protected] error while building your application with the SDK, please add tools:replace="android:theme" in the application tag inside your application’s AndroidManifest.xml file.

Checksum Validation For JSON Response

If you want to validate the checksum on the above JSON response string. Please follow below required setps:

  1. Use SHA -256 algorithm to generate the correct checksum for JSON string
  2. we need to calculate on all the parameters of the JSON string
  3. Use merchant's secret key for the same
Sample Input Parameters: 

amount=100&bank=ICICIUPI&bankid=ICIUPI&cardId=NA&cardScheme=NA&cardToken=NA&cardhashid=NA&doRedirect=false&orderId=1601294679223&paymentMethod=N1064&paymentMode=UPI&responseCode=100&responseDescription=The transaction was completed successfully. &product1Description=NA&product2Description=NA&product3Description=NA&product4Description=NA&pgTransId=ZP5b05e7c3666b8&pgTransTime=09/28/2020 17:35:54&is 1b6f38fca8ceb319218d806f79f7e163de595eb8b3753c976441733028f186b8

Secret Key: Please user merchant's secret Key

Changelog

V 3.13

Added UPI collect payment option

Updated 17 days ago


Android SDK Integration


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.