Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined method `verify' for Stripe::BankAccount:Class #1410

Closed
addielmoldes opened this issue May 31, 2024 · 3 comments
Closed

Undefined method `verify' for Stripe::BankAccount:Class #1410

addielmoldes opened this issue May 31, 2024 · 3 comments
Assignees
Labels

Comments

@addielmoldes
Copy link

Describe the bug

{
"error": "undefined method `verify' for Stripe::BankAccount:Class
source = Stripe::BankAccount.verify('cus_9s6XGDTHzA66Po', 'ba_1NAiwl2eZvKYlo2CRdCLZSxO', { amounts: [32, 45] })
}

To Reproduce

Stripe::BankAccount.verify('cus_9s6XGDTHzA66Po', 'ba_1NAiwl2eZvKYlo2CRdCLZSxO', { amounts: [32, 45] })

Expected behavior

Bank account verification

Code snippets

No response

OS

Manjaro Linux

Language version

Ruby 3.1.3

Library version

stripe-ruby v11.5

API version

2024-04-10

Additional context

No response

@anniel-stripe
Copy link
Contributor

Hi @addielmoldes , thanks for writing in! The verify method is an instance method on BankAccount, not a class method.

To call the method, you'll need to retrieve the bank account first using Stripe::Customer.retrieve_payment_method. The final example would look something like

ba = Stripe::Customer.retrieve_payment_method('cus_9s6XGDTHzA66Po', 'ba_1NAiwl2eZvKYlo2CRdCLZSxO')
ba.verify( { amounts: [32, 45] })

I see that the Ruby example on https://docs.stripe.com/api/customer_bank_accounts/verify is incorrect - I'm assuming this is what you were referring to with your example since the values look the same. We'll look into getting that fixed in the docs.

@anniel-stripe anniel-stripe self-assigned this May 31, 2024
@anniel-stripe
Copy link
Contributor

I'm going to close this issue since this is a docs bug that we're tracking internally and not so much a bug in the SDK itself. Again, thank you for flagging this!

@ramya-stripe
Copy link
Contributor

Update:

We have since found that this was not a docs bug and we should have had the static method for verify on BankAccount. As of version 12.0.0 of the stripe-ruby package, this has now been implemented - Stripe::BankAccount.verify()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants