quaderno / quaderno-ruby Goto Github PK
View Code? Open in Web Editor NEWA ruby gem for Quaderno API.
Home Page: http://quaderno.io
License: MIT License
A ruby gem for Quaderno API.
Home Page: http://quaderno.io
License: MIT License
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.
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:in
parse'
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.
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.
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 `[]'
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']
}
]
})
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:in
create'
Right now we switch back to 1.5.5 version as it is working fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.