0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Handled Stripe Disconnect for Offers

refs https://github.com/TryGhost/Team/issues/1166

As usual we want to delete all Stripe related data on disconnect.
This commit is contained in:
Fabien O'Carroll 2021-10-20 14:40:34 +02:00 committed by Fabien 'egg' O'Carroll
parent 7a68dc2bd3
commit 1ae6a2ac44

View file

@ -49,6 +49,7 @@ module.exports = function MembersAPI({
MemberProductEvent, MemberProductEvent,
MemberEmailChangeEvent, MemberEmailChangeEvent,
MemberAnalyticEvent, MemberAnalyticEvent,
Offer,
OfferRedemption, OfferRedemption,
StripeProduct, StripeProduct,
StripePrice, StripePrice,
@ -191,6 +192,9 @@ module.exports = function MembersAPI({
await StripePrice.forge().query().del(); await StripePrice.forge().query().del();
await StripeProduct.forge().query().del(); await StripeProduct.forge().query().del();
await StripeCustomer.forge().query().del(); await StripeCustomer.forge().query().del();
await Offer.forge().query().update({
stripe_coupon_id: null
});
} }
const ready = stripeAPIService.configured ? Promise.all([ const ready = stripeAPIService.configured ? Promise.all([