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.

update the stripe business profile creation

Kiran K1d2ae223fb72
diff --git a/apps/web/lib/actions/partners/onboard-partner.ts b/apps/web/lib/actions/partners/onboard-partner.ts
index 118a8f3a33..3a51599a05 100644
--- a/apps/web/lib/actions/partners/onboard-partner.ts
+++ b/apps/web/lib/actions/partners/onboard-partner.ts
@@ -37,6 +37,7 @@ export const onboardPartnerAction = authUserActionClient
email: user.email,
country,
businessType,
+ companyName,
})
: null;
diff --git a/apps/web/lib/stripe/create-connected-account.ts b/apps/web/lib/stripe/create-connected-account.ts
index 60a81ce067..63aa287f60 100644
--- a/apps/web/lib/stripe/create-connected-account.ts
+++ b/apps/web/lib/stripe/create-connected-account.ts
@@ -7,9 +7,10 @@ export const createConnectedAccount = async ({
email,
country,
businessType,
+ companyName,
}: Pick<
z.infer<typeof onboardPartnerSchema>,
- "name" | "country" | "businessType"
+ "name" | "country" | "businessType" | "companyName"
> & {
email: string;
}) => {
@@ -21,11 +22,19 @@ export const createConnectedAccount = async ({
business_type: businessType,
email,
country,
- individual: {
- first_name: firstName,
- last_name: lastName,
- email,
- },
+ ...(businessType === "individual"
+ ? {
+ individual: {
+ first_name: firstName,
+ last_name: lastName,
+ email,
+ },
+ }
+ : {
+ business_profile: {
+ name: companyName!,
+ },
+ }),
capabilities: {
transfers: {
requested: true,