I am testing this on heroku in my staging env which matches key for key with production. I am running everything using sandbox for Dwolla, but keep getting this same issue.
Here is there service class I am using, the error is getting triggered by this line:
customer = @access_token.post 'customers', request_body
Any clue as to why this might be happening?
# Service for managing Dwolla customers
class DwollaCustomer
def initialize(params)
@dwolla = set_dwolla_instance
@user = params[:user]
@access_token = @dwolla.auths.client
end
def create
customer = @access_token.post 'customers', request_body
@user.update_attributes(dwolla_url: customer.headers[:location])
end
def funding_sources
return unless @user.merchant? || @user.dwolla_url.nil?
sources = @access_token.get "#{@user.dwolla_url}/funding-sources"
sources._embedded['funding-sources']
end
private
def request_body
{
firstName: @user.first_name,
lastName: @user.last_name,
businessName: @user.business_name,
email: @user.email,
type: 'personal',
address1: @user.street_address,
city: @user.city,
state: @user.state,
postalCode: @user.zipcode,
dateOfBirth: @user.dob.strftime('%Y-%m-%d').to_s,
ssn: @user.ssn.last(4)
}
end
def set_dwolla_instance
@dwolla = DwollaV2::Client.new(key: ENV['dwolla_key'], secret: ENV['dwolla_secret']) do |config|
config.environment = ENV['dwolla_env'].to_sym
end
end
end
Here is the entire error produced:
DwollaV2::ValidationError: {"code"=>"ValidationError", "message"=>"Validation error(s) present. See embedded errors list for more details.", "_embedded"=>{"errors"=>[{"code"=>"NotAllowed", "message"=>"DateOfBirth value not allowed.", "path"=>"/dateOfBirth", "_links"=>{}}]}}
I am testing this on heroku in my staging env which matches key for key with production. I am running everything using
sandbox
for Dwolla, but keep getting this same issue.Here is there service class I am using, the error is getting triggered by this line:
customer = @access_token.post 'customers', request_body
Any clue as to why this might be happening?
Here is the entire error produced:
DwollaV2::ValidationError: {"code"=>"ValidationError", "message"=>"Validation error(s) present. See embedded errors list for more details.", "_embedded"=>{"errors"=>[{"code"=>"NotAllowed", "message"=>"DateOfBirth value not allowed.", "path"=>"/dateOfBirth", "_links"=>{}}]}}