gpt4 book ai didi

android - 如何在 Flutter dart 上使用 dwolla api

转载 作者:行者123 更新时间:2023-11-29 05:35:01 25 4
gpt4 key购买 nike

我希望能够在我的 flutter 项目中使用 Dwolla api!这本来很容易,因为大部分工作都是在后端完成的。

现在,有一部分需要ui,其中必须实现javascript和html。

这就是我的问题所在......如何在flutter中实现这部分api:

Then, you’ll pass this single-use IAV token to the client-side of your application where it will be used in the JavaScript function dwolla.iav.start. This token will be used to authenticate the request asking Dwolla to render the IAV flow. Before calling this function you’ll want to include dwolla.js in the HEAD of your page.

<head>
<script src="https://cdn.dwolla.com/1/dwolla.js"></script>
</head>
<head>
<script src="https://cdn.dwolla.com/1/dwolla.js"></script>
</head>

Next, you’ll add in a container to the body of your page where you want to render the IAV flow.

<div id="mainContainer">
<input type="button" id="start" value="Add Bank">
</div>

<div id="iavContainer"></div>
<div id="mainContainer">
<input type="button" id="start" value="Add Bank">
</div>

<div id="iavContainer"></div>

Now that you have dwolla.js initialized on the page and the container created where you’ll render the IAV flow, you’ll create a JavaScript function that responds to the Customer clicking the “Add bank” button on your page. Once the Customer clicks “Add Bank”, your application will call dwolla.iav.start() passing in the following arguments: a string value of your single-use IAV token, options such as the iavContainer element where IAV will render, and a callback function that will handle any error or response.

<script type="text/javascript">
$('#start').click(function() {
var iavToken = '4adF858jPeQ9RnojMHdqSD2KwsvmhO7Ti7cI5woOiBGCpH5krY';
dwolla.configure('sandbox');
dwolla.iav.start(iavToken, {
container: 'iavContainer',
stylesheets: [
'http://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext',
'http://localhost:8080/iav/customStylesheet.css'
],
microDeposits: 'true',
fallbackToMicroDeposits: (fallbackToMicroDeposits.value === 'true')
}, function(err, res) {
console.log('Error: ' + JSON.stringify(err) + ' -- Response: ' + JSON.stringify(res));
});
});
</script>
<script type="text/javascript">
$('#start').click(function() {
var iavToken = '4adF858jPeQ9RnojMHdqSD2KwsvmhO7Ti7cI5woOiBGCpH5krY';
dwolla.configure('sandbox');
dwolla.iav.start(iavToken, {
container: 'iavContainer',
stylesheets: [
'http://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext',
'http://localhost:8080/iav/customStylesheet.css'
],
microDeposits: 'true',
fallbackToMicroDeposits: (fallbackToMicroDeposits.value === 'true')
}, function(err, res) {
console.log('Error: ' + JSON.stringify(err) + ' -- Response: ' + JSON.stringify(res));
});
});
</script>

"The customer will complete the IAV flow by authenticating with their online banking credentials. You’ll know their bank account was successfully added and verified if you receive a JSON response in your callback that includes a link to the newly created funding source."

注意:Dwolla 没有适用于移动设备的 SDK。

所以我想我的问题是,如何在 flutter 上集成这样的 API?

最佳答案

Dwolla 的 IAV 应该适用于 WebView 内的移动应用程序。目前还没有办法完全通过 API 通过后端服务器来完成此操作。根据this post ,看起来 Flutter 团队已经创建了一个插件,可以让您将 WebView 合并到 Flutter 应用程序中。不幸的是,您需要托管一个包含 Dwolla.js Javascript 库的网页才能促进此流程。我们将继续寻找增强此解决方案的方法,并为希望在其 native 移动应用程序中完成所有操作的开发人员提供更多资源。

关于android - 如何在 Flutter dart 上使用 dwolla api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57129714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com