search

EMI Subvention through JS Checkout

EMI subvention on JS checkout can be integrated with minimal effort at the merchant side. Merchant will have to invoke the JS module through access token and pass the relevant object in the Initiate transaction API. Majority of the experience w.r.t payment page and EMI subvention eligibility would be managed at Paytm end. 

Overview of payment processing via EMI subvention payment

  1. After the user adds the items in the cart, the merchant calls the Create token API. 
  2. Paytm receives the request and returns an access token in the response to the merchant.
  3. The merchant uses the access token along with other parameters to initialise the JS module. The other parameters required are mentioned below:
    1. transactionAmount
    2. tokenType
    3. Token
    4. emiSubventionObject
  4. Merchant invokes the JS module.
  5. JS module renders the cashier page on the browser, preset with the configurations received.
  6. User selects the payment instrument and fills the required payment details like card number, expiry date etc.
  7. User clicks on the Pay button and an event is called from JS Checkout to the client in the initiateTransaction handler. Relevant parameters e.g. subvention Token, payable amount, txnamount, promo object will be passed in the handler.
  8. Merchant passes the orderId and different parameters received from the handler and calls the Initiate transaction API from its backend.
  9. Paytm receives the request and returns a response containing the transaction token to the merchant backend server. Merchant backend server returns the  txn token to the UI

Pre-requisites

Before starting the integration make sure, you follow the following steps:

  1. Create an account on Paytm as a merchant. Click on how to create an account.
  2. Get the merchant id and merchant key for the integration environment after creating the account.
  3. Go through the checksum logic to understand how to generate and validate the checksum.
  4. Get the EMI subvention plans configured for your products. You can collect the data as explained in the section Configuration of EMI subvention plans and send the email with details to your account manager or contact us.

Integration Steps

  1. Setup the preferences and customization for the JS checkout if not done already. Please refer to the detailed steps mentioned in the Setting up preferences and theme customization section of JS checkout.

  2. Define the strategy for EMI subvention. Refer to the section Configuration of EMI subvention plans. Based on the finalised strategy please get the data created at Paytm Subvention engine.

  3. Once the data is configured at Paytm for EMI subvention plans and merchant level preferences and customizations are done, you are ready to hit the API and invoke js checkout.

  4. Once the user adds the item in the cart and in case you want to give the EMI subvention as a payment option to the user, you call Create token API to get the access token.

  5. Using the received access token and other parameters, you initialise the JS module. The other parameters are 

    1. transactionAmount
    2. tokenType
    3. Token (Access token value)
    4. emiSubventionObject
  6. The parameters in the emiSubventionObject to be passed shall be based on the EMI Subvention strategy which are explained below

    In case you want to integrate an amount based EMI subvention, you need to pass the emiSubventionObject as explained in the example below. In this example, the total cart amount is of Rs. 7000 out of which you want to offer EMI Subvention on Rs. 5000.

    "emiSubvention":{
          "strategy": "AMOUNT_BASED",
          "amount":"5000" // subvention amount
    },
    "data":{
          "orderId":"test1234",
          "amount":"7000", // total cart price
          "Token":"<access token value>",
          "tokenType":"ACCESS_TOKEN",
          "userDetail":{
             "mobileNumber":"",
             "name":""
          }
    }
    
  7. Merchant invokes the JS module and it renders the cashier page on the browser, preset with the configurations received.

  8. User selects the EMI as a payment instrument and fills the details of the Credit card. User  selects one of the different subvention plans available and proceeds for the payment.

  9. User clicks on the Pay button and an event is called from JS Checkout to the client in the initiateTransaction handler. Relevant parameters e.g. subvention Token, payable amount, txnamount, promo object will be passed in the handler.

  10. Merchant passes the subventionToken and different parameters received from the handler and calls the Initiate transaction API from its backend.

  11. Paytm receives the request and returns a response containing the transaction token to the merchant backend server. Merchant backend server returns the  txn token to the UI. 

    initiateTransaction: function(emiSubventionToken, payableAmount, txnAmount, offer) {
       console.log("initiateTransaction called", emiSubventionToken, payableAmount, txnAmount, offer)
          return new Promise(function (res) {
                 setTimeout( function (){ res({token: '2694325dc78f48d09aac6c2322aa73ab1582006374996', orderId: 'checkout5345'})}, 2000);
               });
    },
  12. User is redirected to the bank page for authorization. Once the transaction is authorized, Paytm receives the response from the bank and returns a status to your website via your callback URL. Please refer to the sample callback response here.