This SDK comes to create a new, modular and designed payment process.
Our purpose is to give you an easy solution for online payments without having to redirect or open iframes that may not provide the best user experience and limit your overall flexibility.

📘

NOTE:

This SDK is designed to work in conjunction with the server-side ‘createPaymentProcess’ method that should be configured to work with a pageCode that is set to SDK wallet mode.

The payment is valid for 10 minutes from the moment the createPaymentProcess call was made
That's why we recommend sending the call only after opening a payment form and not at an earlier stage of the process

Once ‘createPaymentProcess’ method return an authCode

You can use to open the wallet on Client side with ‘renderPaymentOptions’ method.
there is no 3ds.

Explanation of assimilation :

This SDK comes to create a new, modular and designed payment process.
Our purpose is to give you an easy solution for online payments without having to redirect or open iframes that may not provide the best user experience and limit your overall flexibility.

Note: This SDK is designed to work in conjunction with the server-side ‘createPaymentProcess’ method that should be configured to work with a pageCode that is set to SDK wallet mode.

  1. To use the SDK, you first need to load the SDK into your webpage in the following way:

  1. The scripts ‘onload’ event should point to a function that configures the wallet:

growPayment.init(config);

  1. Once the payment process is triggered by the user (e.g user clicks checkout button) you need to run the server side ‘createPaymentProcess’ method which will return an authCode which you can use to open the wallet with the SDK’s ‘renderPaymentOptions’ method.

An example of how to initiate the method:

// response - the response you received from 'createPaymentProcess'
if (response.status && growPayment) {
growPayment.renderPaymentOptions(response.authCode);
}

Once the wallet is opened, use the callback events to handle the rest of the flow.

Important: The wallet has a limited validity time which starts once you call the backend ‘createPaymentProcess’ api method. Therefore, it’s best to call the ‘createPaymentProcess’ backend api method right before you need to render the wallet to make sure users do not experience a wallet timeout during the payment process.

Note: Once renderPaymentOptions is called there will be a period in which the SDK must make an API call to Grow backend before the wallet is visually rendered. It is recommended to use the onWalletChange event to know when the wallet is about to open in order to handle your loader state.

  1. Once the payment process is triggered by the user (e.g user clicks checkout button) you need to run the server side ‘createPaymentProcess’ method which will return an authCode which you can use to open the wallet with the SDK’s ‘renderPaymentOptions’ method.

An example of how to initiate the method:

Once the wallet is opened, use the callback events to handle the rest of the flow.

Important: The wallet has a limited validity time which starts once you call the backend ‘createPaymentProcess’ api method. Therefore, it’s best to call the ‘createPaymentProcess’ backend api method right before you need to render the wallet to make sure users do not experience a wallet timeout during the payment process.

Note: Once renderPaymentOptions is called there will be a period in which the SDK must make an API call to Grow backend before the wallet is visually rendered. It is recommended to use the onWalletChange event to know when the wallet is about to open in order to handle your loader state.

Here is sample of response from the server:

{
  "status": 1,
  "err": "",
  "data": {
    "processId": 413133,
    "processToken": "92ab69240c00aa073eb818dc646e2c32",
    "authCode": "beb1064aa495042a69c9c5e2dc384180%NDEzMTM0"
  }
}

Here is sample of implementation un client side:

// response - the response you received from 'createPaymentProcess'
if (response.status && growPayment) {
   growPayment.renderPaymentOptions(response.authCode);
}

📘

Note

The wallet will be invalid after 4 min.