PHP Stripe ACH验证银行帐户

时间:2019-06-12 04:53:49

标签: php stripe-payments

我已在有关ACH的条带中遵循此documentation

这是代码

// 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]]);

在我本地,我收到了这个错误

  

未捕获的错误:调用未定义的方法   Stripe_Customer :: retrieveSource()

1 个答案:

答案 0 :(得分:1)

如果要通过retrieveSource调用Stripe_Customer,则说明您使用的是Stripe-php库的非常旧的版本,该版本没有retrieveSource方法。最新版本使用语法\Stripe\Customer\::retrieveSource

如果将Stripe库更新为更新版本,则应该能够像文档中一样使用retrieveSource

相关问题