0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00

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
This commit is contained in:
Fabien O'Carroll 2019-10-08 14:33:26 +07:00
parent 6fc6718735
commit 4c4cc90d05

View file

@ -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) {