iOS 上的 Stripe 与 Firebase 集成

Stripe Integration With Firebase on iOS

我正在构建一个 iOS 应用程序,使用 Firebase 作为我的后端,并希望在没有外部服务器的情况下实施 Stripe。 我已经查看了这个 post: Firebase payment gateways? — 它显示了有关 Stripe 付款的以下过程 process/gateway:

  1. 用户在您的网站上发起交易
  2. 客户端代码将他们发送到 Stripe 以输入他们的 CC 信息
  3. 客户端代码获取代表安全交易的令牌
  4. 服务器进程在交易被验证时被条带通知
  5. 服务器用token提交支付授权
  6. Stripe 向服务器进程 或 Zapier 发送交易收据,该收据将存储回 Firebase

我已经就 Zapier 问题联系了 Firebase,他们告诉我 Zapier 不再支持此过程。 另外:与需要在服务器端生成令牌的 Braintree 不同,Stripe 的密钥与我的帐户相关联。

从理论上讲,我可以使用 Firebase 的 REST API 将 Stripe 与外部服务器集成,对吗?

We can use any Firebase Realtime Database URL as a REST endpoint. All we need to do is append .json to the end of the URL and send a request from our favorite HTTPS client. https://firebase.google.com/docs/database/rest/start

非常感谢任何帮助,谢谢!

步骤 4、5 和 ~6 仍然需要服务器端应用程序 运行 Stripe's API libraries or one of their third-party integrations

6 似乎在描述 webhooks,它 可能 可以只连接 Stripe webhooks right up to a Firebase 'save' URL,但最终你需要在服务器上处理费用的某种应用程序。

这似乎表明 firebase 现在支持无需外部服务器的条带支付:https://firebase.google.com/docs/use-cases/payments

这里有一些示例代码和说明:https://github.com/firebase/functions-samples/tree/master/stripe