Coder Social home page Coder Social logo

quaderno-ruby's People

Contributors

adamgiounas avatar fwitzke avatar halfbyte avatar jcxplorer avatar jrub avatar jsfernandes avatar molpe avatar mvelikov avatar nickcoyne avatar pat avatar polimorfico avatar rianrainey avatar suhiltzaile avatar xxswingxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quaderno-ruby's Issues

IndexError: string not matched on Invoice Create

When I try to create a big invoice I get a very strange unhandled exception:

response = Quaderno::Invoice.create build
IndexError: string not matched
    from /home/rbank/main-app/vendor/bundle/ruby/2.1.0/gems/quaderno-1.8.0/lib/quaderno-ruby/behavior/crud.rb:19:in `[]='
    from /home/rbank/main-app/vendor/bundle/ruby/2.1.0/gems/quaderno-1.8.0/lib/quaderno-ruby/behavior/crud.rb:19:in `parse'
    from /home/rbank/main-app/vendor/bundle/ruby/2.1.0/gems/quaderno-1.8.0/lib/quaderno-ruby/behavior/crud.rb:64:in `create'

The reason for the exception is that element on 19: element['payments'] = payments_collection is a string and not a hash:

response = Quaderno::Invoice.create(rb_invoice)

From: /Users/mihailvelikov/.rvm/gems/ruby-2.1.2/gems/quaderno-1.8.0/lib/quaderno-ruby/behavior/crud.rb @ line 19 Quaderno::Behavior::Crud::ClassMethods#parse:

    14: def parse(element)
    15:   payments_collection = []
    16:   (element['payments'] || []).each do |payment|
    17:     payments_collection << api_model.to_instance(Quaderno::Payment, payment)
    18:   end unless api_model == Quaderno::Estimate
 => 19:   binding.pry
    20:   element['payments'] = payments_collection
    21: 
    22:   items_collection = []
    23:   element['items'].each do |item|
    24:     items_collection << api_model.to_instance(Quaderno::DocumentItem, item)
    25:   end
    26:   element['items'] = items_collection
    27: 
    28:   contact = api_model.to_instance(Quaderno::Contact, element['contact'])
    29:   element['contact'] = contact
    30: end

[2] pry(Quaderno::Invoice)> puts element
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>

I have just emailed you the invoice I use to get this kind of issue.

Problem parsing response to 'create estimate call'

Hi,

I'm getting a:

NoMethodError: undefined method each' for nil:NilClass from .../ruby-2.0.0-p247/gems/quaderno-1.3.1/lib/quaderno-ruby/behavior/crud.rb:21:inparse'

Which is:

      element['items'].each do |item|
        items_collection << api_model.to_instance(Quaderno::DocumentItem, item)
      end

The estimate is being created properly AFAIK, since I can see and manipulate it through the webapp, but the ruby gem can't parse the response.

Apparently the response to CREATE includes a 'item_attributes' field instead of the expected 'items', which comes in the response to SHOW BTW.

Too restrictive on httparty

Hi,

is there a special reason why you are so restrictive on httparty gem (spec.add_dependency('httparty', "~> 0.13.1"))?

Can we go with ~> 0.13 instead, having in mind that httparty is 0.16.x already?

That's a blocker for me to use another gem.

TypeError: no implicit conversion of String into Integer

Hello guys,
I get the following issue when trying to create an invoice using the sample code from the documentation. I also get similar meaningful exceptions from this line with other params variation.

[1] pry(main)> params = {
[1] pry(main)*   po_number: '', 
[1] pry(main)*   currency: 'USD', 
[1] pry(main)*   tag_list: ['playboy', 'businessman'] 
[1] pry(main)* }  
=> {:po_number=>"", :currency=>"USD", :tag_list=>["playboy", "businessman"]}
[2] pry(main)> invoice = Quaderno::Invoice.create(params)
TypeError: no implicit conversion of String into Integer
from ~/.rvm/gems/ruby-2.1.2/gems/quaderno-1.8.0/lib/quaderno-ruby/behavior/crud.rb:16:in `[]'

API Permalink returning an Id instead of checkout URL

Hi there,

I am calling CheckoutSession.create and it is returning the permalink as an ID opposed to a url. Am I missing something?

Quaderno::CheckoutSession.create({
        billing_details_collection:"auto",
        cancel_url: cancel_url,
        success_url: success_url,
        coupon_collection:false,
        customer: {
          company: current_user.company,
          email: current_user.email,
          first_name: current_user.first_name,
          last_name: current_user.last_name,
        },
        items: [
          {
            product: ENV['QUADERN_SKU']
          }
        ]
      })

Create fails

Hi John Wu,
Thanks for such a nice gem. We are using your latest version of gem i.e. 1.6.0 in our project and found below issue with create.
It seems you forgot '?' for is_a_document at line no.64 in crud.rb.

NameError: undefined local variable or method is_a_document' for Quaderno::Contact:Class from /usr/local/rvm/gems/ruby-2.2.0/gems/quaderno-1.6.0/lib/quaderno-ruby/behavior/crud.rb:64:increate'

Right now we switch back to 1.5.5 version as it is working fine.

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.