#kyle_heat_engineer

1 messages · Page 1 of 1 (latest)

proper tuskBOT
sour lodge
#

export const createCheckoutSession = async (
customerId: string,
priceId: string[],
mode: string,
currency: 'gbp' | 'eur',
locale: Language
) => {

const line_items = (
  await stripeClient.prices.list({
    lookup_keys: priceId,
  })
).data.map((price) => ({ price: price.id, quantity: 1 }));
  

const session = await stripeClient.checkout.sessions.create({
  customer: customerId,
  payment_method_types: ['card'],
  line_items,
  mode: mode as any,
  success_url: `${process.env.WEB_APP_ROOT_URL}/payment/success`,
  cancel_url: `${process.env.WEB_APP_ROOT_URL}/payment/failed`,
  billing_address_collection: 'required',
  automatic_tax: { enabled: true },
  customer_update: {
    address: 'auto',
  },
  currency,
  locale,
});

return session;

};

tepid thunder
#

I was not aware that that could happen with Checkout

#

Thank you, taking a look

#

Oh I think we show the Customer's default payment method in subscription mode

#

Will see if that can be disabled.

#

Is the user still able to edit the card field in Checkout?

sour lodge
#

Yeah your right. If we could disable it that would be really useful.

tepid thunder