From 4c4cc90d052eda0db021e547252d0fa39a515bee Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 8 Oct 2019 14:33:26 +0700 Subject: [PATCH] Added the extra events to the stripe webhook no-issue * customer.subscription.deleted - when a subscription is cancelled * customer.subscription.updated - when a subscription status/plan changes * invoice.payment_succeeded - when a subscription has successfully renew * invoice.payment.failed - when a subscription has failed to renew --- ghost/members-api/lib/stripe/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ghost/members-api/lib/stripe/index.js b/ghost/members-api/lib/stripe/index.js index 99e07f99e0..ae0259b33e 100644 --- a/ghost/members-api/lib/stripe/index.js +++ b/ghost/members-api/lib/stripe/index.js @@ -54,7 +54,13 @@ module.exports = class StripePaymentProcessor { const webhook = await create(this._stripe, 'webhookEndpoints', { url: this._webhookHandlerUrl, api_version: STRIPE_API_VERSION, - enabled_events: ['checkout.session.completed'] + enabled_events: [ + 'checkout.session.completed', + 'customer.subscription.deleted', + 'customer.subscription.updated', + 'invoice.payment_succeeded', + 'invoice.payment_failed' + ] }); this._webhookSecret = webhook.secret; } catch (err) {