Orders handling with Stripe Webhooks and Firebase Cloud Functions!

Поделиться
HTML-код
  • Опубликовано: 8 апр 2021
  • After your Stripe payment, receive a webhook to your Firebase Cloud Function and store the information in Firebase Firestore.
    For more Firebase tutorials or Stripe tutorials, make sure you hit the like button and subscribe to the channel!
    GitHub repository: github.com/EnterFlash/firebas...
    First part Stripe video (Receive payments with Stripe): • Receive payments with ...
    Follow me on Twitter: / elilopezdev
    #EnterFlash #Firebase #Stripe

Комментарии • 65

  • @elilopezdev
    @elilopezdev  2 года назад +1

    Learn how to receive subscriptions with Stripe Checkout, Firebase 9 and Vue.js 3! 🔥🔥 ruclips.net/video/KiEgUp91ejc/видео.html

  • @KyleBondo
    @KyleBondo Год назад +5

    I think what this video FINALLY taught me is that Stripe requires TWO secret keys to make the connection. It's like having a Storage Unit. You need an account key to get through the gate and onto the property. Then you need a storage unit door key to unlock the door. Nobody tells you that you need BOTH keys to make a webhook work. But... now I know... and knowing is half the battle! Thank you - Cheers!

  • @danishajaib1516
    @danishajaib1516 Год назад +2

    Eli, you're a legend. You've finally helped integrate stripe with flutter successfully. I would appreciate a video on the security rules. Keep up the good work.

  • @lukamilos1909
    @lukamilos1909 Год назад +2

    I cannot express how grateful I am that you made this tutorial

  • @rubenco1253
    @rubenco1253 3 года назад +3

    Eli you legend, thank you for this easy to follow and clear tutorial, keep it up man! :)
    I definitely subbed!

    • @elilopezdev
      @elilopezdev  3 года назад

      Glad it was helpful, thanks a lot!

  • @r.s.e.9846
    @r.s.e.9846 Год назад +1

    Mr. Lopez, many thanks for this!

  • @omarsaas
    @omarsaas 3 года назад +2

    Your video is great and very simple to understand, Thank you very much !

    • @elilopezdev
      @elilopezdev  3 года назад

      I appreciate it very much. Thank you!!

  • @ev-olution8597
    @ev-olution8597 6 месяцев назад

    Thanks! This helped a lot in my project.

  • @joe-vanderveen5423
    @joe-vanderveen5423 2 года назад +1

    Great Video!

  • @deepakk6092
    @deepakk6092 2 года назад

    Wonderful content. Please create more payment related content.

  • @saricden
    @saricden 3 года назад

    Great video bro :)
    Would love to see the follow-up w/ Vue.js!

  • @discontinuity
    @discontinuity 2 года назад +2

    Love the vid, would like to see how you setup the security rules, I really dont get those.

  • @nat.serrano
    @nat.serrano 2 года назад +1

    very very useful video for ios devs!

  • @elilopezdev
    @elilopezdev  3 года назад +1

    First part about Stripe Checkout with Firebase Functions🔥: ruclips.net/video/L_ADtp1tWPA/видео.html

  • @ExtraServingsBTS
    @ExtraServingsBTS 3 года назад +1

    good stuff. subscribed!

    • @elilopezdev
      @elilopezdev  3 года назад +1

      Glad it was helpful!

    • @ExtraServingsBTS
      @ExtraServingsBTS 3 года назад +1

      @@elilopezdev got a video on connect onboarding using express accounts? ;).

    • @elilopezdev
      @elilopezdev  3 года назад

      @@ExtraServingsBTS Not yet! But I've used Express Connect before so surely expect it later 😀

    • @ExtraServingsBTS
      @ExtraServingsBTS 3 года назад +1

      @@elilopezdev it's going pretty well, maybe my vid will come out first ;)

  • @MusicbyAnt
    @MusicbyAnt Месяц назад

    hey Eli, i knwo thixs video was posted a long time ago, but im using it as a base for now :) its very helpful. Would you happent o know what to do when you get this error: Error processing webhook: Error: Cannot find module 'strip

  • @mnc12004
    @mnc12004 Год назад

    Pretty nice mate. How do we associate the checkout session to a logged in user? Essential for a payment system I would think.

    • @mnc12004
      @mnc12004 Год назад

      I'm asking because it's not clear in the docs and no it doesn't FFSCNT!

  • @alant7615
    @alant7615 3 года назад

    I'm looking forward your firestore's rule video

  • @GarthFransman
    @GarthFransman 5 месяцев назад

    Hi . Great video . Is there a tut on how to achieve this with WP WooCommerce as well ?

  • @LumbricusVII
    @LumbricusVII 3 года назад +2

    Good video! One thing, in the video you didn't return OK after the function completed successfully. This will lead to stripe resending the request wich will lead to multiple entries in the database. I can see that you return 200 on github but if someone follows just the video it can lead to some unwanted result.

    • @elilopezdev
      @elilopezdev  3 года назад +2

      Completely missed it, I will be re-uploading this one. Thanks a lot!

  • @user-vk1cp3lx2k
    @user-vk1cp3lx2k 3 года назад +1

    Hey man, I never comment on youtube videos, but I felt like I should thank you for the great video.
    I do have a question however.I am passing certain data regarding products from the front end to the checkout session through the data options in the callable cloud function.
    Is there a way to then pass that data from the checkout session function to stripe,so that the webhook request contains it,and I can therefore use it in the order handling function?

    • @elilopezdev
      @elilopezdev  3 года назад +1

      Thanks a lot I appreciate it!
      And sure, when you create the checkout session in the cloud function, you can pass data using the object's "metadata", which is a key-pair object at the same level as the line_items. Then, your webhook will contain this info in the metadata as well.
      Check out the docs for more info 😌: stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata

    • @user-vk1cp3lx2k
      @user-vk1cp3lx2k 3 года назад +1

      @@elilopezdev wtf it was that simple...i didnt stumble on to this documentation and ive been looking for 5-6 hrs.Thanks a lot for the quick answer I really appreciate it.

    • @huzaifahattah6481
      @huzaifahattah6481 2 года назад

      @@elilopezdev Hi, Lopez. Great tutorial. I have the same issue, but I have passed the metadata in the checkout function and I am not getting it in the webhook function

    • @elilopezdev
      @elilopezdev  2 года назад

      @@huzaifahattah6481 Check if you get any error logs in the Stripe Dashboard Webhooks section. Also, triple check that the metadata is a key-pair object. If it's not, or if the values are too long, the metadata is going to be null.
      Example:
      "metadata": {
      "order_id": "6735"
      },

    • @huzaifahattah6481
      @huzaifahattah6481 2 года назад +1

      @@elilopezdev Works now, thanks for this reply. I was rather parsing it as key-value pair.

  • @jsfhzlrvr
    @jsfhzlrvr Год назад +2

    Where can I find the stripe token ?

  • @reeteshsuggula8828
    @reeteshsuggula8828 3 года назад

    hey can you do a video on CORS handling after deployment for the above project @EliLOpez

  • @ismaelyassin8882
    @ismaelyassin8882 Год назад

    Is using both return value from stripe and updating my backend + using webhooks as a redundant a good solution?

  • @eman7139
    @eman7139 2 года назад

    i'm following the video same as it is but still i cant get the stripe signature in the headers which is giving an error. Please help

  • @chbb9027
    @chbb9027 3 года назад +3

    It seems like now you have to pay to use Firebase Cloud Functions... Was it free when you did this video?

    • @elilopezdev
      @elilopezdev  3 года назад

      Hello! Although you need to be in the Blaze plan to use Functions, they still have a pretty generous Free Tier (with up to 2M invocations a month atm). They only charge you for container storage but price is super low.
      Check out Firebase Pricing Page for updated details 😊: firebase.google.com/pricing

    • @worldclasscode1847
      @worldclasscode1847 2 года назад

      I use firebase cloud functions. very comfortable. Yes, you pay. But it s worth it :)

  • @Dhanushsaji
    @Dhanushsaji Год назад

    I'm using MongoDB as the database. When I use stripe CLI it's working fine, but after deploying the backend and then giving the endpoint in the webhook it's not working. Do u have any idea about this?
    Thank you

  • @manojisaac
    @manojisaac 3 года назад +1

    How about the previously saved shipping address?? we have to give user option to copyy from old address to improve user experience..rt

    • @elilopezdev
      @elilopezdev  3 года назад

      At this moment Stripe doesn't offer an option to pre-fill address. However, what I've done in the past is to put the UUID of the selected address in the metadata when creating the Checkout session. That way, the webhook you receive from Stripe once the order is completed will contain the shipping address selected. 🙂

  • @manny8816
    @manny8816 Год назад

    I have no URLs in my firebase functions dashboard? how do i get them in the first place?

  • @jajasaria
    @jajasaria 2 года назад

    is it safe to use the client-side instead of webhook? my plan is when there's no error under client then submit a set of collection to firebase server. what do you think ?

    • @antoineweb1
      @antoineweb1 Год назад

      no, client-side cannot be trusted

  • @DonteTrumble
    @DonteTrumble 3 года назад +1

    I don't know what I'm doing wrong but for some reason I get a 500 error when I test the webhook (Error: could not handle the request). I go and check my firebase cloud function log all it says is 'crash'. Anybody experience this?

    • @DonteTrumble
      @DonteTrumble 3 года назад

      I fixed my problem. I forgot to add the stripe package to my functions package.json and npm install it.

  • @user-oz8uj4bq7c
    @user-oz8uj4bq7c 3 года назад

    Hello, I hope you're fine and safe, please I have a question :
    I'm using scheduled functions in firebase, and this is the price : Each Cloud Scheduler job costs $0.10 (USD) per month, and there is an allowance of three free jobs per Google account.
    For example this is a scheduled firebase function :
    exports.pushDataEveryMinute = functions.pubsub.schedule('21 16 13 04 02').onRun((context)=> { database.ref("metadata/lastUpdate/").set("OFF"); return null; });

    To do tests on the scheduled functions, and then I delete it, does that also count?
    Do I have the right to just 3 executions of 'firebase deploy' ? (I am using node js)
    Or I this function should be running all the month to count ?
    Thank you

  • @zakblacki
    @zakblacki 2 года назад +1

    how to link a user id with the payment in firestore (example VIP subscription update user role)

    • @elilopezdev
      @elilopezdev  2 года назад +1

      I'm editing a video on exactly this and some other questions I've had asked like creating a shopping cart. I'll upload this Wednesday. Thanks for commenting! 😊😊

    • @zakblacki
      @zakblacki 2 года назад +1

      @@elilopezdev Thank you if possible if you know how to link this with flutter app that would be even great !

    • @elilopezdev
      @elilopezdev  2 года назад +1

      @@zakblacki Sure! I've been wanting to make a tutorial on Flutter + Firebase. Glad to know you're interested. 😮

    • @zakblacki
      @zakblacki 2 года назад

      @@elilopezdev I'm waiting bro

    • @worldclasscode1847
      @worldclasscode1847 2 года назад +2

      I use metadate for my user id, i send it to Stripe, and I get it back when user completet payment, with a webhook i have in firebase cloud functions :)

  • @emersonsmithperu
    @emersonsmithperu 2 года назад +1

    Err req.body empty use clud functions requestt http