Firebase发布了与Stripe的集成,因此您不必构建自己的服务器基础架构。可以在这里找到: https://firebase.google.com/docs/use-cases/payments#what_to_do_with_the_sample_app
该网页特别指出您可以处理网络应用程序的付款。但是,如果我正在构建iOS应用程序,我仍然可以使用此集成吗?如果是这样,我将如何去做?
谢谢,提前。
链接中的示例演示如何以跨平台工作的方式实现集成。Stripe是使用Cloud Functions for Firebase集成的。这意味着它在客户端之外的 Google 服务器上运行。它可以跨iOS,Android和Web工作。当您写入/stripe_customers/{userId}/charges/{id}
时,该功能被触发并执行付款。是的,您不必构建自己的服务器。如果您不熟悉 Cloud Functions for Firebase,请查看以下资源:
适用于 Firebase 的云函数使用指南
适用于 Firebase 示例的云函数
Firebase 云函数入门 - Firecasts
具有适用于 Firebase 的云函数的数据库触发器 - Firecasts
如果有人对Stripe
的更高级别的支付流程感兴趣,我们使用它的方式如下-
1) iOS/Android provides card details to Stripe using native SDK
2) Stripe provides a token which you send it to your Firebase
3) Firebase cloud function then triggers a function and uses this token to make a payment or create Stripe customer and make payment
4) after you make payment, store required information like amount paid, date etc on Firebase so that ios/Android can list payments on the app