I'm trying to use Stripe to collect and save a user's bank account information to give them a payout at a later date. Even though I'm explicitly only supporting US bank accounts, I keep getting the following error on my frontend:
{
"code": "Failed",
"declineCode": null,
"localizedMessage": "collectBankAccount currently only accepts the USBankAccount payment method type.",
"message": "collectBankAccount currently only accepts the USBankAccount payment method type.",
"stripeErrorCode": null,
"type": null
}
Here is a snippet of my frontend React Native JavaScript code:
const { error } = await collectBankAccountForSetup({
clientSecret: PaymentSetupIntent, // payment setup intent secret from the backend
params: {
payment_method_type: 'us_bank_account',
payment_method_data: {
billing_details: {
name: `${profileData.firstName} ${profileData.lastName}`,
email: profileData.email
}
}
}
})
Here is a snippet of my backend Express JavaScript code:
// this is the setup intent that gets passed to the frontend
const setupIntent = await stripeClient.setupIntents.create({
customer: customerID,
payment_method_types: ['us_bank_account']
})
It looks like your client-side code is using the example from Stripe's React code snippet instead of the React Native snippet, right? It looks like their React Native library is expecting snake case instead of camel case: notice the error message says "only accepts the USBankAccount payment method type" instead of "us_bank_account" like they document in the API reference.
https://docs.stripe.com/payments/ach-direct-debit/set-up-payment?platform=react-native