Skip to main content

SDK - Cancel subscription

Request parameters

Parameter NameTypeRequiredSign(Y OR N)Parameter Description
pay_memberidStringYYThe platform assigns merchant ID
pay_orderidStringYYMerchant order number
pay_md5signStringYNPlease see MD5 signature field method

Return parameters

Parameter NameTypeParameter Description
statusstringSucceeded: success
Fail: error
msgStringOrder placed successfully or order failed
subscribe_timeStringSubscription start time
last_payment_timeStringSubscription last payment time
payment_transaction_idStringTransaction ID
payment_period_countStringTotal payments
signStringPlease 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);