0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Added manual check for stripe connect integration

no-issue

We had a circular dependency issue when using the members service, so
this commit replaces the use of that with a check to the settings cache
to check if stripe connect has been setup.
This commit is contained in:
Fabien O'Carroll 2020-06-11 20:15:15 +02:00 committed by Fabien 'egg' O'Carroll
parent 2418594651
commit 4525fa65b0

View file

@ -43,11 +43,13 @@ function getMembersHelper() {
const stripeSecretToken = stripePaymentProcessor.config.secret_token;
const stripePublicToken = stripePaymentProcessor.config.public_token;
const stripeConnectIntegration = settingsCache.get('stripe_connect_integration');
let membersHelper = `<script defer src="${getAssetUrl('public/members.js', true)}"></script>`;
if (config.get('enableDeveloperExperiments')) {
membersHelper = `<script defer src="https://unpkg.com/@tryghost/members-js@latest/umd/members.min.js"></script>`;
}
if (!!stripeSecretToken && stripeSecretToken !== '' && !!stripePublicToken && stripePublicToken !== '') {
if ((!!stripeSecretToken && !!stripePublicToken) || !!stripeConnectIntegration.account_id) {
membersHelper += '<script src="https://js.stripe.com/v3/"></script>';
}
return membersHelper;