reyjoel
reyjoel

Reputation: 29

PHP Stripe ACH verify bank account

Ive following this documentation in stripe regarding the 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()

Upvotes: 0

Views: 407

Answers (1)

Paul Asjes
Paul Asjes

Reputation: 5857

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. More recent versions use the syntax \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.

Upvotes: 1

Related Questions