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

Change sending of payment failure emails #159

Open
dracos opened this issue Aug 2, 2024 · 0 comments
Open

Change sending of payment failure emails #159

dracos opened this issue Aug 2, 2024 · 0 comments

Comments

@dracos
Copy link
Member

dracos commented Aug 2, 2024

Normally, if we attempt payment and it fails, we get a payment_failed event with a next_payment_attempt set to show Stripe will try again, and we send an email saying payment has failed, please sort it. Then if we get the same type of event with no next_payment_attempt, we send an email saying it's been cancelled, as we won't have taken any payment.

However, we had a situation recently where a subscription rolled over, payment was attempted but the card required 3DS confirmation, so the payment failed and Stripe sent the customer an email to do the 3DS check (which they did, and the payment went through fine). However, the payment_failed event we received didn't have a next_payment_attempt set (presumably because it wasn't going to), so we sent a "subscription has been cancelled" email, which was confusing as they'd also got an email from Stripe and confirmed their payment (and their subscription was not cancelled).

I think we should:

  • stop sending out the "cancelled" email on failed payment, and only do so on customer.subscription.deleted (when we know it has been) - don't think there's any issue with this?
  • Also, if we think there might be other payment failures that don't have a next_payment_attempt that might not be 'final' attempts for whatever reason, we could stop sending out that email and turn on Stripe's "Send email when card payments fail" option and let it handle that instead.
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

No branches or pull requests

1 participant