fix(integration): 🐛 Empty receipt email
This commit is contained in:
@ -58,12 +58,13 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||||||
)
|
)
|
||||||
if (isNaN(amount)) return badRequest(res)
|
if (isNaN(amount)) return badRequest(res)
|
||||||
// Create a PaymentIntent with the order amount and currency
|
// Create a PaymentIntent with the order amount and currency
|
||||||
|
const receiptEmail = parseVariables(variables)(
|
||||||
|
inputOptions.additionalInformation?.email
|
||||||
|
)
|
||||||
const paymentIntent = await stripe.paymentIntents.create({
|
const paymentIntent = await stripe.paymentIntents.create({
|
||||||
amount,
|
amount,
|
||||||
currency: inputOptions.currency,
|
currency: inputOptions.currency,
|
||||||
receipt_email: parseVariables(variables)(
|
receipt_email: receiptEmail === '' ? undefined : receiptEmail,
|
||||||
inputOptions.additionalInformation?.email
|
|
||||||
),
|
|
||||||
automatic_payment_methods: {
|
automatic_payment_methods: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user