Stripe Connect Firebase 功能 [英] Stripe Connect Firebase Functions

查看:18
本文介绍了Stripe Connect Firebase 功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看了一遍,尝试通过 swift 捕获代码,但仍然需要一个函数来触发代码以获取 Express 帐户以进行连接.

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.

不会在代码尝试上浪费您的时间,因此请寻找能够设置 Stripe Connect 端点以进行重定向并发回代码以完成流程的 Firebase 函数.

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.

有人愿意帮忙吗?

感谢阅读.

推荐答案

你会想做这样的事情:

  1. 从您的应用中打开浏览器或网络视图.让用户通过表单来注册 Stripe 帐户.
  2. 使用 Firebase 通过 HTTP 请求调用函数的能力来定义端点您可以将其设置为 Connect redirect_uri.假设 https://us-central1-example.cloudfunctions.net/connect_redirect
  3. 在您的 Firebase 函数中,您将获取包含在查询字符串 (request.query.code) 中的 code 参数,然后是 完成连接过程,使用HTTP 客户端 将适当的数据发布到 https://connect.stripe.com/oauth/令牌
  4. 在 Firebase 函数的 return 中,提供一条鼓励用户关闭浏览器的消息,或者创建一个 redirect,将用户引导回您的应用程序(使用类似 自定义 url 方案 作为重定向目标)
  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)

这篇关于Stripe Connect Firebase 功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆