Stripe Integration With Firebase on iOS

淺唱寂寞╮ 提交于 2019-12-24 05:58:50

问题


I'm building an iOS application using Firebase as my backend and want to implement Stripe without an external server. I've already checked out this post: Firebase payment gateways? — and it shows the following process regarding Stripe's payment process/gateway:

  1. User initiates transaction on your site
  2. Client code sends them to Stripe to enter their CC info
  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
  6. Stripe sends a transaction receipt to the server process or Zapier, which would be stored back in Firebase

I've already contacted Firebase regarding Zapier and they told me that Zapier doesn't support this process anymore. Also: Unlike Braintree, which requires to generate a token server-side, Stripe's key is associated with my account.

Theoretically then, I would be able to integrate Stripe with no external server using Firebase's REST API, correct?

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

Any help is really appreciated, thanks!


回答1:


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.

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.




回答2:


This seems to indicate that firebase now supports stripe payments without an external server: 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://stackoverflow.com/questions/39911456/stripe-integration-with-firebase-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!