-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with canceling at end of subscription #138
Comments
Unfortunately, it's not as straightforward as you might think as i can't just rename an attribute and that's it :\ This will most likely need to wait until a new major version and i'm aware of this "field" and many others that have been renamed on Stripe end. For the time being, you can use the |
That is unfortunate. I'm very surprised the renaming of a parameter can cause such a complicated issue. It's not clear in your documentation how I could use the update to achieve the same result. |
Yes, it's mostly due to how Stripe handles versioning.
You just need to pass the <?php
$customerId = 'cus_4EBumIjyaKooft';
$subscriptionId = 'sub_4ETjGeEPC5ai9J';
$subscription = $stripe->subscriptions()->update($customerId, $subscriptionId, [
'cancel_at_period_end' => true,
]); It's not difficult. Let me know how it goes :) |
Worked beautifully! My confusion came from the fact that I thought I would still need to call |
No problem :) Let me know if you find any other issues or have other questions ;) |
Code:
$subscription = $stripe->subscriptions()->cancel('cus_4EBumIjyaKooft', 'sub_4ETjGeEPC5ai9J', true);
Issue:
When $atPeriodEnd is present the following error appears:
Potential fix:
As mentioned here:
laravel/cashier-stripe#551
You can use cancel_at_period_end on the subscription update endpoints instead.
The text was updated successfully, but these errors were encountered: