gpt4 book ai didi

javascript - 适用于 Web 应用的 Cloud Firestore

转载 作者:行者123 更新时间:2023-12-03 02:44:02 24 4
gpt4 key购买 nike

我在 Stripe 中使用格子进行 ACH 付款。我想将它用于 android,但文档是在 javascript 中。所以我在 android 中使用了 webView。因此,当用户在 HTML 页面中提供他的 ACH 银行详细信息时,这些值将被转换为 token 并需要存储在cloud firestore中。但问题是这些值没有存储在cloud firestore中。这是我用于此目的的HTML页面

<button id='linkButton'>Proceed To Pay</button>
<script src="https://www.gstatic.com/firebasejs/4.8.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.8.1/firebase.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.8.1/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.8.1/firebase-auth.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyAhhxfqpoILYEA1Pnt7ciRpRm_hniJ3HUc",
authDomain: "wallet-d66d9.firebaseapp.com",
databaseURL: "https://wallet-d66d9.firebaseio.com",
projectId: "wallet-d66d9",
storageBucket: "wallet-d66d9.appspot.com",
messagingSenderId: "1040078578516"
};
firebase.initializeApp(config);
</script>
<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>

<script>
var linkHandler = Plaid.create({
env: 'sandbox',
clientName: 'Stripe/Plaid Test',
key: '19cf65eeb2a40ac3e397ebb0e76072',
product: ['auth'],
selectAccount: true,
onSuccess: function(public_token, metadata) {
// Send the public_token and account ID to your app server.
//var current = firebase.auth().currentUser.uid;
var db = firebase.firestore();
var dbRef = db.collection('deyaPayusers').doc("CDF6BVM4TXSOwAt0tVlUQTliBx53").collection('plaid').add({
pubToken : public_token,
acctId : metadata.account_id}).then(ref => {
console.log('Added document with ID: ', ref.id);
});
console.log('public_token: ' + public_token);
console.log('account ID: ' + metadata.account_id);
},
onExit: function(err, metadata) {
// The user exited the Link flow.
if (err != null) {
// The user encountered a Plaid API error prior to exiting.
}

当我使用浏览器执行该文件时,数据存储在 firestore 中,但是当我在 webView 中使用时,它不会存储数据。我在 HTML 页面中遵循了与 Web 相同的规则。

最佳答案

如果想通过 webview 将 plaid 用于移动设备,这是正确的方法,并且 plaid 提供了在移动设备中集成 plaid 的示例。这里是链接 https://github.com/plaid/link按照它并更改键。

关于javascript - 适用于 Web 应用的 Cloud Firestore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48183716/

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