Next.js Discord

Discord Forum

Stripe usecase integration in Next.js 13.4.4 & TypeScript 5.0.4

Unanswered
English Angora posted this in #help-forum
Open in Discord
English AngoraOP
Dear community,

After struggling with this for days. I am here to ask for any form of help regarding checkout, webhooks, and in general the integration of Stripe in Next.js - 13.4.4 & TypeScript - 5.0.4.

The current use case I have: A basic form when submitted, a post request is sent to the database with the form values. The hopeful use case should be: There should be a checkout and if successful, the post request is being made.

Has someone met the same issue regarding the integration of this? I have been struggling with this for days, watching so many YouTube tutorials, and looking through Github repos without concrete success. I am clue less at this point.

Please let me know if this isn't or is correct. I think I have to create a 'checkout' and a webhook trigger of checkout.session.completed that calls a function where-in the form values are being posted to the database. Please let me know if this should be the correct way.

I would love to receive anything that could bring me a bit closer.

Thank you in advance.

Best regards.

Paddy

18 Replies

Sun bear
did you ever get an answer to this?
Im having issues myself
Beagle
Facing same issue
does Strip have a tech support?
indeed they have a Discord server.
i just checked, found some discussion abt webhook and Next.js there.
Sun bear
if you still haven't figured it out, I have
Isn’t it as easy as creating a stripe webhook handler listen for all possible events and invoke a function based on the event?
And after form submission you will be redirected to the checkout page.. you could create a checkout session using the sdk
Sun bear
@DennisK yeah its pretty self explanatory, the routing can get a lil confusing and its also not fully testable over http
@Sun bear if you still haven't figured it out, I have
West African Lion
could you explain a little more, or point us towards a good guide you might have used?
Sun bear
yeah i can link the stripe docs, and also show you my routes
thats a working checkout section
the webhook gave me an issue for some reason but it looks fine .. ill show you it
Sun bear
if you go to to the stripe api docs its fairly straightforward
i had set this up in Laravel before i found out the person i was doin the project for wasnt gonna pay for the hosting for it so I decidd to use Nextjs