GithubHelp home page GithubHelp logo

Comments (4)

sausman avatar sausman commented on August 26, 2024

Hey @Siraris,

Thanks for letting us know about this. I'm not quite sure what's going on either. Would you be able to provide a script I can run that reproduces the issue?

from dwolla-v2-ruby.

Siraris avatar Siraris commented on August 26, 2024

@sausman

This should be all that you need to reproduce the issue. If you just place test strings for all the business_params (I was doing it without setting a controller, so setting "soleProprietorship", and then just using a the authenticated client. Client.post is just:

def post(endpoint, params = {}) authenticated_client.post endpoint, params end

if this is helpful, here's the test data I was using:

{:firstName=>"Kendrick", :lastName=>"Lamar", :email=>"[email protected]", :type=>"business", :address1=>"1917 N Elston", :city=>"Chicago", :state=>"IL", :postalCode=>"60642", :businessName=>"Test Company", :businessType=>"soleProprietorship", :businessClassification=>"9ed3cf5f-7d6f-11e3-8af8-5404a6144203", :ein=>"12-3456789"}

from dwolla-v2-ruby.

sausman avatar sausman commented on August 26, 2024

Thanks @Siraris,

Here's what I'm getting when I run this script:

Script

require 'dwolla_v2'

client = DwollaV2::Client.new(id: "MY_CLIENT_ID", secret: "MY_CLIENT_SECRET") {|c| c.environment :sandbox }
token = client.auths.client

token.post("customers", {
  :firstName => "Kendrick",
  :lastName => "Lamar",
  :email => "[email protected]",
  :type => "business",
  :address1 => "1917 N Elston",
  :city => "Chicago",
  :state => "IL",
  :postalCode => "60642",
  :businessName => "Test Company",
  :businessType => "soleProprietorship",
  :businessClassification => "9ed3cf5f-7d6f-11e3-8af8-5404a6144203",
  :ein => "12-3456789"
})

Result

/Users/sausman/git/dwolla-v2-ruby/lib/dwolla_v2/middleware/handle_errors.rb:9:in `block in call': {"code"=>"ValidationError", "message"=>"Validation error(s) present. See embedded errors list for more details.", "_embedded"=>{"errors"=>[{"code"=>"InvalidFormat", "message"=>"BusinessClassification invalid.", "path"=>"/businessClassification", "_links"=>{}}, {"code"=>"Required", "message"=>"DateOfBirth required.", "path"=>"/dateOfBirth", "_links"=>{}}, {"code"=>"Required", "message"=>"Ssn required.", "path"=>"/ssn", "_links"=>{}}]}} (DwollaV2::ValidationError)
	from /Users/sausman/.rvm/gems/ruby-2.4.0/gems/faraday-0.13.1/lib/faraday/response.rb:61:in `on_complete'
	from /Users/sausman/git/dwolla-v2-ruby/lib/dwolla_v2/middleware/handle_errors.rb:8:in `call'
	from /Users/sausman/git/dwolla-v2-ruby/lib/dwolla_v2/middleware/set_user_agent.rb:13:in `call'
	from /Users/sausman/.rvm/gems/ruby-2.4.0/gems/faraday_middleware-0.12.2/lib/faraday_middleware/request/encode_json.rb:24:in `call'
	from /Users/sausman/.rvm/gems/ruby-2.4.0/gems/faraday-0.13.1/lib/faraday/request/multipart.rb:15:in `call'
	from /Users/sausman/.rvm/gems/ruby-2.4.0/gems/faraday-0.13.1/lib/faraday/rack_builder.rb:141:in `build_response'
	from /Users/sausman/.rvm/gems/ruby-2.4.0/gems/faraday-0.13.1/lib/faraday/connection.rb:387:in `run_request'
	from /Users/sausman/.rvm/gems/ruby-2.4.0/gems/faraday-0.13.1/lib/faraday/connection.rb:174:in `post'
	from /Users/sausman/git/dwolla-v2-ruby/lib/dwolla_v2/token.rb:42:in `public_send'
	from /Users/sausman/git/dwolla-v2-ruby/lib/dwolla_v2/token.rb:42:in `block (2 levels) in <class:Token>'
	from foo.rb:6:in `<main>'

Does that script give you the same thing?

from dwolla-v2-ruby.

Siraris avatar Siraris commented on August 26, 2024

Hey @sausman

That's my bad, it looks as if the error was being swallowed and is actually coming from us. Thanks again so much for being so quick to get to this.

from dwolla-v2-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.