mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
Added new requirePaymentForSignup
setting for members (#11214)
* Added new `requirePaymentForSignup` setting for members no issue - Adds new `requirePaymentForSignup` setting flag for members, `false` by default. - Wired members API `allowSelfSignup` to `requirePayment` setting
This commit is contained in:
parent
daa77c5c00
commit
7dc2eb2a1e
@ -198,7 +198,7 @@
|
||||
"defaultValue": "public"
|
||||
},
|
||||
"members_subscription_settings": {
|
||||
"defaultValue": "{\"isPaid\":false,\"paymentProcessors\":[{\"adapter\":\"stripe\",\"config\":{\"secret_token\":\"\",\"public_token\":\"\",\"product\":{\"name\":\"Ghost Subscription\"},\"plans\":[{\"name\":\"Monthly\",\"currency\":\"usd\",\"interval\":\"month\",\"amount\":\"\"},{\"name\":\"Yearly\",\"currency\":\"usd\",\"interval\":\"year\",\"amount\":\"\"}]}}]}"
|
||||
"defaultValue": "{\"isPaid\":false,\"requirePaymentForSignup\":false,\"paymentProcessors\":[{\"adapter\":\"stripe\",\"config\":{\"secret_token\":\"\",\"public_token\":\"\",\"product\":{\"name\":\"Ghost Subscription\"},\"plans\":[{\"name\":\"Monthly\",\"currency\":\"usd\",\"interval\":\"month\",\"amount\":\"\"},{\"name\":\"Yearly\",\"currency\":\"usd\",\"interval\":\"year\",\"amount\":\"\"}]}}]}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,6 +119,11 @@ function getStripePaymentConfig() {
|
||||
};
|
||||
}
|
||||
|
||||
function getRequirePaymentSetting() {
|
||||
const subscriptionSettings = settingsCache.get('members_subscription_settings');
|
||||
return !!subscriptionSettings.requirePaymentForSignup;
|
||||
}
|
||||
|
||||
module.exports = createApiInstance;
|
||||
|
||||
function createApiInstance() {
|
||||
@ -134,7 +139,8 @@ function createApiInstance() {
|
||||
signinURL.searchParams.set('token', token);
|
||||
signinURL.searchParams.set('action', type);
|
||||
return signinURL.href;
|
||||
}
|
||||
},
|
||||
allowSelfSignup: !getRequirePaymentSetting()
|
||||
},
|
||||
mail: {
|
||||
transporter: {
|
||||
|
Loading…
Reference in New Issue
Block a user