#joshandrews43-bank-accounts
1 messages · Page 1 of 1 (latest)
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
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.
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)
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?
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
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.