问题
I currently have an iOS app that implements Firebase to authenticate users and store data references in its realtime database. I want to add a feature to the app where the logged in users can purchase a good and I want to use Stripe to process the payment. I know in order for Stripe to work, a backend server must be uses to help the transaction go through since Stripe only delivers a token and doesn't actually process the payment themselves. I was curious as it's possible to just use Cloud Functions for Firebase as my backend sever to communicate with Stripe instead of having to use another backend service. It makes sense try to implement Stripe with Firebase since my app already relies on Firebase for all its sever side functions. Any help, or advice that could point me in the right direction on how to accomplish this will definitely will be appreciated.
回答1:
You most certainly can hook Stripe into your app (not just iOS, but any client platform). There is sample code provided by the Firebase team that illustrates how you might use a database trigger to initiate a payment using Stripe's node.js API.
来源:https://stackoverflow.com/questions/45900138/using-cloud-functions-for-firebase-as-my-backend-for-implementing-stripe-in-ios