简体   繁体   English

条纹与 iOS 上的 Firebase 集成

[英]Stripe Integration With Firebase on iOS

I'm building an iOS application using Firebase as my backend and want to implement Stripe without an external server.我正在构建一个使用 Firebase 作为后端的 iOS 应用程序,并希望在没有外部服务器的情况下实现 Stripe。 I've already checked out this post: Firebase payment gateways?我已经查看过这篇文章: Firebase 支付网关? — and it shows the following process regarding Stripe's payment process/gateway: - 它显示了有关 Stripe 的付款流程/网关的以下流程:

  1. User initiates transaction on your site用户在您的网站上发起交易
  2. Client code sends them to Stripe to enter their CC info客户端代码将他们发送到 Stripe 以输入他们的 CC 信息
  3. Client code obtains a token representing the secure transaction客户端代码获取代表安全交易的令牌
  4. A server process is notified by stripe when the transaction is validated当交易被验证时,条带通知服务器进程
  5. The server submits the payment authorization with the token服务器用token提交支付授权
  6. Stripe sends a transaction receipt to the server process or Zapier, which would be stored back in Firebase Stripe 向服务器进程或 Zapier发送交易收据,该收据将存储回 Firebase

I've already contacted Firebase regarding Zapier and they told me that Zapier doesn't support this process anymore.我已经就 Zapier联系过 Firebase ,他们告诉我 Zapier 不再支持这个过程。 Also: Unlike Braintree, which requires to generate a token server-side, Stripe's key is associated with my account.另外:与需要在服务器端生成令牌的 Braintree 不同,Stripe 的密钥与我的帐户相关联。

Theoretically then, I would be able to integrate Stripe with no external server using Firebase's REST API, correct?从理论上讲,我将能够使用 Firebase 的 REST API 在没有外部服务器的情况下集成 Stripe,对吗?

We can use any Firebase Realtime Database URL as a REST endpoint.我们可以使用任何 Firebase 实时数据库 URL 作为 REST 端点。 All we need to do is append .json to the end of the URL and send a request from our favorite HTTPS client.我们需要做的就是将 .json 附加到 URL 的末尾,并从我们最喜欢的 HTTPS 客户端发送请求。 https://firebase.google.com/docs/database/rest/start https://firebase.google.com/docs/database/rest/start

Any help is really appreciated, thanks!任何帮助都非常感谢,谢谢!

Step 4, 5 and ~6 still require a server-side application running one of Stripe's API libraries or one of their third-party integrations .步骤 4、5 和 ~6 仍然需要运行Stripe 的 API 库之一或其第三方集成之一的服务器端应用程序。

6 seems to be describing webhooks, and it might be possible to just wire Stripe webhooks right up to a Firebase 'save' URL , but ultimately you need some kind of application to process the charges on a server. 6 似乎是在描述 webhooks,并且可以Stripe webhooks直接连接到Firebase 的“保存” URL ,但最终您需要某种应用程序来处理服务器上的费用。

This seems to indicate that firebase now supports stripe payments without an external server: https://firebase.google.com/docs/use-cases/payments这似乎表明 firebase 现在无需外部服务器即可支持条带支付: https : //firebase.google.com/docs/use-cases/payments

They have some sample code and instructions here: https://github.com/firebase/functions-samples/tree/master/stripe他们在这里有一些示例代码和说明: https : //github.com/firebase/functions-samples/tree/master/stripe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM