SDK - Refund
Request parametersβ
| Parameter Name | Type | Required(Y or N) | Sign(Y or N) | Parameter Description |
|---|---|---|---|---|
| pay_memberid | String | Y | Y | Merchant ID |
| transaction_id | String | Y | Y | Transaction order number |
| pay_orderid | String | Y | Y | Merchant order number |
| currency | String | Y | N | Order currency |
| pay_amount | String | Y | N | The total amount of orders |
| refund_amount | String | Y | N | Order refund amount(supports partial refund) |
| refund_reason | String | Y | N | Reason for order refund |
| pay_md5sign | String | Y | N | Please see MD5 signature field format |
Refund return parametersβ
| Parameter Name | Type | Required(Y or N) | Parameter Description |
|---|---|---|---|
| memberid | String | Y | Merchant ID |
| transaction_id | String | Y | Transaction order number |
| orderid | String | Y | Merchant order number |
| currency | String | Y | Order currency |
| amount | String | Y | The total amount of orders |
| refund_orderid | String | N | Refund Order ID (When the refund application is successful, a response will be returned.) |
| refund_amount | String | Y | Order refund amount (supports partial refund) |
| refund_reason | String | Y | Reason for order refund |
| returncode | String | Y | "00": success |
| refund_message | String | Y | `V0000:OK |
| sign | String | Y | sign |
require_once 'vendor/autoload.php';
use Jpay\PaymentSDK\JpayPaymentSDK;
$sdk = new JpayPaymentSDK(
'your_merchant_id',
'your_secret_key',
'virtual', // Write according to the payment method for which you want a refund. It doesn't matter if you make a mistake.
'true' // true or false, define true(dev environment)
);
//.The request parameters should be passed in according to the above requirements.
// There are mandatory and optional parameters to be passed in,
// depending on the document specifications.
$paymentData = [
'pay_orderid' => 'your pay orderid',
'transaction_id' => 'transaction id',
'pay_amount' => '100.00',
'currency' => 'USD',
'refund_amount' => '100.00',
'refund_reason' => 'refund',
];
$result = $sdk->refund($paymentData);