How I setup stripe in my Next.js side project

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

КОМЕНТАРІ • 48

  • @naman_dw
    @naman_dw Рік тому +8

    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

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

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

  • @diemantrabeats7551
    @diemantrabeats7551 Рік тому +3

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

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

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

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

    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

  • @EFTOBEATZ
    @EFTOBEATZ 4 місяці тому

    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

  • @discusstime
    @discusstime 10 місяців тому

    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  10 місяців тому

      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?

  • @SeibertSwirl
    @SeibertSwirl Рік тому +7

    Good job babe!!!!

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

    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  5 місяців тому

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

  • @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

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

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

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

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

  • @supercrunch3367
    @supercrunch3367 Рік тому +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 Рік тому

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

  • @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 4 місяці тому

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

  • @diemantrabeats7551
    @diemantrabeats7551 Рік тому +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 Рік тому

      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  Рік тому +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

  • @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

  • @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

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

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

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

      Yeah I may just do it in typescript

  • @Lm-hu2tm
    @Lm-hu2tm 9 місяців тому

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

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

    what´s the background theme for your VSC?

  • @yasinnkhann
    @yasinnkhann Рік тому +2

    Is DynamoDB free to use?

    • @WebDevCody
      @WebDevCody  Рік тому +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

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

    Thank you so much man....

  • @Daniel-uv5nx
    @Daniel-uv5nx Рік тому

    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

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

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

    which themr are using in this vscode

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

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

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

      I started with java, but not vaadin

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

    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 10 місяців тому

    No repo on github

  • @Harish-rz4gv
    @Harish-rz4gv Рік тому

    But why paid courses??

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

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