From e61d91a35e0a03dac4f1a5ba0b54f7be8700d1cd Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 6 Oct 2023 10:07:51 -0500 Subject: [PATCH] Website: Update receive-from-stripe webhook to handle failed payments when creating a subscription. (#14348) Changes: - Added two events to the `STRIPE_EVENTS_SENT_BEFORE_A_SUBSCRIPTION_RECORD_EXISTS` array in the `receive-from-stripe` webhook --- website/api/controllers/webhooks/receive-from-stripe.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/api/controllers/webhooks/receive-from-stripe.js b/website/api/controllers/webhooks/receive-from-stripe.js index 4b8a9e1138..a8aa600b65 100644 --- a/website/api/controllers/webhooks/receive-from-stripe.js +++ b/website/api/controllers/webhooks/receive-from-stripe.js @@ -73,6 +73,8 @@ module.exports = { 'invoice.finalized', 'invoice.paid', 'invoice.payment_succeeded', + 'invoice.payment_failed', + 'invoice.payment_action_required', ]; // If this event is for a subscription that was just created, we won't have a matching Subscription record in the database. This is because we wait until the subscription's invoice is paid to create the record in our database.