From bcfd57c953b9ceae08bd5c98c709f87bcb4be346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20M=C3=BCller?= <48084558+rene-mueller@users.noreply.github.com> Date: Mon, 5 Dec 2022 21:02:59 +0100 Subject: [PATCH] Bugfix/payment options (#5805) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * removed locale to use automatic detection in teams/lib/payments.ts * removed payment_method_types to manage payment methods in the Dashboard * added customer_update and automatic_tax to apply tax rates to payments * added allow_promotion_codes to allow promotion codes * removed multiple usages of `allow_promotion_codes` in payments.ts Co-authored-by: René Müller Co-authored-by: Peer Richelsen Co-authored-by: alannnc --- packages/features/ee/teams/lib/payments.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/features/ee/teams/lib/payments.ts b/packages/features/ee/teams/lib/payments.ts index b0d164be83..2df29ff18e 100644 --- a/packages/features/ee/teams/lib/payments.ts +++ b/packages/features/ee/teams/lib/payments.ts @@ -31,7 +31,6 @@ export const purchaseTeamSubscription = async (input: { teamId: number; seats: n allow_promotion_codes: true, success_url: `${WEBAPP_URL}/api/teams/${teamId}/upgrade?session_id={CHECKOUT_SESSION_ID}`, cancel_url: `${WEBAPP_URL}/settings/profile`, - locale: "en", line_items: [ { /** We only need to set the base price and we can upsell it directly on Stripe's checkout */ @@ -39,10 +38,15 @@ export const purchaseTeamSubscription = async (input: { teamId: number; seats: n quantity: seats, }, ], + customer_update: { + address: "auto", + }, + automatic_tax: { + enabled: true, + }, metadata: { teamId, }, - payment_method_types: ["card"], subscription_data: { metadata: { teamId,