From 4b4a990e1d82ff34f704c2840f225424a3172dc2 Mon Sep 17 00:00:00 2001 From: Rish Date: Mon, 1 Feb 2021 10:24:16 +0530 Subject: [PATCH] Fixed default urls for checkout session no-issue related to https://github.com/TryGhost/Members/commit/ef9cb0862c753169c8d1bbd741cf7455303fac82 In the last patch which fixes the bug for not passing custom redirect urls when a checkout session is created, we missed updating the case where a logged in member tries to update the subscription. --- ghost/members-api/lib/controllers/router/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/members-api/lib/controllers/router/index.js b/ghost/members-api/lib/controllers/router/index.js index 46ee4f359c..4a21cdaffb 100644 --- a/ghost/members-api/lib/controllers/router/index.js +++ b/ghost/members-api/lib/controllers/router/index.js @@ -271,8 +271,8 @@ module.exports = class RouterController { try { const session = await this._stripeAPIService.createCheckoutSession(plan, stripeCustomer, { - successUrl: req.body.successUrl, - cancelUrl: req.body.cancelUrl, + successUrl: req.body.successUrl || this._config.checkoutSuccessUrl, + cancelUrl: req.body.cancelUrl || this._config.checkoutCancelUrl, metadata: req.body.metadata }); const publicKey = this._stripeAPIService.getPublicKey();