Stripe Connect Firebase Functions

后端 未结 1 2030
长情又很酷
长情又很酷 2020-12-18 15:55

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

相关标签:
1条回答
  • 2020-12-18 16:03

    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)
    0 讨论(0)
提交回复
热议问题