I am getting this error in my backend can anyone please look at this and help me. Thank you
router.post("/event/payment", auth, async (req, res) => {
const { event, token } = req.body;
const idempontencyKey = uuidv4()
console.log(token.id);
console.log(idempontencyKey);
return stripe.customers.create({
email: token.email,
source: token.id
})
.then(customer => {
stripe.charges.create(
{
amount: event.priceOfPass * 100,
currency: 'usd',
customer: customer.id,
receipt_email: token.email,
description: `purchase of ${event.eventName} passes`,
shipping: {
name: token.card.name,
}
}, { idempontencyKey })
})
.then(result => res.status(200).json(result))
.catch(err => res.status(400).json(err))
})