Processing payments in NextJs using the Stripe API. ➡️ The Ultimate NextJs Course 🔗 www.hamedbahram.io/courses/ne...
Пікірлер: 63
@RayTawil-en1ws Жыл бұрын
Well done! Great breakdown of the process and clean code organization.
@hamedbahram Жыл бұрын
Thank you!
@pablofernandezruiz80242 ай бұрын
Hey Hamed thank you for this tutorial, I'm looking for a tutorial that covers subscriptions. I can't find a good video that explains it as detailed and organized as you do. Please do consider making one about integrating subscriptions! It would be greatly appreciated, even if it's paid, I bought your NextJS 14 course and it's awesome 😄
@hamedbahram2 ай бұрын
Hey Pablo! For sure, I'll work on it. Glad to hear you liked the course.
@user-pe4wq2dv7q Жыл бұрын
Nice video, the way how you explain is clear as well 👍
@hamedbahram Жыл бұрын
Thanks you!
@tajwarsaiyeedabid9 ай бұрын
Thank you. I had a problem in stripe Checkout payment intent. By completing your video i have solve my problem. Thank you again.
@hamedbahram9 ай бұрын
Great to hear that! Happy to help.
@jackhump7676 Жыл бұрын
thanks for your response I'm looking forward to going through the code😊
@hamedbahram Жыл бұрын
Hey Jack, did you have a chance to look at the code? was it helpful?
@jaykhan_sound Жыл бұрын
Great video, much appreciated!
@hamedbahram Жыл бұрын
Anytime! Thanks for tuning in Jay.
@Backlink_SEO11 ай бұрын
This is really good tutorial, Thanks for sharing.
@hamedbahram11 ай бұрын
Thank you. Glad you liked it.
@RaulReyesOnline2 ай бұрын
Thank you for the great tutorial, do you have an updated course or online tutorial that explains Nextjs and Stripe integración further? Like self hosted checkout, etc
@hamedbahram2 ай бұрын
My pleasure! No I don't, but that's a great idea :) I may create one.
@ledoublez11 ай бұрын
Hey, it would really be interesting to add authentication to your app! Maybe also an order history for each user. Great video!
@hamedbahram11 ай бұрын
Great suggestions! I appreciate your comment.
@jesusavila4306 Жыл бұрын
Hi, very helpful, thanks man😄
@hamedbahram Жыл бұрын
Any time!
@edirodriguezsantillana Жыл бұрын
Thanks for the great video
@hamedbahram Жыл бұрын
Glad you enjoyed it Edilberto, and welcome to the channel.
@8drapbeats873 Жыл бұрын
Thanks for video! Im using Auth0, how can i actually recognize and make some others actions such as add 'virtual funds' to logged user that paid? (How can I recognize logged user with his payment)?
@hamedbahram Жыл бұрын
Stripe returns the `sessionId` back to your success URL (once the user completes the payment), you can use the `sessionId` to retrieve the session from Stripe; on the session object you can see the customer details on `customer_details` field. You can then use the customer's email to connect it to the logged in user in Auth0.
@daviswalker50679 ай бұрын
Can you make a video about stripe elements?
@hamedbahram9 ай бұрын
Can you expand on what you like to see in that video?
@HigherStudyAspirant3 ай бұрын
Thank you. can we integrate our own html, css checkout page. I have seen many videos but didn't find any where they have integrated their own checkout page rather pre-build checkout page is used
@hamedbahram3 ай бұрын
Hmm 🤔 yes you can build a custom checkout page and use Stripe APIs to power the functionality. I'll have that in mind for future videos.
@HigherStudyAspirant3 ай бұрын
thanks, will be waiting...@@hamedbahram
@nogafouz21743 ай бұрын
thanks alot well done but i have a question how can use payxpert instead od strip ?
@hamedbahram3 ай бұрын
I haven't used that yet.
@berendvanbeerschot147211 ай бұрын
I really like your way of working and explaining. Is it safe to use your stripe secret key in your client side code?
@hamedbahram11 ай бұрын
Thanks Berend. Your stripe secret key is for server side use only, you can use the publishable key on the client side.
@mahesh-waghmare Жыл бұрын
So, support I want to use the NextAuth In which I allowed user to authenticate with Google. And used the database MongoDb to store the information of authenticated user. Then after successful checkout I need to store the session id into the MongoDb user details. And when user again login then based on stored sessions I can fetch his/her subscriptions from the Stripe right? Is this the right way to connect Stripe + MongoDb + NextAuth on NextJs?
@hamedbahram Жыл бұрын
Absolutely! That'll be a good work flow. Alternatively you can write the subscription details on the user record, so you don't have to hit Stripe API every time.
@hovivianwy Жыл бұрын
hi, your video has helped me greatly! may i ask how would i implement auto-pagination and Search query language (a search bar to search products) using your approach in this video? ive read through the stripe docs but couldn't fit those functions in my website
@hovivianwy Жыл бұрын
also, id like to know why you used {data: prices} to request the products instead of "products"? thank you
@hamedbahram Жыл бұрын
Welcome to the channel Vivian. Good question, how many products do you have?
@hovivianwy Жыл бұрын
@@hamedbahram hi Hamed, since this is just a project of mine, i only have 30ish products, i was thinking maybe i could paginate my products into 3 pages, so 12 products on each page. not sure if this is feasible. thanks
@hamedbahram Жыл бұрын
@@hovivianwy for sure. It's definitely doable, since there are only 30 products, you can fetch all and paginate in your state, or use something like SWR and fetch client-side. For search, we can either use the text search in stripe or something like algolia. Let me give it some thought and see what's the best way to do this.
@hovivianwy Жыл бұрын
@@hamedbahram thanks for your advice, i'll let you know how it goes!
@p_nik Жыл бұрын
very helpful! How can I make it so I can add the same product multiple times in the cart? to update the quantity thanks!
@hamedbahram Жыл бұрын
Welcome to the channel Panos! you can add `quantity` to your `items` state or `cart` context and when calling the checkout method you can pass a quantity to Stripe. If you go to the `lib/checkout.js` file on my source code, you'll see that I'm adding the `quantity: 1` to my lineItems. Let me know if that makes sense.
@p_nik Жыл бұрын
@@hamedbahram thanks for the very fast reply, I am struggling to figure it out though. Could you please provide some sort of example? Thanks again
@hamedbahram Жыл бұрын
@@p_nik I'll try to cover it in my next Stripe API tutorial. But from a high level when you're creating a Stripe checkout session you can pass quantity for each line item, how you are managing you quantity state depends on your app, but at the end you want to pass that quantity to Stripe.
@p_nik Жыл бұрын
@@hamedbahram thank you! I managed to do it eventually!
@hamedbahram Жыл бұрын
@@p_nik Ok great! glad it worked out.
@jackhump7676 Жыл бұрын
looks good just what I'm after but any chance of seeing all the code
@hamedbahram Жыл бұрын
Thanks for watching Jack! you check out the code on the following repo: github.com/hamedbahram/stripe-payment
@codewithfarhad8594 Жыл бұрын
when I go and type import "Stripe" from stripe; my nextjs can't resolve this module. I have triple checked my pkg json and all the pkgs you installed are there. so I don't know what's going on. any idea how to fix this?
@hamedbahram Жыл бұрын
If you've correctly installed the 'stripe' package, there shouldn't be a problem, can you tell me what error you're getting? Just keep in mind that the 'stripe' package is for the server side only and the '@stripe/stripe-js' is for the client side code.
@codewithfarhad8594 Жыл бұрын
@@hamedbahram thanks bro. I fixed it. I was mistakenly calling GetServerSideProps in a component instead of Pages so I was getting undefined and all the other errors. thanks for this great video 👏👏
@clipartinc Жыл бұрын
where do you include your publishableKey?
@hamedbahram Жыл бұрын
PublishableKey is for use with the `stripe-js` client-side package; You can define an environment variable in your `.env.local` file and prefix the variable name with `NEXT_PUBLIC_` so that it's accessible in your front end code.
@clipartinc Жыл бұрын
@@hamedbahram Thanks, but, I was really asking him where he included his publishableKey in his code. I see it now though 11:43
@juanroman3289Ай бұрын
How to develop the refund api
@hamedbahramАй бұрын
That makes a great topic for another video.
@juanroman3289Ай бұрын
@@hamedbahram please do it.
@rishikeshkumarsharma350411 ай бұрын
great video man 🐐 , can i get source code ?
@hamedbahram11 ай бұрын
Thanks Rishikesh. Here is the link to the source code: github.com/HamedBahram/stripe-payment You might also like this video I did on pagination and search in Stripe: kzbin.info/www/bejne/qX7Fl6Sjn95pm5I