Skip to content
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

Closed
pulkitjalan opened this issue Apr 4, 2019 · 13 comments · Fixed by #631
Closed

Stripe Subscriptions Change #628

pulkitjalan opened this issue Apr 4, 2019 · 13 comments · Fixed by #631
Labels

Comments

@pulkitjalan
Copy link

  • Cashier Version: 9.2.1
  • Laravel Version: 5.7.16

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 on 2019-03-14 it creates a subscription with an 'incomplete' status. Cashier then creates that as a successful subscription.

@driesvints
Copy link
Member

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.

@driesvints driesvints added the bug label Apr 4, 2019
@pulkitjalan
Copy link
Author

pulkitjalan commented Apr 6, 2019 via email

@driesvints
Copy link
Member

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?

@pulkitjalan
Copy link
Author

Yea correct. The subscription object would return with a status of incomplete https://stripe.com/docs/upgrades#2019-03-14

@driesvints
Copy link
Member

In that case we could indeed throw an exception. Best that this is a cashier specific exception.

@driesvints
Copy link
Member

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.

@pulkitjalan
Copy link
Author

It use to be a Stripe\Error\Card exception with your card was declined error.

@pulkitjalan
Copy link
Author

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.

@driesvints
Copy link
Member

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.

@driesvints
Copy link
Member

PR made: #631

@sdebacker
Copy link
Contributor

Hello Dries,
It seems that the problem is still here on subscription swap: the subscription is updated by cashier even if Stripe marked it as incomplete.

@driesvints
Copy link
Member

@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.

@sdebacker
Copy link
Contributor

Ok, thanks, I will try v10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants