简体   繁体   English

PHP Stripe ACH验证银行帐户

[英]PHP Stripe ACH verify bank account

Ive following this documentation in stripe regarding the ACH. Ive在有关ACH的条带中遵循此文档

This is the code 这是代码

// 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
\Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc');

// get the existing bank account
$bank_account = \Stripe\Customer::retrieveSource(
  'cus_AFGbOSiITuJVDs',
  'ba_17SHwa2eZvKYlo2CUx7nphbZ'
);

// verify the account
$bank_account->verify(['amounts' => [32, 45]]);

In my local I got this error instead 在我本地,我得到了这个错误

Uncaught Error: Call to undefined method Stripe_Customer::retrieveSource() 未捕获的错误:调用未定义的方法Stripe_Customer :: retrieveSource()

If you are calling retrieveSource via Stripe_Customer , then you are on a very old version of the stripe-php library which does not have a retrieveSource method. 如果要通过Stripe_Customer调用retrieveSource ,则您使用的是Stripe_Customer -php库的非常旧的版本,该版本没有retrieveSource方法。 More recent versions use the syntax \\Stripe\\Customer\\::retrieveSource 最新版本使用语法\\Stripe\\Customer\\::retrieveSource

If you update your Stripe library to a more recent version you should be able to use retrieveSource as in the docs. 如果将Stripe库更新为更新版本,则应该能够像在文档中一样使用retrieveSource

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM