mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Restricted archived Offers from being used
refs https://github.com/TryGhost/Team/issues/1133 An archived Offer is intended to be disabled from a redemption point of view. This ensures that we do not allow Stripe Checkout Sessions to be created for them.
This commit is contained in:
parent
1ec3dfbfab
commit
9e7891fef7
1 changed files with 5 additions and 0 deletions
|
@ -140,6 +140,11 @@ module.exports = class RouterController {
|
|||
const offer = await this._offersAPI.getOffer({id: offerId});
|
||||
const tier = (await this._productRepository.get(offer.tier)).toJSON();
|
||||
|
||||
if (offer.status === 'archived') {
|
||||
res.writeHead(403);
|
||||
return res.end('Offer is archived.');
|
||||
}
|
||||
|
||||
if (offer.cadence === 'month') {
|
||||
ghostPriceId = tier.monthly_price_id;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue