Javascript 银行帐户验证
我正在用Stripe验证一个银行帐户。Stripe文档中最接近的语言是Node.js,因此我的代码有点不同,但问题是从Stripe.js创建的Stripe对象上没有“customers”对象 他们的代码(): 我的代码:Javascript 银行帐户验证,javascript,jquery,model-view-controller,stripe-payments,Javascript,Jquery,Model View Controller,Stripe Payments,我正在用Stripe验证一个银行帐户。Stripe文档中最接近的语言是Node.js,因此我的代码有点不同,但问题是从Stripe.js创建的Stripe对象上没有“customers”对象 他们的代码(): 我的代码: <script src="https://js.stripe.com/v3/"></script> <script> $('input').on('keydown', function (e) { if (e.whic
<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>
有人知道如何在stripe对象上填充“customers”对象吗?根据@Alex的评论,我试图使用stripe.js验证银行帐户,但我应该使用stripe API。由于我使用的是
C#MVC
我需要将客户提供的小额支付金额传递给我的控制器,并调用Stripe.net
类BankAccountService
的Verfiy
方法,根据文档:。您试图使用客户端库执行服务器端操作,这行不通。谢谢你给我指明了正确的方向@Alex!
<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