Generation

fix invalid codeTue, 20 Dec 2022

if (cartErrors) { res.status(409).json({message: 'there is an error !!'}) return } const handleCheckout = async () => { const stripe = await getStripe() try { const response = await fetch('/api/stripe', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(cartItems), }) const data = await response.json() stripe.redirectToCheckout({sessionId: data.id}) } catch (error) { console.log(error) } }

Questions about programming?Chat with your personal AI assistant