From 4c3bd0e2e9b86d5eaffd7b72f32a643558e8f7a4 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Wed, 20 May 2020 16:14:28 +0200 Subject: [PATCH] Added stripeDirect config to admin api w/ default no-issue The flag currently defaults to `true` as we are still using stripe direct. We expose it on the admin api config endpoint so that the Ghost-Admin client can use it to conditionally render --- core/server/api/canary/config.js | 3 ++- core/server/config/defaults.json | 3 ++- test/api-acceptance/admin/utils.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/server/api/canary/config.js b/core/server/api/canary/config.js index 963a5fee7b..64c0005467 100644 --- a/core/server/api/canary/config.js +++ b/core/server/api/canary/config.js @@ -18,7 +18,8 @@ module.exports = { useGravatar: !config.isPrivacyDisabled('useGravatar'), labs: labs.getAll(), clientExtensions: config.get('clientExtensions') || {}, - enableDeveloperExperiments: config.get('enableDeveloperExperiments') || false + enableDeveloperExperiments: config.get('enableDeveloperExperiments') || false, + stripeDirect: config.get('stripeDirect') }; if (billingUrl) { response.billingUrl = billingUrl; diff --git a/core/server/config/defaults.json b/core/server/config/defaults.json index 7f3ae49cde..159e443566 100644 --- a/core/server/config/defaults.json +++ b/core/server/config/defaults.json @@ -107,5 +107,6 @@ "compress": true, "preloadHeaders": false, "adminFrameProtection": true, - "sendWelcomeEmail": true + "sendWelcomeEmail": true, + "stripeDirect": true } diff --git a/test/api-acceptance/admin/utils.js b/test/api-acceptance/admin/utils.js index 7ac9d2f17b..0339eba194 100644 --- a/test/api-acceptance/admin/utils.js +++ b/test/api-acceptance/admin/utils.js @@ -22,7 +22,7 @@ const expectedProperties = { action: ['id', 'resource_type', 'actor_type', 'event', 'created_at', 'actor'], - config: ['version', 'environment', 'database', 'mail', 'labs', 'clientExtensions', 'enableDeveloperExperiments', 'useGravatar'], + config: ['version', 'environment', 'database', 'mail', 'labs', 'clientExtensions', 'enableDeveloperExperiments', 'useGravatar', 'stripeDirect'], post: _(schema.posts) .keys()