{deposit-refund}
{deposit-refund}
API function lets you refund the approved deposit transaction. The refund will be a new transaction sent to the same PSP as the one used for the original deposit transaction in order to send the same amount back to customer's account.
{danger.fa-exclamation} IMPORTANT #1: The original referenced transaction (see
reference_id
request parameter) has to be a deposit having theapproved
status.
{danger.fa-exclamation} IMPORTANT #2: Please make sure that the PSP supports the refund transaction type. If the refund amount is different from the original deposit amount, you will also need to confirm that the PSP supports the partial refunds.
Name | URL |
---|---|
Sandbox | https://pci-gw-test.praxispay.com/api/deposit-refund |
Live | https://gw.praxisgate.com/api/deposit-refund |
Variable | Type | Description |
---|---|---|
merchant_id | varchar(50) | Required. Merchant API client account identifier |
frontend | varchar(50) | Required. Cashier FrontEnd name, normally it is a common name of the website. Linked to a specific base currency. |
amount | int(20) | Required. Payment amount in cents. Please note: for certain currencies (JPY, CLP, KRW, VND, BHD, IQD, JOD, LYD, OMR, TND) the amount is sent as-in without being converted to cents, this is important if you multiply by 100 to send the amount in cents |
currency | varchar(10) | Required. Payment currency |
reference_id | varchar(50) | Required. Original transaction identifier from |
order_id | varchar(50) | Required. Transaction identifier in your system |
timestamp | int(11) | Required. Request time. URL will be active during 1 min after this time |
version | varchar(3) | Required. API version |
signature | varchar(96) | Required. Hash of the request parameters |
Variable | Type | Description |
---|---|---|
status | int | Required. - 0 if the request was successful - Negative integer if internal server/network error occurs - Positive integer if application/logical error occurs |
description | varchar(256) | Required. Accurate description of the result. Return the actual error for any exception as it helps to diagnose issues in production |
trace_id | int(11) | Required. Transaction identifier in |
transaction_id | varchar(50) | Optional. Transaction identifier in PSP |
transaction_status | varchar(16) | Required. - pending - processing initiated, final response expected from PSP - approved - processing was successful - declined retry - processing failed and will be reattempted - declined - processing failed - cancelled - processing cancelled by the merchant or client - pending async - customer action expected (3D Secure, etc.) - requested - merchant action expected (approval) |
payment_processor | varchar(25) | Required. Gateway doing the processing |
error_code | int(10) | Optional. Error code for rejected transactions |
error_details | varchar(256) | Optional. Error description for rejected transactions |
version | varchar(3) | Required. API version |
signature | varchar(96) | Required. sha384 HASH code of response (same algorithm as request signature) |
For example below: Merchant Secret = "MerchantSecretKey"
curl -X POST \
https://gw.praxisgate.com/api/deposit-refund \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"amount":1000,
"currency":"USD",
"frontend":"Integration TEST USD",
"merchant_id":"Test-Integration-Merchant",
"order_id":"test-1560610955",
"reference_id":752856,
"timestamp":1575622396,
"version":"1.1",
"signature":"c06faa09ccd2c9056b83a271946304ff6c8b582779898be809195491e17feb5e8c4aaa8ec509d39cc352596023c4417d"
}'
{
"description":"Ok",
"error_code":1,
"error_details":"[TEST] Transaction status: approved",
"payment_processor":"TestPP",
"status":0,
"trace_id":1000000681,
"transaction_id":"15607165967620",
"transaction_status":"approved",
"version":"1.1",
"signature":"e6441bedce5fd3f26e7834f7bfbff091c8781e35f119e65ec4aa6ed32f44652549bebbd846eac240bac5c62670ab277f"
}
{
"description":"Ok",
"error_code":1,
"error_details":"[TEST] Transaction status: declined",
"payment_processor":"TestPP",
"status":0,
"trace_id":1000000682,
"transaction_id":"15607165967622",
"transaction_status":"declined",
"version":"1.1",
"signature":"f7a05d4ead2f00d731116b005bb5d8186574611f2818bfc405ad9061d61bc8393b49cc8d7fdd11299cea95c75e9da2e3"
}
Please refer to How to Build Signature for details on signing the request.
You are currently viewing version 3.3 Latest version here