Cancelling checkout session twice results in 'active' status

Hey! Just upgraded to v1.3.1 and ran into something weird during testing: 1. Cancel a session (after clicking upgrade) → subscription goes to "incomplete" status (makes sense) 2. Cancel session again → subscription suddenly becomes "active" ?? Is this intended or a bug? Relevant code:
const response = await stripeSubscription.upgrade({
plan: planName,
successUrl: DEFAULT_LOGIN_REDIRECT,
cancelUrl: "/pricing",
});
const response = await stripeSubscription.upgrade({
plan: planName,
successUrl: DEFAULT_LOGIN_REDIRECT,
cancelUrl: "/pricing",
});
getCheckoutSessionParams: async ({ user, plan }) => {
return {
params: {
allow_promotion_codes: true,
tax_id_collection: {
enabled: true,
},
billing_address_collection: "auto",
custom_text: {
submit: {
message: "We'll start your subscription right away",
},
},
metadata: {
userId: user.id,
email: user.email,
},
},
options: {
idempotencyKey: `sub_${user.id}_${plan.name}_${Date.now()}`,
},
};
},
getCheckoutSessionParams: async ({ user, plan }) => {
return {
params: {
allow_promotion_codes: true,
tax_id_collection: {
enabled: true,
},
billing_address_collection: "auto",
custom_text: {
submit: {
message: "We'll start your subscription right away",
},
},
metadata: {
userId: user.id,
email: user.email,
},
},
options: {
idempotencyKey: `sub_${user.id}_${plan.name}_${Date.now()}`,
},
};
},
Everything else works.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?