This is using the Ruby gem:
DWOLLA_CLIENT = DwollaV2::Client.new(key: ENV["DWOLLA_APP_KEY"], secret: ENV["DWOLLA_APP_SECRET"]) do |config|
config.environment = :sandbox
end
DWOLLA_CLIENT.auths.client.post(
"https://api-sandbox.dwolla.com/customers/0b29ab8d-d801-4852-89c2-da3ae1174c01",
{
"email"=>"bar@example.com",
"doingBusinessAs"=>"ROAN MOUNTAIN PHARMACY",
"website"=>nil,
"address1"=>"8251 US HIGHWAY 19E",
"address2"=>nil,
"city"=> "x" * 51,
"state"=>"TN",
"postalCode"=>"37687",
"phone"=>"5555555555"
},
)
# => DwollaV2::ServerError ({"code"=>"ServerError", "message"=>"A server error occurred. Error ID: fe6c8af1-d27d-4d75-9a73-ab3eca07c706."})
Using "x" * 50 for city works fine. I would expect a ValidationError to be raised with a helpful message, like it is for other length-validated fields such as address1:
DWOLLA_CLIENT.auths.client.post(
"https://api-sandbox.dwolla.com/customers/0b29ab8d-d801-4852-89c2-da3ae1174c01",
{
"email"=>"bar@example.com",
"doingBusinessAs"=>"ROAN MOUNTAIN PHARMACY",
"website"=>nil,
"address1"=>"x" * 500,
"address2"=>nil,
"city"=> "x" * 50,
"state"=>"TN",
"postalCode"=>"37687",
"phone"=>"5555555555"
},
)
# => DwollaV2::ValidationError ({"code"=>"ValidationError", "message"=>"Validation error(s) present. See embedded errors list for more details.", "_embedded"=>{"errors"=>[{"code"=>"InvalidFormat", "message"=>"Address1 must be 50 characters or less.", "path"=>"/address1", "_links"=>{}}]}})
, yeah that should be a validation error instead of throwing an exception! Thanks for reporting, we’ll create a bug ticket to get this fixed!