![](/img/trans.png)
[英]PHP Form based on button clicked, submit value of Subscribe or Unsubscribe
[英]after unsubscribe can't able to subscribe again in stripe gateway in php
這是我的退訂功能
public function cancelSubscription($ssid)
{
try {
\Stripe\Stripe::setApiKey(SSK);
$subscription = \Stripe\Subscription::retrieve($ssid);
if ($subscription['status'] == 'canceled') {
return $subscription['status'];
}
$subscription->cancel();
return $subscription;
} catch (Exception $e) {
echo '<pre>';
print_r($e->getMessage());
echo '</pre>';
die('error!- customer');
}
}
它工作正常,但是當我嘗試升級我的計划或嘗試再次訂閱時,出現錯誤。
沒有這樣的訂閱:sub_EMYom4xxxxx
取消訂閱后,訂閱 ID 似乎不匹配。 請提出任何解決方案。 提前致謝。
明確取消訂閱后,您無法重新激活訂閱。 如果您將其標記為取消,您將在取消日期到來之前有一個“取消取消”窗口。
在這種情況下,您將立即取消訂閱,因此您需要完全創建一個新訂閱。 請參閱https://stripe.com/docs/billing/subscriptions/canceling-pausing#pausing-a-subscription
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.