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']
})