From 26e2cb98e97e2d78539f05081d02860f9fc25583 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Thu, 20 May 2021 12:10:40 +0100 Subject: [PATCH] Removed environment checks from webhook service refs https://github.com/TryGhost/Team/issues/598 refs https://github.com/TryGhost/Ghost/commit/5cdf910e Since we have included these checks in the Ghost codebase we do not need to run them here. --- ghost/members-api/index.js | 3 +-- ghost/members-api/lib/services/stripe-webhook/index.js | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ghost/members-api/index.js b/ghost/members-api/index.js index d84b2665bb..36a32a5eb2 100644 --- a/ghost/members-api/index.js +++ b/ghost/members-api/index.js @@ -167,8 +167,7 @@ module.exports = function MembersApi({ stripeWebhookService.configure({ webhookSecret: process.env.WEBHOOK_SECRET, webhookHandlerUrl: stripeConfig.webhookHandlerUrl, - webhook: stripeConfig.webhook || {}, - mode: process.env.NODE_ENV || 'development' + webhook: stripeConfig.webhook || {} }) ]) : Promise.resolve(); diff --git a/ghost/members-api/lib/services/stripe-webhook/index.js b/ghost/members-api/lib/services/stripe-webhook/index.js index 6d08fa95f7..7483fa418e 100644 --- a/ghost/members-api/lib/services/stripe-webhook/index.js +++ b/ghost/members-api/lib/services/stripe-webhook/index.js @@ -44,12 +44,6 @@ module.exports = class StripeWebhookService { return; } - if (config.mode !== 'production') { - const error = new Error('Cannot use remote webhooks in development mode. Please use the WEBHOOK_SECRET environment variable.'); - error.fatal = true; - throw error; - } - /** @type {import('stripe').Stripe.WebhookEndpointCreateParams.EnabledEvent[]} */ const events = [ 'checkout.session.completed',