From 63f1e57036ade1bedf0d52070a57608aae8903b5 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Fri, 12 Jun 2020 18:38:06 +0200 Subject: [PATCH] Fixed Members Stripe config for Stripe Connect no-issue This was initially missed as local settings always had the original stripeDirect keys, this ensures that regardless of Connect vs Direct vs Both vs Neither that the config is correct. Also ensures that the Members API instance is reloaded when the Stripe Connect settings are changed. --- core/server/services/members/config.js | 8 ++++---- core/server/services/members/index.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/server/services/members/config.js b/core/server/services/members/config.js index 1fabb87a76..d12f018ac7 100644 --- a/core/server/services/members/config.js +++ b/core/server/services/members/config.js @@ -131,10 +131,6 @@ class MembersConfigProvider { return null; } - if (!stripePaymentProcessor.config.public_token || !stripePaymentProcessor.config.secret_token) { - return null; - } - // NOTE: "Complimentary" plan has to be first in the queue so it is created even if regular plans are not configured stripePaymentProcessor.config.plans.unshift(COMPLIMENTARY_PLAN); @@ -157,6 +153,10 @@ class MembersConfigProvider { stripePaymentProcessor.config.secret_token ); + if (!stripeApiKeys.publicKey || !stripeApiKeys.secretKey) { + return null; + } + return { publicKey: stripeApiKeys.publicKey, secretKey: stripeApiKeys.secretKey, diff --git a/core/server/services/members/index.js b/core/server/services/members/index.js index 722c3a0eca..aa4a3ed9ac 100644 --- a/core/server/services/members/index.js +++ b/core/server/services/members/index.js @@ -23,7 +23,7 @@ let membersSettings; // Bind to events to automatically keep subscription info up-to-date from settings events.on('settings.edited', function updateSettingFromModel(settingModel) { - if (!['members_subscription_settings'].includes(settingModel.get('key'))) { + if (!['members_subscription_settings', 'stripe_connect_integration'].includes(settingModel.get('key'))) { return; }