Handling the payment response
Step 4: Update backend to handle changes in Order Status API and Webhooks
Case 1 : Whole payment [User completes the transaction using only in-house wallet]
You will receive a single transaction in the order status response.
Proceed to debit the amount from the customer's wallet using the transaction details:
Payment Method: Your custom wallet’s name
Payment Method Type:
MERCHANT_CONTAINER
Case 2: Split payment [User completes the transaction using in-house wallet + another payment method]
In split payments, two transaction blocks will be included in the order status responses (via Order Status API and Webhooks).
The total order amount will equal the sum of both transaction amounts:
First Transaction: Represents the amount paid by the customer online.
Status:
CHARGED
Second Transaction: Represents the amount to be debited from the wallet.
Status:
TO_BE_CHARGED
Debit the wallet using the details from the second transaction only when the first transaction status is
CHARGED:Payment Method: Your wallet’s name
Payment Method Type:
MERCHANT_CONTAINER
|
Primary payment method status[UPI, CARD, WALLET, NB, COD]
|
Secondary payment method status [In-House Wallet]]
|
Overall Order Status
|
|---|---|---|
TERMINAL SUCCESS STATE (CHARGED)
| MERCHANT CONTAINER (TO_BE_CHARGED)
| PARTIALLY CHARGED
|
For Cash On Delivery (COD_INITIATED)
| MERCHANT CONTAINER (TO_BE_CHARGED)
| TO_BE_CHARGED
|
TERMINAL FAILURE STATE (AUTHENTICATION_FAILED, AUTHORIZATION_FAILED, JUSPAY_DECLINED, NOT_FOUND)
| MERCHANT CONTAINER (TO_BE_CHARGED)
| FAILURE
|
PENDING STATE (NEW, STARTED, PENDING_VBV, VBV_SUCCESSFUL, AUTHORIZING)
| MERCHANT CONTAINER (TO_BE_CHARGED)
| PENDING
|
order amount = merchant container amount
| MERCHANT CONTAINER (TO_BE_CHARGED)
| TO_BE_CHARGED
|
Merchant handling:
SUCCESS - Debit merchant wallet amount.
PENDING - Wait for a terminal status.
FAILURE - No action on merchant wallet.
For transactions done through any other payment method you will get the transaction status as ‘CHARGED’
All other cases, where debit is pending or failed in other Instrument, the order status will be PENDING_VBV or AUTHENTICATION_FAILED / AUTHORIZATION_FAILED. Merchant to handle transactions similar to a normal transaction.
In case the amount from in-house Wallet could not be deducted by the merchant, he will cancel the order in his database and raise a refund request for the non in-house wallet transaction.
To refund transactions you should use Txn ID based refund

