mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Expose Stripe events in package
This commit is contained in:
parent
98fd6a7dbf
commit
48f9e85e09
6 changed files with 7 additions and 3 deletions
|
@ -236,7 +236,7 @@ class SettingsBREADService {
|
|||
const previous = stripePublicKeySetting.previousAttributes().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
|
||||
await stripeService.connect();
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
module.exports = require('./lib/StripeService');
|
||||
module.exports.events = require('./lib/events');
|
||||
|
|
|
@ -3,8 +3,7 @@ const StripeAPI = require('./StripeAPI');
|
|||
const StripeMigrations = require('./StripeMigrations');
|
||||
const WebhookController = require('./WebhookController');
|
||||
const DomainEvents = require('@tryghost/domain-events');
|
||||
const StripeLiveEnabledEvent = require('./StripeLiveEnabledEvent');
|
||||
const StripeLiveDisabledEvent = require('./StripeLiveDisabledEvent');
|
||||
const {StripeLiveEnabledEvent, StripeLiveDisabledEvent} = require('./events');
|
||||
|
||||
module.exports = class StripeService {
|
||||
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…
Add table
Reference in a new issue