2

I am using laravel cashier to create a subscription based plan purchasing system with Braintree as a payment gateway.

My subscriptions are successfully created, my issue is when canceling.

After I fire:

$user->subscription('pro')->cancel();

The user is successfully transitioned into the grace period where a user has days remaining before his plan actually expires, but on Braintree the subscription is still active and not canceled.

However when I fire:

$user->subscription('pro')->cancelNow();

The subscription on Braintree is now marked as Canceled.

My question is how will Braintree know not to charge this user if cashier does not mark the subscription in Braintree as canceled.

Maybe I'm missing something here... Do I need to handle this myself when canceling subscriptions using the Briantree PHP SDK. If anyone has had this question before and found a solution, your opinions would be greatly appreciated.

4

1 回答 1

0

好的,实际上设法解决了这个问题。

发射:

$user->subscription('pro')->cancel();

cancel()方法实际所做的是将您在 Braintree 上的订阅设置为在​​ 1 个计费周期后结束,即在下一个计费日期取消 Braintree 订阅。要验证这一点,您需要做的是。从 Braintree 仪表板中找到订阅并“编辑”订阅,您会发现计费周期将设置为在 1 个周期后结束。

调用方法:

$user->subscription('pro')->resume();

在宽限期内的用户也将设置订阅的结束时间太从不

于 2016-11-29T21:10:52.303 回答