codecov / engineering-team

This is a general repo to use with GH Projects
1 stars 1 forks source link

Investigate Billing Issues with Stripe user seat count updates #2407

Open trent-codecov opened 2 months ago

trent-codecov commented 2 months ago

Slack thread

The flow with Stripe and our plan system is not healthy - I have the feeling there is something we are missing with our stripe integration that will make this work the way we want.

an upgrade invalidates the current subscription. When something errors with the upgrade, we are unable to recreate or fallback to the previous subscription. we've run into this issue twice now where customer has annual plan, customer upgrades, payment method fails on the upgrade, but the result is that the customer is bumped back down to free tier, losing the other seats that they paid for on the annual plan.

My summary and plan from the slack thread:

had an enlightening call with Nick - he showed me how when things go wrong with a subscription, we are acting as middle-men between the customer and stripe, and we get into sticky situations because we're not able to actually correct stripe's subscriptions for our services when things go awry. basically, issues with subscriptions are out of our control but they make us look bad. I'd like to look into this and see if we can change some things - it has lost us 2 customers in the last month, and we're not sure how to fix it if it happens again or whether the fix we put in place (for the other customer who didn't cancel) won't fall apart again at the end of that subscription.

  • we need to better handle payment failure, we need to figure out whether we can prevent upgrade payment failure from cancelling the user's already paid for subscription
  • we need to better surface stripe payment issues to the user, communicate to them that the payments are failing (before they become delinquent/cancelled) and give them a path to reactivate their subscription if they get cancelled
  • when this happens again, how should we fix it? are we able to fix it?
nora-codecov commented 1 month ago

I think I have found what I am looking for https://docs.stripe.com/billing/subscriptions/pending-updates This describes the issue we are having, how to implement this fix, and other scenarios to build for.

nora-codecov commented 1 month ago

https://docs.stripe.com/billing/subscriptions/pending-updates-reference

Initial implementation didn't work, getting errors that are blocking the subscription upgrades. Including this param conflicts with other params on the .modify() call, so I need to look at those, see what they are doing and whether they can be changed or removed.

partially reverted my change, removed payment_behavior. Going to assign this to the sprint that aligns with my next support rotation.