Lookup using Public Key
The RKFL provides a separate API to get the latest transaction status. This API accepts "merchant_id" and "transaction_id" as a request payload encrypted by the public RSA key and returns the response in JSON format.
// Object to encrypt
const toEncrypt = {
merchantId: <merchant_id>,
transactionId: <transaction_id>
};
// Generate an encrypted request payload
export const data = async (toEncrypt, publicKey) => {
const buffer = Buffer.from(toEncrypt);
const encrypted = crypto.publicEncrypt(publicKey, buffer);
return encrypted.toString('base64');
};
// merchantId – Unique identifier of the Merchant in the Rocketfuel, will get it from the portal.
// transactionId – Unique identifier of the Transaction initiated by Shopper using RocketFuel, will get it from the Webhook/callback.
POST
/purchase/invoiceLookup
Headers
Authorization*
String
"Bearer" + merchant access token
Request Body
data*
String
Encrypted request payload
{
"ok": true,
"result": [
{
"id": <Transaction_id>,
"status": <Status>,
"meta": {
"offerId": <Offer_id>
},
"amount": "1.598457239956444619",
"receivedAmount": "0",
"currency": "ETH"
}
]
}
The webhook payload contains the following fields:
id – RocketFuel transaction identifier.
status – 10/0/1 etc. For more information on transaction statuses, click here to access the full guide.
meta
offerId – Unique identifier assigned to the merchant.
amount – The total price of the complete order.
receivedAmount – The amount actually received by RocketFuel for the order.
currency – The unit of currency used by the shopper to make the payment.
Last updated
Was this helpful?