1
我正在尝试验证带有条纹的银行帐户。 Stripe文档中最接近的语言是Node.js,所以我的代码有点不同,但问题是从stripe.js创建的条带对象上没有“customers”对象。ACH条纹银行帐户验证
他们的代码(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
有谁知道的方法,使 “客户” 对象来填充在条纹对象上?
你正在尝试使用客户端库执行服务器端操作,它不会工作。 – Alex
谢谢你指出我在正确的方向@亚历克斯! – SupposedlySam