feat: enhance Stripe integration with customer updates and billing requirements

- Added customer update fields for automatic name and address handling during subscription creation.
- Enabled billing address collection and tax ID collection for improved compliance and billing accuracy.

These changes enhance the Stripe payment process by ensuring necessary customer information is captured and managed effectively.
This commit is contained in:
Mauricio Siu
2026-04-11 00:25:07 -06:00
parent 9687ed0d83
commit 7a986e5fb3

View File

@@ -205,11 +205,13 @@ export const stripeRouter = createTRPCRouter({
mode: "subscription",
line_items: items,
...(stripeCustomerId
? { customer: stripeCustomerId }
? { customer: stripeCustomerId, customer_update: { name: "auto", address: "auto" } }
: { customer_email: owner.email }),
metadata: {
adminId: owner.id,
},
billing_address_collection: "required",
tax_id_collection: { enabled: true },
allow_promotion_codes: true,
success_url: `${WEBSITE_URL}/dashboard/settings/servers?success=true`,
cancel_url: `${WEBSITE_URL}/dashboard/settings/billing`,