3

Looked all over, tried capturing the code via swift but still need a function to fire off the code to get an Express account to connect.

Won't waste your time with the code attempts, so looking for Firebase Functions that will setup a Stripe Connect endpoint for redirection and send back the code to finalise the process.

Anyone care to help?

Thanks for reading.

KENdi
  • 7,576
  • 2
  • 16
  • 31
Ben
  • 138
  • 10
  • [Here is a related video](https://angularfirebase.com/lessons/stripe-recurring-subscription-payments-with-angular-and-firebase-cloud-functions/) – James Poag Sep 25 '18 at 12:13
  • https://github.com/firebase/functions-samples/tree/master/stripe? – Frank van Puffelen Sep 25 '18 at 13:46
  • 1
    James, thx and that is on the right track. Frank, those functions don't apply at all bc they're for creating charges etc. Stripe Connect is a different part. Thx for reading. – Ben Sep 25 '18 at 15:15

1 Answers1

7

You'll want to do something like this:

  1. Open a browser or web view from your App. Let the user work through the form to sign up for a Stripe account.
  2. Use Firebase's ability to call functions via HTTP requests, to define an endpoint that you can set as your Connect redirect_uri. Let's say https://us-central1-example.cloudfunctions.net/connect_redirect
  3. In your Firebase function, you will grab the code parameter that's included in the query string (request.query.code), then to complete the connection process, use a HTTP client to POST the appropriate data to https://connect.stripe.com/oauth/token
  4. In the return of your Firebase function, either supply a message encouraging the user to close their browser, OR create a redirect, directing the user back to your app (using something like a custom url scheme as the redirect destination)
duck
  • 5,240
  • 1
  • 15
  • 15
  • Followed your steps, but my request doesn't seem to go out. Would you mind taking a look @ this function and lmk if I missing something? Thx to you, think I'm almost done with this part of the project. – Ben Sep 26 '18 at 20:04
  • 1
    Ben, would you be able to provide us future readers with the function that seemed to have worked? MANY THANKS- Guy from the Future – Andrew B. Aug 19 '20 at 15:32
  • Yes ended up making some custom APIs for these functionality. Unfortunately the API is custom tailored for the specific situation and I don't think any of its code would be valuable for me to share here. – Andrew B. Nov 24 '20 at 22:39