gpt4 book ai didi

javascript - ACH Stripe 银行账户验证

转载 作者:行者123 更新时间:2023-11-29 23:41:33 32 4
gpt4 key购买 nike

我正在尝试验证 Stripe 的银行账户。 Stripe 文档中最接近的语言是 Node.js,所以我的代码有点不同,但问题是从 stripe.js 创建的 stripe 对象上没有“客户”对象。

他们的代码(https://stripe.com/docs/ach#manually-collecting-and-verifying-bank-accounts):

// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
var stripe = require("stripe")("my_secret_key");

var data = {amounts: [32,45]}
stripe.customers.verifySource(
'customer_id',
'bank_account_id',
{
amounts: [32, 45]
},
function(err, bankAccount) {

});

我的代码:

<script src="https://js.stripe.com/v3/"></script>
<script>
$('input').on('keydown', function (e) {
if (e.which == 13) {
$('#VerificationAmounts').submit();
}
});

$('#VerificationAmounts').submit(function (e) {
e.preventDefault();
var stripe = Stripe("@publishKey");

var data = { amounts: [$('#Amount1').val(), $('#Amount2').val()] }
debugger;
stripe.customers.verifySource(
'@customerId',
'@bankAccount.Id',
data,
function (err, bankAccount) {

});
});
</script>

错误:

Uncaught TypeError: Cannot read property 'verifySource' of undefined

有谁知道让“客户”对象填充到 strip 对象上的方法吗?

最佳答案

根据@Alex 的评论,我试图使用 stripe.js 来验证银行帐户,但我应该一直使用 Stripe API。因为我使用的是 C# MVC,所以我需要将客户提供的小额支付金额传递给我的 Controller ,并调用 Stripe.net< 的 Verfiy 方法 class BankAccountService 根据文档:https://github.com/stripe/stripe-dotnet .

关于javascript - ACH Stripe 银行账户验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45121177/

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