mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Cleaned up stripe-service package usage
no refs - updates all usages of `stripe-service` package to new correct `members-stripe-service` package
This commit is contained in:
parent
aa0b95528e
commit
fe4fb78830
4 changed files with 42 additions and 42 deletions
|
@ -3,7 +3,7 @@ const body = require('body-parser');
|
||||||
const MagicLink = require('@tryghost/magic-link');
|
const MagicLink = require('@tryghost/magic-link');
|
||||||
const common = require('./common');
|
const common = require('./common');
|
||||||
|
|
||||||
const StripeAPIService = require('@tryghost/stripe-service');
|
const StripeAPIService = require('@tryghost/members-stripe-service');
|
||||||
const MemberAnalyticsService = require('@tryghost/member-analytics-service');
|
const MemberAnalyticsService = require('@tryghost/member-analytics-service');
|
||||||
const MembersAnalyticsIngress = require('@tryghost/members-analytics-ingress');
|
const MembersAnalyticsIngress = require('@tryghost/members-analytics-ingress');
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ const errors = require('@tryghost/ignition-errors');
|
||||||
* @param {any} deps.StripePrice
|
* @param {any} deps.StripePrice
|
||||||
* @param {boolean} deps.allowSelfSignup
|
* @param {boolean} deps.allowSelfSignup
|
||||||
* @param {any} deps.magicLinkService
|
* @param {any} deps.magicLinkService
|
||||||
* @param {import('@tryghost/stripe-service')} deps.stripeAPIService
|
* @param {import('@tryghost/members-stripe-service')} deps.stripeAPIService
|
||||||
* @param {any} deps.tokenService
|
* @param {any} deps.tokenService
|
||||||
* @param {any} deps.config
|
* @param {any} deps.config
|
||||||
* @param {any} deps.logging
|
* @param {any} deps.logging
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
"@tryghost/magic-link": "^1.0.12",
|
"@tryghost/magic-link": "^1.0.12",
|
||||||
"@tryghost/member-analytics-service": "^0.1.1",
|
"@tryghost/member-analytics-service": "^0.1.1",
|
||||||
"@tryghost/members-analytics-ingress": "^0.1.2",
|
"@tryghost/members-analytics-ingress": "^0.1.2",
|
||||||
"@tryghost/stripe-service": "^0.1.0",
|
"@tryghost/members-stripe-service": "^0.1.0",
|
||||||
"@tryghost/tpl": "^0.1.2",
|
"@tryghost/tpl": "^0.1.2",
|
||||||
"@types/jsonwebtoken": "^8.5.1",
|
"@types/jsonwebtoken": "^8.5.1",
|
||||||
"bluebird": "^3.5.4",
|
"bluebird": "^3.5.4",
|
||||||
|
|
|
@ -1,45 +1,45 @@
|
||||||
// const {describe, it} = require('mocha');
|
const {describe, it} = require('mocha');
|
||||||
// const should = require('should');
|
const should = require('should');
|
||||||
// const sinon = require('sinon');
|
const sinon = require('sinon');
|
||||||
// const StripeAPIService = require('@tryghost/stripe-service');
|
const StripeAPIService = require('@tryghost/members-stripe-service');
|
||||||
// const StripeWebhookService = require('../../../../lib/services/stripe-webhook');
|
const StripeWebhookService = require('../../../../lib/services/stripe-webhook');
|
||||||
// const ProductRepository = require('../../../../lib/repositories/product');
|
const ProductRepository = require('../../../../lib/repositories/product');
|
||||||
// const MemberRepository = require('../../../../lib/repositories/member');
|
const MemberRepository = require('../../../../lib/repositories/member');
|
||||||
|
|
||||||
// function mock(Class) {
|
function mock(Class) {
|
||||||
// return sinon.stub(Object.create(Class.prototype));
|
return sinon.stub(Object.create(Class.prototype));
|
||||||
// }
|
}
|
||||||
|
|
||||||
// describe('StripeWebhookService', function () {
|
describe('StripeWebhookService', function () {
|
||||||
// describe('invoice.payment_succeeded webhooks', function () {
|
describe('invoice.payment_succeeded webhooks', function () {
|
||||||
// it('Should throw a 404 error when a member is not found for a valid Ghost Members invoice', async function () {
|
it('Should throw a 404 error when a member is not found for a valid Ghost Members invoice', async function () {
|
||||||
// const stripeWebhookService = new StripeWebhookService({
|
const stripeWebhookService = new StripeWebhookService({
|
||||||
// stripeAPIService: mock(StripeAPIService),
|
stripeAPIService: mock(StripeAPIService),
|
||||||
// productRepository: mock(ProductRepository),
|
productRepository: mock(ProductRepository),
|
||||||
// memberRepository: mock(MemberRepository)
|
memberRepository: mock(MemberRepository)
|
||||||
// });
|
});
|
||||||
|
|
||||||
// stripeWebhookService._stripeAPIService.getSubscription.resolves({
|
stripeWebhookService._stripeAPIService.getSubscription.resolves({
|
||||||
// customer: 'customer_id',
|
customer: 'customer_id',
|
||||||
// plan: {
|
plan: {
|
||||||
// product: 'product_id'
|
product: 'product_id'
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
|
|
||||||
// stripeWebhookService._memberRepository.get.resolves(null);
|
stripeWebhookService._memberRepository.get.resolves(null);
|
||||||
|
|
||||||
// stripeWebhookService._productRepository.get.resolves({
|
stripeWebhookService._productRepository.get.resolves({
|
||||||
// id: 'product_id'
|
id: 'product_id'
|
||||||
// });
|
});
|
||||||
|
|
||||||
// try {
|
try {
|
||||||
// await stripeWebhookService.invoiceEvent({
|
await stripeWebhookService.invoiceEvent({
|
||||||
// subscription: 'sub_id'
|
subscription: 'sub_id'
|
||||||
// });
|
});
|
||||||
// should.fail();
|
should.fail();
|
||||||
// } catch (err) {
|
} catch (err) {
|
||||||
// should.equal(err.statusCode, 404);
|
should.equal(err.statusCode, 404);
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// });
|
});
|
||||||
// });
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue