From 797ff1892d43c383a07970436d92eea51b1868f5 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Tue, 31 May 2022 08:24:07 +0200 Subject: [PATCH] =?UTF-8?q?fix(integration):=20=F0=9F=90=9B=20Payment=20re?= =?UTF-8?q?ceipt=20email=20parsing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/api/integrations/stripe/createPaymentIntent.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/viewer/pages/api/integrations/stripe/createPaymentIntent.ts b/apps/viewer/pages/api/integrations/stripe/createPaymentIntent.ts index 308f1b273..54ee530b2 100644 --- a/apps/viewer/pages/api/integrations/stripe/createPaymentIntent.ts +++ b/apps/viewer/pages/api/integrations/stripe/createPaymentIntent.ts @@ -53,7 +53,6 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { : stripeKeys.live.secretKey, { apiVersion: '2020-08-27' } ) - console.log(variables, inputOptions) const amount = Math.round( Number(parseVariables(variables)(inputOptions.amount)) * 100 ) @@ -62,7 +61,9 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { const paymentIntent = await stripe.paymentIntents.create({ amount, currency: inputOptions.currency, - receipt_email: inputOptions.additionalInformation?.email, + receipt_email: parseVariables(variables)( + inputOptions.additionalInformation?.email + ), automatic_payment_methods: { enabled: true, },