use-shopping-cart
use-shopping-cart copied to clipboard
price_id not recognised by Stripe
Even though the id
and price_id
match the ones defined in the Stripe Dashboard, a successful payment results in a new 'one-off' product being created in Stripe.
const product = [
{
name: 'Test Single Ticket',
description: '',
id: 'prod_OIwl4mK9AcDPO3',
price_id: 'price_1NWKruCoph6BjxBAVl5k5od7',
price: 1000,
currency: 'USD',
},
]
Is there anything I'm missing?
Hey @timothyylim, sorry for the delayed response. Can you try submitting this data with ONLY the price id? Leave out price, currency, name etc etc.
At least exclude those things just before creating the checkout session.
There's a helper function called formatLineItems()
that actually does this for you if you pass it the cartDetails just before checkout session creation. Lemme know if that creates the results you want!