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.
This commit is contained in:
Fabien O'Carroll 2021-05-20 12:10:40 +01:00
parent 0d3014a87a
commit 26e2cb98e9
2 changed files with 1 additions and 8 deletions

View File

@ -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();

View File

@ -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',