SDK - Cancel subscription
Request parameters
| Parameter Name | Type | Required | Sign(Y OR N) | Parameter Description |
|---|---|---|---|---|
| pay_memberid | String | Y | Y | The platform assigns merchant ID |
| pay_orderid | String | Y | Y | Merchant order number |
| pay_md5sign | String | Y | N | Please see MD5 signature field method |
Return parameters
| Parameter Name | Type | Parameter Description |
|---|---|---|
| status | string | Succeeded: success Fail: error |
| msg | String | Order placed successfully or order failed |
| subscribe_time | String | Subscription start time |
| last_payment_time | String | Subscription last payment time |
| payment_transaction_id | String | Transaction ID |
| payment_period_count | String | Total payments |
| sign | String | Please see the verification signature field format |
Return example
{
"msg":"Unsubscribe successfully",
"status":"success",
"subscribe_time": 1742886960,
"last_payment_time": 1742890611,
"payment_transaction_id":"346874883747",
"payment_period_count": null,
"sign": "69BDC5B6310793109FB2FD2AFC3EE619"
}
require_once 'vendor/autoload.php';
use Jpay\PaymentSDK\JpayPaymentSDK;
$sdk = new JpayPaymentSDK(
'your_merchant_id',
'your_secret_key',
'cashapp', // 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',
];
$result = $sdk->subscription_cancel($paymentData);