Commit Graph

3 Commits

Author SHA1 Message Date
Rishabh Garg
33458daae8
🐛 Fixed free trial applied alongside an offer in checkout (#15975)
refs https://github.com/TryGhost/Team/issues/2375

If a discount offer is associated with a tier that has a free trial enabled on full price / standard portal in membership settings, then the stripe checkout applied both the discount and free trial to the member, which is incorrect as we shouldn't be combining both.

- removes trial days from stripe checkout if a coupon is being applied, so only one of them is applied at a time
2022-12-09 18:47:05 +05:30
Fabien "egg" O'Carroll
69aa52bd8e 🐛 Handled deleted Stripe objects in the Stripe Checkout flow
closes https://github.com/TryGhost/Team/issues/2222

Whilst we were checking for Stripe objects being active, we were not
checking for them existing in Stripe. This adds handling to all read
request to Stripe in the payment link flow, so that we can gracefully
handle deleted objects.

We've also included an automated test which fails without this fix.

We've also improved the query to find Stripe Prices which will result
in less request to the Stripe API to check if it is valid.
2022-11-08 16:03:07 +07:00
Fabien O'Carroll
5db41169aa Added @tryghost/members-payments module
refs https://github.com/TryGhost/Team/issues/1166

This is a new module which will eventually handle all payment related
things. This allows the Offers module to focus exclusively on the Ghost
concepts, and the Payments module will handle the association between
Offer & Stripe Coupon, Tier & Stripe Product, Cadence & Stripe Price.

This decoupling allows us to not have to consider the lack of Stripe
data for an Offer, which is the case after a Stripe Disconnect. Instead
all of the population/repopulation/lazy-creating can be handled here.
2021-10-21 15:40:55 +02:00