我正在尝试取消通过Stripe api进行的订阅。
我正在遵循开发人员文档中的示例代码段
https://stripe.com/docs/billing/subscriptions/canceling-pausing
这就是我所做的
<?php
require_once('str/init.php');
// Set your secret key: remember to change this to your live secret key in production
// i have used my demo keys here
\Stripe\Stripe::setApiKey("stripe demo key was used");
// i have picked a test subscription i made on my dashboard on stripe and put its id here
$subscription = \Stripe\Subscription::retrieve('sub id');
$subscription->cancel();
?>
我的期望是,我运行该代码后,订阅状态将从“活动”更改为“已取消”,或者使用了watever术语。
请帮助