1

Stripeで銀行口座を確認しようとしています。 Stripeドキュメントの最も近い言語はNode.jsなので、私のコードは少し異なりますが、stripe.jsから作成されたstripeオブジェクトには "customers"オブジェクトがないという問題があります。ACH Stripe Bank Account Verification

彼らのコード(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 

"顧客" オブジェクトの移入を作るための方法のいずれかを知っていますストライプオブジェクトに?

+1

クライアントサイドライブラリを使用してサーバー側のアクションを実行しようとしていますが、動作しません。 – Alex

+0

私は正しい方向@アレックスで私を指摘していただきありがとうございます! – SupposedlySam

答えて

0

Per @Alexのコメントでは、私は銀行口座の確認にstripe.jsを使用しようとしていましたが、代わりにStripe APIを使用していたはずです。 C# MVCを使用しているため、お客様がコントローラに提供した小額支払い額を渡し、Stripe.netクラスBankAccountServicehttps://github.com/stripe/stripe-dotnet)のVerfiyメソッドを呼び出す必要がありました。