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

Fix stripe subscription upgrade failures #831

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nora-codecov
Copy link
Contributor

Purpose/Motivation

We were eagerly updating the user's plan in the specific case where they already have a subscription and they are upgrading. We were updating without checking that the payment was successful, so in the case where we have updated the plan but the stripe payment fails, we were bumping the user all the way back to free tier.

Links to relevant tickets

codecov/engineering-team#2407

What does this PR do?

Only update the plan if the payment was successful. If it's not successful, reject the changes and give they user the delinquent pop-up. The user in our db and in Stripe's system stays on the original plan until they payment is successful.

@nora-codecov nora-codecov requested review from ajay-sentry and a team September 19, 2024 23:11
@codecov-notifications
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.23%. Comparing base (c2d571e) to head (3dc5686).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##               main       #831   +/-   ##
===========================================
  Coverage   96.23000   96.23000           
===========================================
  Files           812        812           
  Lines         18575      18586   +11     
===========================================
+ Hits          17876      17887   +11     
  Misses          699        699           
Flag Coverage Δ
unit 92.47% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 92.47% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

1 participant