[英]ACH Stripe Bank Account Verification
I am trying to verify a bank account with Stripe. 我正在尝试验证Stripe的银行帐户。 The closest language in the Stripe documentation is Node.js so my code is a little different but the problem that there's not "customers" object on the stripe object created from stripe.js. Stripe文档中最接近的语言是Node.js,因此我的代码有些不同,但是存在一个问题,即从stripe.js创建的stripe对象上没有“ customers”对象。
Their code ( https://stripe.com/docs/ach#manually-collecting-and-verifying-bank-accounts ): 他们的代码( 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) {
});
My code: 我的代码:
<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>
Error: 错误:
Uncaught TypeError: Cannot read property 'verifySource' of undefined
Does anyone know of a way to make the "customers" object populate on the stripe object? 有谁知道一种使“客户”对象填充在条纹对象上的方法?
Per @Alex's comment, I was trying to use the stripe.js to verify the bank account but instead I should have been using the Stripe API. 根据@Alex的评论,我试图使用stripe.js来验证银行帐户,但是我应该一直在使用Stripe API。 Since I'm using C# MVC
I needed to pass the micro-payment amounts the customer provided to my Controller and call the Verfiy
method of the Stripe.net
class BankAccountService
per documentation: https://github.com/stripe/stripe-dotnet . 由于我使用C# MVC
我需要通过小额支付金额提供给我的控制器客户和呼叫Verfiy
该方法Stripe.net
类BankAccountService
每文档: https://github.com/stripe/stripe-dotnet 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.