Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

added name and address by auto

RajuGangitla8b7b8ec84bc0
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts
index 6920cc327b..e262df1fa2 100644
--- a/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts
+++ b/apps/web/app/api/workspaces/[idOrSlug]/billing/upgrade/route.ts
@@ -58,7 +58,18 @@ export const POST = withWorkspace(async ({ req, workspace, session }) => {
} else {
// For both new users and users with canceled subscriptions
const stripeSession = await stripe.checkout.sessions.create({
- ...(workspace.stripeId ? { customer: workspace.stripeId } : { customer_email: session.user.email }),
+ ...(workspace.stripeId
+ ? {
+ customer: workspace.stripeId,
+ customer_update: {
+ name: 'auto',
+ address: 'auto',
+ },
+ }
+ : {
+ customer_email: session.user.email
+ }
+ ),
billing_address_collection: "required",
success_url: `${APP_DOMAIN}/${workspace.slug}?${onboarding ? "onboarded" : "upgraded"}=true&plan=${plan}&period=${period}`,
cancel_url: baseUrl,