shvz
TTCTheo's Typesafe Cult
•Created by shvz on 8/28/2023 in #questions
mutateAsync()
hey, I'm running into an issue where I can't figure out my way,
I have a hook I use in my front to pass and create a checkout to my back but I have this weird error with mutateAsynch( { priceId } ) which cannot be assign apparently
All I want is to be able to create a checkout session for any of the product I have which contain a valide strip price_id, I welcome any suggestion as I'm becoming crazy
10 replies
TTCTheo's Typesafe Cult
•Created by shvz on 8/26/2023 in #questions
Stripe how to handle multiple price_id?
Hey folks,
I've been trying for the pass 3 days with my friend GPT to implement multiple price_ID for stripe checkout but in vain, I'd be actually happy to offer you a big coffee for a deep dive on how best to implement this. My current flow is working with 1 single price_ID but it seems I'm struggeling with the mutation / trpc to pass different stripe price_id associate to specific price card in the front end
here is the current code working with 1 price_ID (my price_id) is in my .env
checkout.ts (backend)
here is my stripe.ts (use to do my prisma increment of credits from the user db)
in my frontend I have a customs hook buyCredits
I believe I understand the logic, all I need is to map through a specific price_ID either on my .env or havng an object in the code to pass this on, in reality I'm unable to get the backend to work
I'd be happy once again to compensate your time helping me
6 replies