From 69ef41b5347c08049a88a321eaf86657f62f9490 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Mon, 18 Sep 2023 18:43:30 +0200 Subject: [PATCH] :bug: (payment) Fix postalCode camel case issue Closes #822 --- packages/embeds/js/package.json | 2 +- .../blocks/inputs/payment/components/StripePaymentForm.tsx | 7 ++++--- packages/embeds/nextjs/package.json | 2 +- packages/embeds/react/package.json | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json index 48a47d343..021a7edb4 100644 --- a/packages/embeds/js/package.json +++ b/packages/embeds/js/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/js", - "version": "0.1.26", + "version": "0.1.27", "description": "Javascript library to display typebots on your website", "type": "module", "main": "dist/index.js", diff --git a/packages/embeds/js/src/features/blocks/inputs/payment/components/StripePaymentForm.tsx b/packages/embeds/js/src/features/blocks/inputs/payment/components/StripePaymentForm.tsx index 671baf9d2..caa86e87c 100644 --- a/packages/embeds/js/src/features/blocks/inputs/payment/components/StripePaymentForm.tsx +++ b/packages/embeds/js/src/features/blocks/inputs/payment/components/StripePaymentForm.tsx @@ -59,6 +59,8 @@ export const StripePaymentForm = (props: Props) => { sessionId: props.context.sessionId, typebot: props.context.typebot, }) + const { postalCode, ...address } = + props.options.additionalInformation?.address ?? {} const { error, paymentIntent } = await stripe.confirmPayment({ elements, confirmParams: { @@ -69,9 +71,8 @@ export const StripePaymentForm = (props: Props) => { email: props.options.additionalInformation?.email, phone: props.options.additionalInformation?.phoneNumber, address: { - ...props.options.additionalInformation?.address, - postal_code: - props.options.additionalInformation?.address?.postalCode, + ...address, + postal_code: postalCode, }, }, }, diff --git a/packages/embeds/nextjs/package.json b/packages/embeds/nextjs/package.json index 0973f898e..df251d1dd 100644 --- a/packages/embeds/nextjs/package.json +++ b/packages/embeds/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/nextjs", - "version": "0.1.26", + "version": "0.1.27", "description": "Convenient library to display typebots on your Next.js website", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/embeds/react/package.json b/packages/embeds/react/package.json index c26cfaf85..d6156f122 100644 --- a/packages/embeds/react/package.json +++ b/packages/embeds/react/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/react", - "version": "0.1.26", + "version": "0.1.27", "description": "Convenient library to display typebots on your React app", "main": "dist/index.js", "types": "dist/index.d.ts",