mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -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:
parent
6fc6718735
commit
4c4cc90d05
1 changed files with 7 additions and 1 deletions
|
@ -54,7 +54,13 @@ module.exports = class StripePaymentProcessor {
|
||||||
const webhook = await create(this._stripe, 'webhookEndpoints', {
|
const webhook = await create(this._stripe, 'webhookEndpoints', {
|
||||||
url: this._webhookHandlerUrl,
|
url: this._webhookHandlerUrl,
|
||||||
api_version: STRIPE_API_VERSION,
|
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;
|
this._webhookSecret = webhook.secret;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue