🐛 Fixed Stripe Subscriptions with trail periods

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
This commit is contained in:
Fabien O'Carroll 2020-07-21 13:52:43 +02:00 committed by Fabien 'egg' O'Carroll
parent 1822e5d23e
commit 0fe80edc0a
2 changed files with 5 additions and 5 deletions

View File

@ -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",

View File

@ -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"