【问题标题】:PHP Stripe ACH verify bank accountPHP Stripe ACH 验证银行账户
【发布时间】:2019-10-26 12:52:17
【问题描述】:

我已经关注了这个documentation 关于 ACH 的条纹。

这是代码

// 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()

【问题讨论】:

    标签: php stripe-payments


    【解决方案1】:

    如果您通过Stripe_Customer 调用retrieveSource,那么您使用的是非常旧的stripe-php 库版本,它没有retrieveSource 方法。较新的版本使用语法\Stripe\Customer\::retrieveSource

    如果您将 Stripe 库更新到较新的版本,您应该能够使用文档中的 retrieveSource

    【讨论】:

    • 如果我要使用最新版本,它会影响我使用的旧代码吗?例如 API?抱歉询问我无法查看和比较旧版本的 API 返回。
    • 您不必升级您的 API 版本,因为它向后兼容。您可能必须更新任何使用 stripe-php 库的代码,因为绑定将发生变化。
    猜你喜欢
    • 2017-12-20
    • 1970-01-01
    • 2019-08-22
    • 2015-12-25
    • 1970-01-01
    • 1970-01-01
    • 2021-03-06
    • 2016-07-18
    • 2019-06-15
    相关资源
    最近更新 更多