1

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!

Community
  • 1
  • 1
GLS
  • 831
  • 6
  • 8

2 Answers2

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.

floatingLomas
  • 8,553
  • 2
  • 21
  • 27
  • Thanks @floatingLomas ! I think there also might be a different way to approach this, take a look at Fabric [link](https://stripe.com/blog/stripe-on-fabric) . They have an out of the box solution for stripe...This shouldn't require any server to work. Would really appreciate your input :) – GLS Oct 07 '16 at 09:12
  • You're welcome! :) Actually, it does - it's a client-side toolkit, but it does still require server-side code. If you scroll down to 'next steps' [here](https://fabric.io/kits/ios/stripe/features) you'll see it talks about building your server-side application. If you don't want to build that out, there are a bunch of [third-party integrations](https://stripe.com/docs/integrations) available for Stripe, and one of those might fit your usecase! – floatingLomas Oct 07 '16 at 19:25
0

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

nathan
  • 4,571
  • 2
  • 27
  • 28