mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 11:55:01 +03:00
Restricted existing prices to those that are active (#15195)
Without this check, an inactive price in our database will just be reactivated each time it is required. This can cause issues when prices have been deleted. By adding this constraint to the query, we will create a new price in Stripe and our database when attempting to use an inactive price, this is particularly useful when trying to fix problems caused by Stripe prices being deleted.
This commit is contained in:
parent
67aa8d5956
commit
453f828aa7
@ -421,7 +421,8 @@ class ProductRepository {
|
||||
amount: data.monthly_price.amount,
|
||||
currency: data.monthly_price.currency,
|
||||
type: 'recurring',
|
||||
interval: 'month'
|
||||
interval: 'month',
|
||||
active: true
|
||||
}, options);
|
||||
let priceModel;
|
||||
if (existingPrice) {
|
||||
@ -468,7 +469,8 @@ class ProductRepository {
|
||||
amount: data.yearly_price.amount,
|
||||
currency: data.yearly_price.currency,
|
||||
type: 'recurring',
|
||||
interval: 'year'
|
||||
interval: 'year',
|
||||
active: true
|
||||
}, options);
|
||||
let priceModel;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user