Fixed finding newly created zero-amount price

no-issue

The condition in the find statement was incorrecly referring to the
subscription rather than the price for the subscription.
This commit is contained in:
Fabien O'Carroll 2021-05-11 10:56:40 +01:00
parent 12d4e42bb1
commit d5269d8a9a

View File

@ -643,8 +643,8 @@ module.exports = class MemberRepository {
amount: 0
}]
}, options)).toJSON();
zeroValuePrice = product.stripePrices.find((price) => {
return price.currency.toLowerCase() === subscription.get('currency').toLowerCase() && price.amount === 0;
zeroValuePrice = product.stripePrices.find((p) => {
return p.currency.toLowerCase() === price.get('currency').toLowerCase() && p.amount === 0;
});
zeroValuePrices.push(zeroValuePrice);
}