stripe / stripe-react-native

React Native library for Stripe.
https://stripe.dev/stripe-react-native
MIT License
1.27k stars 265 forks source link

Missing required param: bank_account[account_number]. #951

Closed codingslash76 closed 2 years ago

codingslash76 commented 2 years ago

I am using following params to create bank token

const params = {
  "type": "BankAccount",
  "bank_account": {
    "country": "US",
    "currency": "usd",
    "account_number": "000123456789",
    "account_holder_name": "Jenny Rosen",
    "account_holder_type": "individual",
    "routing_number": "110000000"
  }
}
await createToken(params)

I am getting following error.


{
  "error": {
    "stripeErrorCode": "parameter_missing",
    "declineCode": null,
    "localizedMessage": "There was an unexpected error -- try again in a few seconds",
    "message": "Missing required param: bank_account[account_number].",
    "type": "invalid_request_error",
    "code": "Failed"
  }
}

Stripe Dashboard logs

log3 log2 log1

Can anyone tell me what I am doing wrong here?

codingslash76 commented 2 years ago

Params should be like this.

const params = {
            type: 'BankAccount',
            accountHolderName: 'Jenny Rosen',
            accountHolderType: 'individual',
            accountNumber: '000123456789',
            country: 'US',
            currency: 'usd',
            routingNumber: '110000000',
}

It is working now.