From d5269d8a9ab595d980fec34a81e3d595a09b4414 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 11 May 2021 10:56:40 +0100 Subject: [PATCH] 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. --- ghost/members-api/lib/repositories/member/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/members-api/lib/repositories/member/index.js b/ghost/members-api/lib/repositories/member/index.js index e4f0044ec4..6685ebcfe1 100644 --- a/ghost/members-api/lib/repositories/member/index.js +++ b/ghost/members-api/lib/repositories/member/index.js @@ -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); }