假设用户想要取消他们的订阅,那么我会发出这样的命令:
stripe_subscription.delete(at_period_end: true)
后来,在期限结束之前,用户改变了主意。有没有一种方法可以撤销已安排的取消呢?
如果没有,那么最好的实现方式是什么?我的猜测是这样的:
new_subscription = stripe_customer.subscriptions.create(plan: stripe_subscription.plan.id, trial_end: stripe_subscription.current_period_end)
stripe_subscription.delete() # if permitted
self.stripe_subscription = new_subscription
save!
有什么更好的事情可以做吗?
delete
方法来取消它,而是应该对Stripe订阅进行更新,并将cancel_at_period_end
参数设置为true
。 - HartleySan