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
Learn how to receive subscriptions with Stripe Checkout, Firebase 9 and Vue.js 3! 🔥🔥 ruclips.net/video/KiEgUp91ejc/видео.html
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!
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.
I cannot express how grateful I am that you made this tutorial
Eli you legend, thank you for this easy to follow and clear tutorial, keep it up man! :)
I definitely subbed!
Glad it was helpful, thanks a lot!
Mr. Lopez, many thanks for this!
Your video is great and very simple to understand, Thank you very much !
I appreciate it very much. Thank you!!
Thanks! This helped a lot in my project.
Great Video!
Wonderful content. Please create more payment related content.
Great video bro :)
Would love to see the follow-up w/ Vue.js!
Love the vid, would like to see how you setup the security rules, I really dont get those.
very very useful video for ios devs!
First part about Stripe Checkout with Firebase Functions🔥: ruclips.net/video/L_ADtp1tWPA/видео.html
good stuff. subscribed!
Glad it was helpful!
@@elilopezdev got a video on connect onboarding using express accounts? ;).
@@ExtraServingsBTS Not yet! But I've used Express Connect before so surely expect it later 😀
@@elilopezdev it's going pretty well, maybe my vid will come out first ;)
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
Pretty nice mate. How do we associate the checkout session to a logged in user? Essential for a payment system I would think.
I'm asking because it's not clear in the docs and no it doesn't FFSCNT!
I'm looking forward your firestore's rule video
Hi . Great video . Is there a tut on how to achieve this with WP WooCommerce as well ?
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.
Completely missed it, I will be re-uploading this one. Thanks a lot!
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?
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
@@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.
@@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
@@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"
},
@@elilopezdev Works now, thanks for this reply. I was rather parsing it as key-value pair.
Where can I find the stripe token ?
hey can you do a video on CORS handling after deployment for the above project @EliLOpez
Is using both return value from stripe and updating my backend + using webhooks as a redundant a good solution?
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
It seems like now you have to pay to use Firebase Cloud Functions... Was it free when you did this video?
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
I use firebase cloud functions. very comfortable. Yes, you pay. But it s worth it :)
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
How about the previously saved shipping address?? we have to give user option to copyy from old address to improve user experience..rt
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. 🙂
I have no URLs in my firebase functions dashboard? how do i get them in the first place?
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 ?
no, client-side cannot be trusted
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?
I fixed my problem. I forgot to add the stripe package to my functions package.json and npm install it.
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
how to link a user id with the payment in firestore (example VIP subscription update user role)
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! 😊😊
@@elilopezdev Thank you if possible if you know how to link this with flutter app that would be even great !
@@zakblacki Sure! I've been wanting to make a tutorial on Flutter + Firebase. Glad to know you're interested. 😮
@@elilopezdev I'm waiting bro
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 :)
Err req.body empty use clud functions requestt http