Orders handling with Stripe Webhooks and Firebase Cloud Functions!

  Рет қаралды 22,510

Eli Lopez

Eli Lopez

3 жыл бұрын

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 жыл бұрын
Learn how to receive subscriptions with Stripe Checkout, Firebase 9 and Vue.js 3! 🔥🔥 kzbin.info/www/bejne/gZqomIimbpaYoMU
@KyleBondo
@KyleBondo 10 ай бұрын
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!
@lukamilos1909
@lukamilos1909 Жыл бұрын
I cannot express how grateful I am that you made this tutorial
@danishajaib1516
@danishajaib1516 Жыл бұрын
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.
@rubenco1253
@rubenco1253 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 Жыл бұрын
Mr. Lopez, many thanks for this!
@ev-olution8597
@ev-olution8597 4 ай бұрын
Thanks! This helped a lot in my project.
@saricden
@saricden 2 жыл бұрын
Great video bro :) Would love to see the follow-up w/ Vue.js!
@omarsaas
@omarsaas 3 жыл бұрын
Your video is great and very simple to understand, Thank you very much !
@elilopezdev
@elilopezdev 3 жыл бұрын
I appreciate it very much. Thank you!!
@discontinuity
@discontinuity 2 жыл бұрын
Love the vid, would like to see how you setup the security rules, I really dont get those.
@deepakk6092
@deepakk6092 2 жыл бұрын
Wonderful content. Please create more payment related content.
@joe-vanderveen5423
@joe-vanderveen5423 2 жыл бұрын
Great Video!
@GarthFransman
@GarthFransman 3 ай бұрын
Hi . Great video . Is there a tut on how to achieve this with WP WooCommerce as well ?
@reeteshsuggula8828
@reeteshsuggula8828 2 жыл бұрын
hey can you do a video on CORS handling after deployment for the above project @EliLOpez
@alant7615
@alant7615 2 жыл бұрын
I'm looking forward your firestore's rule video
@MusicbyAnt
@MusicbyAnt 2 күн бұрын
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
@nat.serrano
@nat.serrano 2 жыл бұрын
very very useful video for ios devs!
@ExtraServingsBTS
@ExtraServingsBTS 3 жыл бұрын
good stuff. subscribed!
@elilopezdev
@elilopezdev 3 жыл бұрын
Glad it was helpful!
@ExtraServingsBTS
@ExtraServingsBTS 3 жыл бұрын
@@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 жыл бұрын
@@elilopezdev it's going pretty well, maybe my vid will come out first ;)
@ismaelyassin8882
@ismaelyassin8882 Жыл бұрын
Is using both return value from stripe and updating my backend + using webhooks as a redundant a good solution?
@jsfhzlrvr
@jsfhzlrvr Жыл бұрын
Where can I find the stripe token ?
@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
@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
@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!
@manny8816
@manny8816 Жыл бұрын
I have no URLs in my firebase functions dashboard? how do i get them in the first place?
@LumbricusVII
@LumbricusVII 3 жыл бұрын
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 жыл бұрын
Completely missed it, I will be re-uploading this one. Thanks a lot!
@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
@user-vk1cp3lx2k
@user-vk1cp3lx2k 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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 жыл бұрын
@@elilopezdev Works now, thanks for this reply. I was rather parsing it as key-value pair.
@manojisaac
@manojisaac 3 жыл бұрын
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. 🙂
@jajasaria
@jajasaria Жыл бұрын
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
@emersonsmithperu
@emersonsmithperu 2 жыл бұрын
Err req.body empty use clud functions requestt http
@DonteTrumble
@DonteTrumble 3 жыл бұрын
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.
@chbb9027
@chbb9027 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 :)
@zakblacki
@zakblacki 2 жыл бұрын
how to link a user id with the payment in firestore (example VIP subscription update user role)
@elilopezdev
@elilopezdev 2 жыл бұрын
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 жыл бұрын
@@elilopezdev Thank you if possible if you know how to link this with flutter app that would be even great !
@elilopezdev
@elilopezdev 2 жыл бұрын
@@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 жыл бұрын
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 :)
@elilopezdev
@elilopezdev 3 жыл бұрын
First part about Stripe Checkout with Firebase Functions🔥: kzbin.info/www/bejne/gpCkdaemZtmKhqM
Receive payments with Stripe Checkout + Firebase Functions
10:18
Getting started with Cloud Functions
19:26
Firebase
Рет қаралды 25 М.
Мы играли всей семьей
00:27
Даша Боровик
Рет қаралды 3,8 МЛН
FlutterFlow Cloud Functions: MUCH More Powerful Than You Think
33:10
100 Firebase Tips, Tricks, and Screw-ups
24:31
Fireship
Рет қаралды 182 М.
Set Up Subscription Payments with Stripe, Next.JS & Firebase! 🔥
17:57
Top 3 Things You Should Know About Webhooks!
3:55
ByteByteGo
Рет қаралды 75 М.
NEW GPT-4o: My Mind is Blown.
6:28
Joshua Chang
Рет қаралды 223 М.
Firebase Cloud Function Tutorial - REST API Part 1 | Diligent Dev
20:21
Stripe Billing - Get Paid for your SaaS
13:00
Fireship
Рет қаралды 64 М.