> For the complete documentation index, see [llms.txt](https://docs.rocketfuel.inc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rocketfuel.inc/developer-guides/api-reference/payins/rocketfuel-ui-integration/payment-processing/rkfl-payment-widget.md).

# RKFL Payment Widget

**RKFL JS** [**CDN**](https://d3rpjm0wf8u2co.cloudfront.net/static/rkfl.js) **and Implementation**

* Add the script from [**CDN**](https://d3rpjm0wf8u2co.cloudfront.net/static/rkfl.js) 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"
       }
```
