Wallet Payment
Create a payment transaction for paying from a prepaid Wallet. Once you have the response, depending on the “method” attribute, you will have to take the next step. If you receive GET, then take the value in the “URL” attribute and redirect the user to this location. If you receive POST, then “params” attribute will hold a map containing key-value pairs.
For Web, you can create a form with these parameters as hidden variables and auto submit the form. Example code in Javascript: Serialize Parameters.
For Android, serialize this data such that it can be loaded to WebView directly via postData. Example code in Java: Serialize Parameters.
HANDLING POST
When you get POST as the authentication method in the response, then the customer must be redirected using a form. Example HTML code is given to you. Depending on your client language, choose the appropriate way to create the form.
HANDLING GET
When you get GET as the authentication method in the response, you may load the URL directly into the customer’s browser. You can easily achieve this by sending HTTP 302 from your server. However, if the API call was made from the browser, then you can utilize the code snippet provided.
Consists of two parts.
Username: API Key obtained from Juspay dashboard
Password: Empty string
Example:-
Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
Merchant ID provided by Juspay
Example:-
merchant-id
Pass the date in YYYY-MM-DD format
Example:-
2023-01-01
application/x-www-form-urlencoded
Order object pertaining to the order you are creating.
ID of the merchant_account that you hold with us.
Must be WALLET
The actual payment method that was selected by the user. For WALLET transactions, the values will be shared by Juspay team.
This is a boolean variable and accepts true/false. We recommend that you set this to true. If set to true, then the user is redirected to the return\_url configured for the order. If set to false, then the user will be stopped at the response page from the gateway. Your client should be able to read the page/title to infer that the user has completed the transaction.
If it is set to json, then the response will be HTTP 200 with a JSON formatted text. Otherwise, the response is HTTP 302 with the Location attribute having the destination URL.
order_id
txn_id
Example : PENDING_VBV
Only when you have POST as the authentication method
error
Order timed out
invalid_request

