RKFL Payment Widget

RKFL JS CDN and Implementation

  • Add the script from CDN to the Merchant site.

  • Once we get the response with the UUID from the backend. We will initialize an object of the above-included script. We pass the following :

    • uuid

    • callback function

    • environment

    • Token

Copy

    const  uuidInfo = JSON.parse(result);
   
     if(uuidInfo.error !== undefined){
        alert("Order placement failed");
        return  false;
    }
    
    uuid = uuidInfo.uuid;
    
    rkfl = new RocketFuel({
        uuid,
        callback:  callBackFunc,
        environment:  "<%= developmentEnv %>"  // prod, preprod
    });
  • After initialising the object, start the payment by calling the initPayment method of the above script.

Copy

    function  startPayment(){
        rkfl.initPayment();
    }
  • Callback payload

Copy

 // In case of Bank/Exchange payment
          {
            paymentMode: 'Bank/Exchange',
            txn_id: 
            status: 
            meta:
          },

          Sample response:
          {
            paymentMode: 'Bank/Exchange',
            txn_id: "7df55d22-fa5e-4ca2-9af4-a39c95f18b3a"
            status: 0
            meta: {offerId: "1630402767550"}
          },



// In case of Wallet payment
      {
        paymentMode: 'Wallet',
        status: 
        recievedAmount:
        currency:
      },

       Sample response:
       {
           paymentMode: 'Wallet',
           status:"completed",
           recievedAmount:10.00,
           currency:"ETH"
       }

Last updated