2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

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.
This commit is contained in:
Fabien O'Carroll 2020-06-12 18:38:06 +02:00 committed by Fabien 'egg' O'Carroll
parent 008f86fc29
commit 63f1e57036
2 changed files with 5 additions and 5 deletions

View file

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

View file

@ -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;
}