我在 Stripe 中使用格子进行 ACH 支付.我想将其用于 android,但文档在 javascript.so 我在 android 中使用了 webView。因此,当用户在HTML页面中提供他的ACH银行详细信息时,这些值将被转换为令牌,并需要存储在云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 页面中遵循了相同的网络规则。
如果要使用 webview 将 plaid 用于移动设备,这是正确的方法,plaid 提供了移动设备中 plaid 集成的示例。这是链接 https://github.com/plaid/link 跟随它并更改键。