Trigger Exchange payment
// The sample request payload that needs to encrypt
{
"clientId": "cc238708-02a0-48af-a70d-9d05cfe3a66d",
"assets": "BTC",
"cart": [
{
"id": "1",
"name": "Starbucks Gift Card",
"price": 2,
"quantity": 1,
"localAmount": 2,
"localCurrency": "USD"
},
{
"id": "3",
"name": "Best Buy Gift Card",
"price": 2,
"quantity": 1,
"localAmount": 2,
"localCurrency": "USD"
},
{
"id": "5",
"name": "Amazon Gift Card",
"price": 1,
"quantity": 1,
"localAmount": 1,
"localCurrency": "USD"
}
],
"shippingAddress": {
"city": "jam",
"email": "[email protected]",
"state": "jh",
"country": "india",
"phoneNo": "7004703084",
"zipcode": "831008",
"address1": "some address",
"address2": "",
"landmark": "",
"lastname": "singh",
"firstname": "manish"
},
"offerId": "1656674750778",
"nativeAmount": "5",
"savepassword": false,
"code2fa": "",
"merchantStoreCurrency": "USD"
}
// clientId is the RKFL merchant id.
// The key "data" should generate from the below way.
export const data = async (toEncrypt, publicKey) => {
const buffer = Buffer.from(toEncrypt);
const encrypted = crypto.publicEncrypt(publicKey, buffer);
return encrypted.toString('base64');
};Headers
Name
Type
Description
Request Body
Name
Type
Description
Last updated
Was this helpful?