When I send request to update an existing custom account I get this message: You cannot use a live bank account number when making transfers or debits in test mode
along with 400 BAD_REQUEST:
"error" => [
"type" => "invalid_request_error"
"message" => "You cannot use a live bank account number when making transfers or debits in test mode"
"param" => "external_account[account_number]"
]
Inspecting the data I send to Stripe I discovered that this error occurs only when there is this data in the request body:
"external_account" => array:6 [
"object" => "bank_account"
"account_number" => "1212121212"
"country" => "BE"
"currency" => "EUR"
"account_holder_name" => "NAME LASTNAME"
"account_holder_type" => "company"
]
I tried to use different fake bank account numbers, but it did not help. The only way to successfully update data is to avoid this external_account
data at all.
I wonder if there is something I can do to make Stripe accept it? Since this error only appears during functional tests.
In test mode Stripe assumes that any number that isn't explicitly one of their test numbers is a potentially real account. Just use of those and you should be good.
In Europe DE89370400440532013000
should do the trick (that one is German).