Ghost/ghost/admin/app/services/members-utils.js
Fabien 'egg' O'Carroll 5d22b788c8 Refactored to use updated members and stripe settings (#1621)
refs #10318

* Updated settings model with new settings

* Removed parseSubscriptionSettings from settings service

* Updated members-utils to use new settings

* Updated labs controller to use new settings

* Fixed dependency for member-settings-form

* Updated members-lab-setting component to use new settings

* Updated disconnect modal to use new settings

* Updated members portal modal to use new settings

* Removed Direct from settings

* Renamed members_allow_signup -> members_allow_free_signup

* Allowed for null fromAddress
2020-06-29 19:37:11 +02:00

21 lines
663 B
JavaScript

import Service from '@ember/service';
import {inject as service} from '@ember/service';
export default class MembersUtilsService extends Service {
@service settings;
@service config;
get isStripeEnabled() {
const stripeDirect = this.config.get('stripeDirect');
const hasDirectKeys = !!this.settings.get('stripeSecretKey') && !!this.settings.get('stripePublishableKey');
const hasConnectKeys = !!this.settings.get('stripeConnectSecretKey') && !!this.settings.get('stripeConnectPublishableKey');
if (stripeDirect) {
return hasDirectKeys;
}
return hasConnectKeys || hasDirectKeys;
}
}