How I setup stripe in my Next.js side project

Поділитися
Вставка
  • Опубліковано 5 лют 2025
  • 💬 Discord / discord
    🔔 Newsletter newsletter.web...
    📁 GitHub github.com/web...
    📺 Twitch / webdevcody
    🤖 Website webdevcody.com
    🐦 Twitter / webdevcody

КОМЕНТАРІ • 49

  • @profitsdaily5
    @profitsdaily5 2 роки тому +2

    "The road to success and the road to failure are almost exactly the same." --Colin R. Davis

  • @carltongordon
    @carltongordon 2 роки тому +1

    Literally just told my self I need to learn how to set up stripe then boom you pop up with the magic

  • @naman_dw
    @naman_dw 2 роки тому +9

    7:14 Its a bummer that stripe SDK doesnt provide typed webhook events. You do it manually, but there is also a package called stripe-event-types that automatically types your webhooks

  • @butwhothehellknows
    @butwhothehellknows 2 роки тому +8

    Good job babe!!!!

  • @diemantrabeats7551
    @diemantrabeats7551 2 роки тому +3

    If this is a real project, I’ll sign up to the course

    • @WebDevCody
      @WebDevCody  2 роки тому +5

      yeah I do plan to make a course, just trying to plan it out a bit and find the time to record

  • @FIRATRON
    @FIRATRON 8 місяців тому

    hello I have this error can anyone help ? I created console.logs to test if there is a db instance, if the firebase configs are getting through and if the firebase App is initialized right.. :Error creating checkout session: FirebaseError: Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore

  • @diemantrabeats7551
    @diemantrabeats7551 2 роки тому +1

    It would also be dope af if the course is done in typescript

    • @WebDevCody
      @WebDevCody  2 роки тому +1

      Yeah I may just do it in typescript

  • @supercrunch3367
    @supercrunch3367 2 роки тому +2

    Can you pls do a tutorial on how you setup Yarn + React + Vite + Docker? Every tutorial out there so far seems to just result in a bunch of errors.

    • @supercrunch3367
      @supercrunch3367 2 роки тому

      Edit: Managed to make it work but I had to switch to NPM because YARN keeps throwing a yarnpkg error somehow.

  • @pushkarkathayat7893
    @pushkarkathayat7893 Рік тому

    I was trying to do this in paddle but after receiving webhook I am unable to fetch user session as there is none exist for outside request. Without session I am unable to communicate with Supabase

  • @diemantrabeats7551
    @diemantrabeats7551 2 роки тому +2

    I think even if you put the UA-cam link in an environment variable, you’ll still be able to right click the UA-cam video and copy link

    • @diemantrabeats7551
      @diemantrabeats7551 2 роки тому

      And most courses I’ve done usually just use GitHub repository with a different branch for each chapter of the course material code

    • @WebDevCody
      @WebDevCody  2 роки тому +1

      yeah I'll have to make the link something only the API knows about and will send via an authenticated api request. the ENV variable will be bundled in the UI with the approach I have now which isn't great. I'm also not sure if I want to have multiple youtube videos or just 1 giant one with chapters

  • @discusstime
    @discusstime Рік тому

    Hey, how can you set up recurring invoices that is send out every two weeks and demand a variable amount of money every two weeks?
    How can you achieve that?

    • @WebDevCody
      @WebDevCody  Рік тому

      no clue, I'd need to read the docs

  • @heyitsmikey01
    @heyitsmikey01 Рік тому +1

    What do you think about adding the stripe object to the trpc router context somewhat like prisma?

  • @HillelGarciaAustria
    @HillelGarciaAustria Рік тому

    Great video thank you! Quick question, why do we need webhooks? The stripe.checkout.sessions.create() function will redirect the user to the successfull page once the payment was done, or to the cancel page otherwise... I just dont see the use of webhooks, maybe I'm missing something here.

    • @WebDevCody
      @WebDevCody  Рік тому

      It may be possible to redirect the users to one of your api endpoints, then use the session id to grab the session from the stripe api, then use the session to lookup the metadata that associated the original user id or email to the stripe session, and then update your database. People recommend to just use the web hooks, so I can’t tell you for sure, and I can’t find in the stripe docs an example of using the success url to update your database so idk if they even recommend doing it

    • @WebDevCody
      @WebDevCody  Рік тому +4

      Actually I just found the reason. If the users internet disconnects right after they submit their credit card info, your user may never hit your success url and that means they’ll never get added as a paid user. The webhook is a direct line between stripe and your api so you’d still be able to handle the success event

  • @domi20p
    @domi20p Рік тому +1

    Great video! But I'm curious, how can you get the CHECKOUT_SESSION_ID variable and use that in your success_url, before checkout session has been created? I've been trying to achieve a similar thing, but I I'm struggling to get the checkout session id so I can use it in the success_url

    • @domi20p
      @domi20p Рік тому +1

      Nevermind, figured it out :)

    • @bmonish
      @bmonish 8 місяців тому

      @@domi20p Would you mind sharing how you did it?

  • @jamesbotwina8744
    @jamesbotwina8744 9 місяців тому

    If someone pays, couldn't they just share the email and then another person could modify the url? Then they could get it for free?

    • @WebDevCody
      @WebDevCody  9 місяців тому

      Yes of course, it’s not worth losing sleep over piracy

  • @Daniel-uv5nx
    @Daniel-uv5nx 2 роки тому

    Hey I have recently starting using the t3 stack because of your videos and I was wondering why you use a mutation on the createCheckout function (4:03) I thought mutations were for creating data. So my question is why use a mutation instead of a query?
    Love the videos man keep it up!

    • @WebDevCody
      @WebDevCody  2 роки тому +2

      Because I think it’s hitting stripe and creating a checkout session

  • @doc9939
    @doc9939 Рік тому

    Thank you so much man....

  • @ixorf8944
    @ixorf8944 2 роки тому

    Can you tell me how can i crawl for movie streaming links on different websites using node js

  • @Lm-hu2tm
    @Lm-hu2tm Рік тому

    Hey!, in your repo where can I find this one?

  • @depression_plusplus6120
    @depression_plusplus6120 Рік тому

    Kindly explain more about this successurl.
    How is this defined. Is this reactjs dom router?.. because when i use my successpage component, it does not load during production. I am jsing render

    • @WebDevCody
      @WebDevCody  Рік тому

      It’s the url the user is redirected to if they successfully pay

  • @DanteMishima
    @DanteMishima Рік тому

    Hey Cody, I'm wanted to have a look at this code, but I can't seem to find it.... Would you please share the link?

    • @WebDevCody
      @WebDevCody  Рік тому

      this code has some example stripe setup: github.com/webdevcody/icon-generator-course

    • @DanteMishima
      @DanteMishima Рік тому

      @@WebDevCody Oh , that repo...
      Alright, thank you. Let me go have a look

  • @yasinnkhann
    @yasinnkhann 2 роки тому +2

    Is DynamoDB free to use?

    • @WebDevCody
      @WebDevCody  2 роки тому +4

      It’s pay per use and super cheap if you don’t read or write much to it. No monthly fees to use it. So it’s great for a simple site with basic database needs that doesn’t get much traffic or need sql like queries

  • @amarbir22
    @amarbir22 Рік тому

    Hi Cody, I was not able to find this repo in your github. is it private ?

  • @yaffet97
    @yaffet97 Рік тому

    what´s the background theme for your VSC?

  • @tim_tmn
    @tim_tmn 2 роки тому +1

    Have you ever looked into Java Web Development? (Vaadin, ...)

    • @WebDevCody
      @WebDevCody  2 роки тому +1

      I started with java, but not vaadin

  • @dennohray
    @dennohray 2 роки тому

    which themr are using in this vscode

    • @WebDevCody
      @WebDevCody  2 роки тому

      Bearded theme stained blue

  • @naman_dw
    @naman_dw 2 роки тому

    personally I dont prefer stripe:listen for local webhooks testing. I like to use ngrok to expose my locally running webhook and then put the ngrok url in stripe webhooks dashboard. I feel its less cumbersome to set up and mirrors prod

  • @INVADE.00
    @INVADE.00 Рік тому

    No repo on github

  • @Harish-rz4gv
    @Harish-rz4gv 2 роки тому

    But why paid courses??

    • @WebDevCody
      @WebDevCody  2 роки тому +4

      Capitalism, hit me up on discord and I’ll give you a free link if I end up making this course