End Point:
POST https://checkout.ghostpass.io/api/payments/{payment}/refund
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://checkout.ghostpass.io/api/payments/{payment}/refund',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'reason=Test%20refund',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer {bearer_token}',
'X-MERCHANT-SECRET: {secret_key}'
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
Response:
{
"status": "reversal_fully_refunded",
"amount": "1.00",
"currency": "USD",
"paid_amount": "1.00",
"processing_amount": "1.00",
"refunded_amount": "1.00",
"processing_currency": "USD",
"payment_system_fee": "0.27",
"processing_fee": "1.01",
"rolling_reserve": "0.05",
"merchant_net_revenue": "-1.33",
"merchant_transaction_id": "1592897603",
"subscription_type": "first_non_trial",
"created_at": "2020-06-23 02:34:05",
"id": "DAP-200623-PWJ5",
"created_at_tz": "2020-06-23 14:34:05"
}
End Point:
POST https://checkout.ghostpass.io/api/payments/{payment}/refund
curl -X POST \
https://checkout.ghostpass.io/api/payments/{payment}/refund \
-H 'Authorization: Bearer {bearer_token}' \
-H 'X-MERCHANT-SECRET: {secret_key}' \
-d 'reason=Test%20refund'
Response:
{
"status": "reversal_fully_refunded",
"amount": "1.00",
"currency": "USD",
"paid_amount": "1.00",
"processing_amount": "1.00",
"refunded_amount": "1.00",
"processing_currency": "USD",
"payment_system_fee": "0.27",
"processing_fee": "1.01",
"rolling_reserve": "0.05",
"merchant_net_revenue": "-1.33",
"merchant_transaction_id": "1592897603",
"subscription_type": "first_non_trial",
"created_at": "2020-06-23 02:34:05",
"id": "DAP-200623-PWJ5",
"created_at_tz": "2020-06-23 14:34:05"
}