Handling Partial Payments
There is a possibility of shoppers making a partial payment when paying using a crypto wallet. We do update the shoppers to complete the partial payment. However, some merchants are okay with whatever the shopper has paid and want to issue goods/services as per the payment amount. In this case, merchants may close the partial payment so that they can give the goods/service for the amount paid by the shopper, and we can settle the partial payments to the merchants. This API will help the merchants to mark a partial payment as closed.
POST
/closePartialTx
Headers
"Content-Type"*
String
"application/json"
Request Body
clientId*
String
Merchant Client Id
encryptedReq*
String
Encrypted string of offerId by client secret
{
"ok": true,
"result": {
"success": true
}
}
// Example
offerId: "d21c44a5-9ff7-44d6-9dbc-158753184d5d"
clientSecret: "8e6e7524-202d-424d-b2a2-431ff1117e27"
Then encrypt this offerId (JSON format) with clientSecret:
i.e, Encrypt JSON {"offerId":"d21c44a5-9ff7-44d6-9dbc-158753184d5d"} with "8e6e7524-202d-424d-b2a2-431ff1117e27"
And its output will be encryptedReq param
For above offerId and clientSecret, encryptedReq is "U2FsdGVkX1+T1BocXOZHJA2paoYtiFC1GIl99jjtPQEWuxF2ikm8VT8eaenS5TDc67idkKfwFqBBd9dli/Ssdd28aXp6SKaBEtkkytTAtiA="
Below is the sample postman Request
Copy the following to the Pre-script
var CryptoJS = require('crypto-js');
var data = CryptoJS.AES.encrypt(JSON.stringify({
offerId: '<<TRANSACTION_ORDER_ID>>'
}), '<<MERCHANT_CLIENT_SECRET>>').toString();
pm.variables.set("encryptedPartialPayload", data);
Sample Curl Request
curl --location 'https://app.rocketfuelblockchain.com/api/closePartialTx' \
--header 'Content-Type: application/json' \
--data '{
"clientId":"<<MERCHANT_CLIENT_ID>>",
"encryptedReq":"{{encryptedPartialPayload}}",
"forceUpdate": false
}'
forceUpdate is an optional parameter and its default value is true. If passed will value false, it will not close partial transaction if there is a refund request on the transaction
Last updated
Was this helpful?