Ghost/ghost/members-api/lib/repositories
Simon Backx f74b00fea6 Stored offer_id in subscriptions (#389)
refs https://github.com/TryGhost/Team/issues/1519

- Added offer repository dependency to member repository (offerAPI didn't work because it creates a new transaction that resulted in a deadlock during tests)
- Store the offer id from the Stripe subscription metadata in the subscription (only if the discount is still active)
- Also added the offer id to the metadata for a Stripe coupon, this will make adding and removing coupons a bit more foolproof
- Prefer the usage of the offer metadata from a coupon if it is present
- When no discount is applied to a subscription, it always sets the offer id to null, even when the metadata still contains the offer
- The offer_id remains stored when a subscription is canceled/expired
2022-04-19 09:15:33 +02:00
..
event.js Add API verification trigger with new filter 2022-02-03 15:02:33 +00:00
member.js Stored offer_id in subscriptions (#389) 2022-04-19 09:15:33 +02:00
product.js Fixed visibility changes in product repository (#375) 2022-03-07 14:09:07 +00:00