use-shopping-cart icon indicating copy to clipboard operation
use-shopping-cart copied to clipboard

price_id not recognised by Stripe

Open timothyylim opened this issue 1 year ago • 1 comments

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?

timothyylim avatar Jul 21 '23 15:07 timothyylim

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!

dayhaysoos avatar Jul 25 '23 13:07 dayhaysoos