Skip to content

Commit 020121f

Browse files
committed
Add back some stripe checkout fields that are mildly beneficial
1 parent 7eedfa4 commit 020121f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

web/src/app/api/stripe/buy-credits/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ export async function POST(req: NextRequest) {
185185
},
186186
],
187187
mode: 'payment',
188+
invoice_creation: { enabled: true },
189+
tax_id_collection: { enabled: true }, // optional (EU B2B)
190+
customer_update: { name: "auto", address: "auto" },
188191
success_url: `${env.NEXT_PUBLIC_CODEBUFF_APP_URL}/payment-success?session_id={CHECKOUT_SESSION_ID}&purchase=credits&amt=${credits}`,
189192
cancel_url: `${env.NEXT_PUBLIC_CODEBUFF_APP_URL}/usage?purchase_canceled=true`,
190193
metadata: {

web/src/app/api/stripe/create-subscription/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ export async function POST(req: NextRequest) {
7272
const checkoutSession = await stripeServer.checkout.sessions.create({
7373
customer: user.stripe_customer_id,
7474
mode: 'subscription',
75+
tax_id_collection: { enabled: true }, // optional (EU B2B)
76+
customer_update: { name: "auto", address: "auto" },
7577
line_items: [{ price: priceId, quantity: 1 }],
7678
allow_promotion_codes: true,
7779
success_url: `${env.NEXT_PUBLIC_CODEBUFF_APP_URL}/profile?tab=usage&subscription_success=true`,

0 commit comments

Comments
 (0)