-
Notifications
You must be signed in to change notification settings - Fork 680
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
Stripe Subscriptions Change #628
Comments
Hmmm. This indeed needs reviewing. I thought everything worked as expected when I upgraded the api version because the tests passed but it seems this is a specific new scenario we need to keep into account. We'll need to create a regression test for this to make sure this doesn't breaks again. |
Sounds good. How best should it be handled? Assuming the logic in cashier should persist, so likely want to check the subscription status and throw an exception if the payment fails?
… On 4 Apr 2019, at 19:16, Dries Vints ***@***.***> wrote:
Hmmm. This indeed needs reviewing. I thought everything worked as expected when I upgraded the api version because the tests passed but it seems this is a specific new scenario we need to keep into account. We'll need to create a regression test for this to make sure this doesn't breaks again.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This is only happening when no trial is present and the subscription is paid for immediately right? How would you know if the payment failed when creating the subscription? |
Yea correct. The subscription object would return with a status of |
In that case we could indeed throw an exception. Best that this is a cashier specific exception. |
Actually, come to think of it: how did it fail before? Did we get an exception from Stripe? Because the SDK seems to hint that the subscription was always created anyway. |
It use to be a Stripe\Error\Card exception with your card was declined error. |
But the subscription is still created, i think we would need to do another call to delete the subscription before throwing the exception to maintain current functionality. |
We'll indeed need to delete the subscription and throw an exception. We'll also need to check into swapping plans. I'll try to look into this together with #621 tomorrow. |
PR made: #631 |
Hello Dries, |
@sdebacker the behavior for all this will be different on the next release so let's just wait until v10 is out. You can help beta test if you want. |
Ok, thanks, I will try v10. |
Description:
In the latest version of stripes api (2019-03-14), there is a major change to the way subscription payments are handled. The subscription is created regardless of the first payment failing. Mentioned in the upgrade guide and in the docs.
Steps To Reproduce:
Create a subscription using the card number
4000 0000 0000 0341
. This will attach successfully to the customer but payments will fail.Using the above on to create a subscription on version
2019-02-19
throws a Stripe error, however on2019-03-14
it creates a subscription with an 'incomplete' status. Cashier then creates that as a successful subscription.The text was updated successfully, but these errors were encountered: