Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

price_id not recognised by Stripe #331

Open
timothyylim opened this issue Jul 21, 2023 · 1 comment
Open

price_id not recognised by Stripe #331

timothyylim opened this issue Jul 21, 2023 · 1 comment

Comments

@timothyylim
Copy link

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?

@dayhaysoos
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants