#joshandrews43-bank-accounts

1 messages · Page 1 of 1 (latest)

stone sierra
#

Taking a step back - we don't recommend that you actually hit Stripe's API in your unit tests. You should be mocking out these requests to avoid issues like this

wheat depot
#

I also wanted to ask why the paymentMethods.list() function requires a type parameter; why can't I just get all payment methods for a given customer?

#

@stone sierra I use stripe's real api precisely to find issues like this. I've run into 10+ errors in the stripe api in my 12 months of managing a connect platform account and found that it's extremely unreliable and the docs are not accurate, so I need to use the real api.

stone sierra
#

How are you retrieving the Payment Methods? Do you have an example request?
As for why type is needed when listing Payment methods - I don't know the specifics of why the API was designed for this, but I do see that listing Sources does the same thing (where you need to specify object)

wheat depot
#

const banksPromise = stripe.paymentMethods.list( { customer: customerId, type: 'us_bank_account' as any }, headers, );

#

us_bank_account is a beta feature, so maybe this is a beta issue, but is there no way to get bank accounts with the payment method api?

stone sierra
#

ahhh, are you're using the ACH beta - for betas you should be going through support (https://support.stripe.com/contact) to get routed to the right people. We support card sources being returned as payment methods, but I don't know if that's also extended to the new beta

wheat depot
#

@stone sierra you're wrong about sources. I can call listSources with just a customer ID and it will return banks + cards

#

So not having that for paymentMethods api seems odd to me