Added upgrade checkout metadata for stripe

no issue

Ghost sends email on successful signup to a paid plan via Stripe checkout, but couldn't differentiate between a Stripe checkout as new member or as an upgrade previously. This led to an extra second email with magic link on upgrading to paid plan while logged in.

Passing `checkoutType` metadata to Stripe checkout allows webhook to ignore second email in case of an upgrade scenario.
This commit is contained in:
Rish 2020-10-29 13:59:19 +05:30
parent 168fb204eb
commit b590a1fa90

View File

@ -114,7 +114,10 @@ async function checkoutPlan({data, state, api}) {
try {
const {plan} = data;
await api.member.checkoutPlan({
plan
plan,
metadata: {
checkoutType: 'upgrade'
}
});
} catch (e) {
return {