mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
ed235b374d
refs https://github.com/TryGhost/Team/issues/1586 - updated `?newsletter_id=id` handling in posts API mock to match the real `?newsletter=slug` behaviour - added additional publish flow acceptance tests for single/multiple newsletter behaviour, scheduling, and sending
21 lines
1.4 KiB
JavaScript
21 lines
1.4 KiB
JavaScript
export function enableStripe(server, enabled = true) {
|
|
server.db.settings.find({key: 'stripe_connect_account_id'})
|
|
? server.db.settings.update({key: 'stripe_connect_account_id'}, {value: (enabled ? 'stripe_account_id' : null)})
|
|
: server.create('setting', {key: 'stripe_connect_account_id', value: (enabled ? 'stripe_account_id' : null), group: 'members'});
|
|
// needed for membersUtils.isStripeEnabled
|
|
server.db.settings.find({key: 'stripe_connect_secret_key'})
|
|
? server.db.settings.update({key: 'stripe_connect_secret_key'}, {value: (enabled ? 'stripe_secret_key' : null)})
|
|
: server.create('setting', {key: 'stripe_connect_secret_key', value: (enabled ? 'stripe_secret_key' : null), group: 'members'});
|
|
server.db.settings.find({key: 'stripe_connect_publishable_key'})
|
|
? server.db.settings.update({key: 'stripe_connect_publishable_key'}, {value: (enabled ? 'stripe_secret_key' : null)})
|
|
: server.create('setting', {key: 'stripe_connect_publishable_key', value: (enabled ? 'stripe_secret_key' : null), group: 'members'});
|
|
|
|
server.db.settings.find({key: 'paid_members_enabled'})
|
|
? server.db.settings.update({key: 'paid_members_enabled'}, {value: enabled})
|
|
: server.create('setting', {key: 'paid_members_enabled', value: enabled, group: 'members'});
|
|
}
|
|
|
|
export function disableStripe(server) {
|
|
enableStripe(server, false);
|
|
}
|