Expose Stripe events in package
This commit is contained in:
parent
98fd6a7dbf
commit
48f9e85e09
@ -236,7 +236,7 @@ class SettingsBREADService {
|
|||||||
const previous = stripePublicKeySetting.previousAttributes().value;
|
const previous = stripePublicKeySetting.previousAttributes().value;
|
||||||
const current = stripePublicKeySetting.get('value');
|
const current = stripePublicKeySetting.get('value');
|
||||||
|
|
||||||
if (current?.match(/pk_test/) && (!previous?.match(/pk_test/) || !previous)) {
|
if (current?.match(/pk_live/) && (!previous?.match(/pk_live/) || !previous)) {
|
||||||
// This method currently only triggers a DomainEvent
|
// This method currently only triggers a DomainEvent
|
||||||
await stripeService.connect();
|
await stripeService.connect();
|
||||||
}
|
}
|
||||||
|
@ -1 +1,2 @@
|
|||||||
module.exports = require('./lib/StripeService');
|
module.exports = require('./lib/StripeService');
|
||||||
|
module.exports.events = require('./lib/events');
|
||||||
|
@ -3,8 +3,7 @@ const StripeAPI = require('./StripeAPI');
|
|||||||
const StripeMigrations = require('./StripeMigrations');
|
const StripeMigrations = require('./StripeMigrations');
|
||||||
const WebhookController = require('./WebhookController');
|
const WebhookController = require('./WebhookController');
|
||||||
const DomainEvents = require('@tryghost/domain-events');
|
const DomainEvents = require('@tryghost/domain-events');
|
||||||
const StripeLiveEnabledEvent = require('./StripeLiveEnabledEvent');
|
const {StripeLiveEnabledEvent, StripeLiveDisabledEvent} = require('./events');
|
||||||
const StripeLiveDisabledEvent = require('./StripeLiveDisabledEvent');
|
|
||||||
|
|
||||||
module.exports = class StripeService {
|
module.exports = class StripeService {
|
||||||
constructor({
|
constructor({
|
||||||
|
4
ghost/stripe/lib/events/index.js
Normal file
4
ghost/stripe/lib/events/index.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
StripeLiveEnabledEvent: require('./StripeLiveEnabledEvent'),
|
||||||
|
StripeLiveDisabledEvent: require('./StripeLiveDisabledEvent')
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user