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/purchases/invoice-lookup
Headers
Request Body
{"ok": true,"result": [ {"id": <Transaction_id>, "status": <Status>, "meta": {"offerId": <Offer_id> }, "amount": "1.598457239956444619", "receivedAmount": "0", "currency": "ETH" } ]}// Values received in response are1. id – RKFL identifier2. status – code will be interpreted as follows 1 = RocketFuel received the amount successfully 0 = Amount is Pending to be received by RocketFuel -1 = RocketFuel didn’t receive the amount, and the transaction is failed 101 = RocketFuel received a partial payment of the total amount 3. meta 3.1 offerId – Unique identifier of the merchant 4. amount - the total price of the complete order. 5. receivedAmount – Amount received by RocketFuel for an order. 6. currency – Unit of currency used by Shopper to make the payment for an order