Flutter oAuth:如何开始使用OAuth和Stripe Connect [英] Flutter oAuth : how to get started with OAuth and Stripe connect
本文介绍了Flutter oAuth:如何开始使用OAuth和Stripe Connect的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在我的flutter应用程序中实现条纹连接.这是我需要执行的步骤.谁能指导我如何在Flutter中实现这一目标?
I am trying to implement stripe connect in my flutter app. Here are the steps I need to implement. Can anyone please navigate me on how I could achieve this in Flutter?
我能够使用endpointUrl创建一个按钮,仅此而已.
I am able to create a button with the endpointUrl but that's all..
谢谢
推荐答案
我自己是使用firebase云功能发现了这一点的:
I found out this myself using firebase cloud functions:
- 首先,您在firebase云函数中创建一个https函数
- 然后将函数创建的链接添加到条纹仪表板
- 然后在函数中编写以下逻辑
- 获取授权码
- 从条带中获取数据
- 将响应保存在某处(在我的情况下,保存在实时数据库中)
这是函数
exports.connectStripeStandardAccount = functions.https.onRequest((req, res) => { let authCode = req.query.code; return stripe.oauth.token({ grant_type: 'authorization_code', code: authCode, }).then(async response => { await admin.database() .ref(`/accounts/${authCode}`) .set(response); return res.send("Well done, account integration is completed. You can now close the window and go back to the app"); }); });
这篇关于Flutter oAuth:如何开始使用OAuth和Stripe Connect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文