From 0fe80edc0a71a44c1882ab38531a072b8b8bfa81 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 21 Jul 2020 13:52:43 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20Stripe=20Subscriptions?= =?UTF-8?q?=20with=20trail=20periods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no-issue This fixes a problem when subscribing to a Plan (Price) with a default trial period. We also add logging to add a little more information about which flow we're entering. Subscriptions that are started with a trial have a present on the Checkout Session object, which was incorrectly causing us to determine that we are in a setup flow and attempt to update a customers card details. We now use the property of the Checkout Session to determine whether we are handling a new Subscription, or if we are in a setup flow and should update the Customer's card details. Includes the code from https://github.com/TryGhost/Members/pull/184 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d576fca327..1389edeacd 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@tryghost/kg-markdown-html-renderer": "2.0.1", "@tryghost/kg-mobiledoc-html-renderer": "3.0.1", "@tryghost/magic-link": "0.4.11", - "@tryghost/members-api": "0.24.1", + "@tryghost/members-api": "0.24.2", "@tryghost/members-csv": "0.2.1", "@tryghost/members-ssr": "0.8.3", "@tryghost/mw-session-from-token": "0.1.5", diff --git a/yarn.lock b/yarn.lock index 0d15036980..2ee25eb651 100644 --- a/yarn.lock +++ b/yarn.lock @@ -486,10 +486,10 @@ jsonwebtoken "^8.5.1" lodash "^4.17.15" -"@tryghost/members-api@0.24.1": - version "0.24.1" - resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-0.24.1.tgz#76e10da50184b7508246d17febe8aff0af7d4cf7" - integrity sha512-ilKZwlQK94fW1gS2Uii1ay6GUK99gfrUJLdKsOsulqsIWD4yRY2e2gz21cCsBJx3ep3DoGV9KYT1ZGkIxSKBgA== +"@tryghost/members-api@0.24.2": + version "0.24.2" + resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-0.24.2.tgz#6cbedfa12d9d492bbe23675cf7264bd6abf3e5c4" + integrity sha512-Tqw7P/zr+q42WdrlnCKrDZAGLESlZJcwzurw00oU4jq3p6fiSvl7wwcwjA9sadGBWdMEbrgDDt2wlng2h+lcKg== dependencies: "@tryghost/magic-link" "^0.4.11" bluebird "^3.5.4"