bro i see the effort you put in with the terminal, powershell, scoop, etc. I used to do this a long time back. Then I switched to Ubuntu (Linux distro). Trust me life is so much easier and would recommend you too. You won't regret it.
Thank you very much bro, I had a lot of questions about how to handle the customers and orders data after the payment but didn't find out anywhere with an explanation of that process, you left it very clear for me :)
Thank you so much bro for your effort. I am trying implement stripe payment with webhooks through stripe doc but I not properly understand that in last two day. Now your video clear my concept. ❤from India.
Thank you soo much the videos, I was looking for integrating stripe to a website, it helped a lot. Quick tip for viewers it's ok for the tution purpose but in production check the product price in server side.
The error occurred because you placed the route handler after calling a body parsing middleware. So to fix that, just cut it and paste it before calling a body parser.
Thank you for this video! I do have a question- how do we create orders from customers who are not logged in? Then we won't have a userId to pass to create a customer through Stripe. Thanks!
Help please I have a problem with constructEvent it shows me an error No signatures found that match the expected signature for the payload. Are you forwarding the raw request body you received from Stripe? And I collected express.raw({ type: '*/*' })
I have to integrate stripe in my application. Apart from the "checkout.session.completed" event, is there any other key event that I must need to handle and could you please elaborate the events a bit more, like which one is a must to handle.
You can create a pending transaction on your backend, you need to specify transaction 'id' it could be uuid() and pass as many items as you want in there, really the limit at this point is your db. Then, you pass that 'transaction id' into your payment intent as metadata. When you receive your webhook with "checkout.session.completed", you parse that metadata and grab your transaction id from it. Then, run a function to update that transaction on your backend from pending to success. Likewise in case of error, you can delete that transaction or write a script which will be deleting all pending transactions once they are 1day old or something. That way you can avoid transferring cart items back and forth and dealing with 500 character limit.
you can try modifying this const body = request.rawBody.toString(); instead of parsing the whole request body then call the body in the event function instaed of req.body
about the Webhook error i found this to be working for me : const payload = req.body; const payloadString = JSON.stringify(payload, null, 2); const header = stripe.webhooks.generateTestHeaderString({ payload: payloadString, secret: ENDPOINT_SECRET as string, }); let event; try { event = stripe.webhooks.constructEvent(payloadString, header, ENDPOINT_SECRET as string); console.log(`Webhook Verified: `, event); } catch (err) { console.log(`Webhook Error: ${(err as Error).message}`); res.status(400).send(`Webhook Error: ${(err as Error).message}`); return; } // Handle event types ....
bro i see the effort you put in with the terminal, powershell, scoop, etc. I used to do this a long time back. Then I switched to Ubuntu (Linux distro). Trust me life is so much easier and would recommend you too. You won't regret it.
Thanks bro
Thank you very much bro, I had a lot of questions about how to handle the customers and orders data after the payment but didn't find out anywhere with an explanation of that process, you left it very clear for me :)
Thank you so much bro for your effort. I am trying implement stripe payment with webhooks through stripe doc but I not properly understand that in last two day. Now your video clear my concept. ❤from India.
Thank you soo much the videos, I was looking for integrating stripe to a website, it helped a lot. Quick tip for viewers it's ok for the tution purpose but in production check the product price in server side.
The error occurred because you placed the route handler after calling a body parsing middleware. So to fix that, just cut it and paste it before calling a body parser.
Thank you so much, you saved me!
@@jacerchetoui709 where? tell me
you hero. I've been stuck for hours on this issue. you saved me!
Thank you again sir! very helpful tutorial, it's a miracle I came right into your videos. You are a great teacher!
for an entire video I thought my right earphone is gone, then suddenly music played, LOL :)
Thank you, you help me a lot. please keep going.
Thank you very much! This was so helpful! Easy to understand! Thank you very much again! ❣
Thank you for this video! I do have a question- how do we create orders from customers who are not logged in? Then we won't have a userId to pass to create a customer through Stripe. Thanks!
So before checkout redirect user to login page so then you will always have user I'd
Quick tip you should make your microphone on both left and right channels instead of just the left
could you please implement a frontend for the user order details
You are good bro. It is helpful thanks.
15:20 I was able to verify the endpoint by adding these lines:
app.use('/api/stripe/webhook', express.raw({ type: 'application/json' })); //
Life saver.
Thank you for new earphones , After listening to your video i found one side of it not working , purchased new ❤ thanks
Help please I have a problem with constructEvent it shows me an error No signatures found that match the expected signature for the payload. Are you forwarding the raw request body you received from Stripe? And I collected express.raw({ type: '*/*' })
I have to integrate stripe in my application. Apart from the "checkout.session.completed" event, is there any other key event that I must need to handle and could you please elaborate the events a bit more, like which one is a must to handle.
Exactly that's what i wantedddddddd....
if my stripe listener not in running mode at the the web hook endpoint run automatically by stripe?
The size of the metadata is a problem..do you have any alternatives?
You can create a pending transaction on your backend, you need to specify transaction 'id' it could be uuid() and pass as many items as you want in there, really the limit at this point is your db. Then, you pass that 'transaction id' into your payment intent as metadata. When you receive your webhook with "checkout.session.completed", you parse that metadata and grab your transaction id from it. Then, run a function to update that transaction on your backend from pending to success. Likewise in case of error, you can delete that transaction or write a script which will be deleting all pending transactions once they are 1day old or something.
That way you can avoid transferring cart items back and forth and dealing with 500 character limit.
Hello, Thanks for amazing tutorial. Do you have github link for this project.?
Thanks for the Tutorial Charles
you can try modifying this const body = request.rawBody.toString(); instead of parsing the whole request body then call the body in the event function instaed of req.body
You are a really good teacher. Thank you❤
This is the best tutorial. Can i build a fintech app using stripe apis?
Hi, I need some help with stripe payment, can I contact you privately somehow?
i get error if i add multiple products in my cart, error is that we can not add more than 500 characters in metadata, how do i handle that?
Hey, proceed with the course the solutions to metadata I included in the React Dashboard video..
Currently you can set the cart to be an empty array and order model at products you set it to just array without specifying the properties..
@@ChaooCharles cool! i'll check that video
thanks for your content bro..iam happy and subscribed
Thank you for the content. I hope to see more amazing contents like this.
Nice video, be aware that stripe metadata key value object has per key size limit, could be an issue for large amount of cart items use case.
Do you find any alternatives?
I have question this endpoint secret in webhook should be inside .env or its okay
if you deploying it live then better to keep it in the env. If you just playing around in your sandbox, do whatever you want
bro Thank you so much... Very good Detailed video and Easy To Understand 🫡
Expecting login using gmail, facebook, Instagram using react
it throws error when i pass cartItems inside metadata while creating a customer.
Yeah, pass an empty array.. in the next videos we are using an alternative
Can you post the source code?
is there a way to collect global payments from Kenya as we cannot access stripe here?
Someone have idea how to show customers orders?
i am getting paymentIntentId null
Thank you so much
Thank you so much!!!
Thanks
greate video again!
Thank you!
mern stack app with typeScript nextjs graphql
Do you not see? Read it “For local dev” …
about the Webhook error i found this to be working for me :
const payload = req.body;
const payloadString = JSON.stringify(payload, null, 2);
const header = stripe.webhooks.generateTestHeaderString({
payload: payloadString,
secret: ENDPOINT_SECRET as string,
});
let event;
try {
event = stripe.webhooks.constructEvent(payloadString, header, ENDPOINT_SECRET as string);
console.log(`Webhook Verified: `, event);
} catch (err) {
console.log(`Webhook Error: ${(err as Error).message}`);
res.status(400).send(`Webhook Error: ${(err as Error).message}`);
return;
}
// Handle event types ....
Hey, thank you for sharing
@@ChaooCharles keep up the good work, you're doing great man
Nice one! This solved it for me, thank you
thanks mate!
TE AMO
Do you all hear any sound?
I got the issue resolved by using the middleware app.use('/webhook', express.raw({type: '*/*'})) and removed the middleware from the post router