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: handle failed 3DS payments #9924

Merged
merged 2 commits into from
Jul 3, 2024
Merged

fix: handle failed 3DS payments #9924

merged 2 commits into from
Jul 3, 2024

Conversation

mattkrick
Copy link
Member

Description

When a 3DS payment fails, that causes the subscription to go from incomplete to incomplete_expired.
We had a webhook handler that would set the stripeSubscriptionId to whatever was coming in from stripe, even if the incoming subscription was expired!
That chain of logic would attach an expired stripeSubscriptionId onto an organization, and when they tried to upgrade again, it would fail because they already had a subscription 🤮

this checks to make sure the subscription is valid before updating the Organization.stripeSubcriptionId.
Additionally, i noticed that after an upgrade failed, if you click the upgrade button again, it doesn't do anything except remove the error message. That felt bad, so I fixed that logic.

@github-actions github-actions bot added the size/s label Jul 2, 2024
@github-actions github-actions bot added size/m and removed size/s labels Jul 2, 2024
@mattkrick mattkrick merged commit 4663e9e into master Jul 3, 2024
5 checks passed
@mattkrick mattkrick deleted the fix/stripe-3DS branch July 3, 2024 15:04
@github-actions github-actions bot mentioned this pull request Jul 4, 2024
24 tasks
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 this pull request may close these issues.

1 participant