🚸 (billing) Set existing stripe customer for custom plan checkout
This commit is contained in:
@@ -65,7 +65,9 @@ export const createCustomCheckoutSession = authenticatedProcedure
|
|||||||
} as Stripe.CustomerCreateParams.TaxIdDatum)
|
} as Stripe.CustomerCreateParams.TaxIdDatum)
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
const customer = await stripe.customers.create({
|
const customer = workspace.stripeId
|
||||||
|
? await stripe.customers.retrieve(workspace.stripeId)
|
||||||
|
: await stripe.customers.create({
|
||||||
email,
|
email,
|
||||||
name: workspace.claimableCustomPlan.companyName ?? workspace.name,
|
name: workspace.claimableCustomPlan.companyName ?? workspace.name,
|
||||||
metadata: { workspaceId },
|
metadata: { workspaceId },
|
||||||
|
|||||||
Reference in New Issue
Block a user