Fixed Stripe Checkout for monthly Offers

refs https://github.com/TryGhost/Members/commit/504fb1bf

Since we updated the Offer to use Value Objects, we needed to update the
usage here too.
This commit is contained in:
Fabien O'Carroll 2021-10-08 15:19:09 +02:00
parent 1312943f5b
commit afa5363dd4

View File

@ -140,7 +140,7 @@ module.exports = class RouterController {
const offer = await this._offerRepository.getById(offerId);
const tier = (await this._productRepository.get(offer.tier)).toJSON();
if (offer.cadence === 'month') {
if (offer.cadence.value === 'month') {
ghostPriceId = tier.monthly_price_id;
} else {
ghostPriceId = tier.yearly_price_id;