quaderno 1.13.2 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +56 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +2 -15
- data/README.md +120 -42
- data/Rakefile +4 -50
- data/changelog.md +67 -41
- data/lib/quaderno-ruby.rb +5 -5
- data/lib/quaderno-ruby/base.rb +112 -107
- data/lib/quaderno-ruby/behavior/block.rb +20 -19
- data/lib/quaderno-ruby/behavior/crud.rb +108 -95
- data/lib/quaderno-ruby/behavior/deliver.rb +20 -18
- data/lib/quaderno-ruby/behavior/payment.rb +38 -34
- data/lib/quaderno-ruby/behavior/retrieve.rb +26 -25
- data/lib/quaderno-ruby/checkout_session.rb +4 -0
- data/lib/quaderno-ruby/collection.rb +1 -0
- data/lib/quaderno-ruby/contact.rb +6 -8
- data/lib/quaderno-ruby/credit.rb +10 -12
- data/lib/quaderno-ruby/document_item.rb +1 -3
- data/lib/quaderno-ruby/estimate.rb +5 -7
- data/lib/quaderno-ruby/evidence.rb +5 -7
- data/lib/quaderno-ruby/exceptions/exceptions.rb +50 -44
- data/lib/quaderno-ruby/expense.rb +6 -8
- data/lib/quaderno-ruby/helpers/authentication.rb +16 -18
- data/lib/quaderno-ruby/helpers/rate_limit.rb +12 -0
- data/lib/quaderno-ruby/income.rb +8 -10
- data/lib/quaderno-ruby/invoice.rb +9 -11
- data/lib/quaderno-ruby/item.rb +3 -6
- data/lib/quaderno-ruby/payment.rb +2 -3
- data/lib/quaderno-ruby/receipt.rb +6 -8
- data/lib/quaderno-ruby/recurring.rb +4 -7
- data/lib/quaderno-ruby/report.rb +67 -29
- data/lib/quaderno-ruby/tax.rb +51 -46
- data/lib/quaderno-ruby/version.rb +3 -0
- data/lib/quaderno-ruby/webhook.rb +3 -5
- data/quaderno.gemspec +28 -148
- metadata +92 -92
- data/Gemfile.lock +0 -91
- data/VERSION +0 -1
- data/test/fixtures/quaderno_cassettes/.DS_Store +0 -0
- data/test/fixtures/quaderno_cassettes/all_contacts.yml +0 -52
- data/test/fixtures/quaderno_cassettes/all_contacts_by_access_token.yml +0 -56
- data/test/fixtures/quaderno_cassettes/all_contacts_by_authentication_token.yml +0 -57
- data/test/fixtures/quaderno_cassettes/all_estimates.yml +0 -52
- data/test/fixtures/quaderno_cassettes/all_expenses.yml +0 -55
- data/test/fixtures/quaderno_cassettes/all_invoices.yml +0 -56
- data/test/fixtures/quaderno_cassettes/all_items.yml +0 -46
- data/test/fixtures/quaderno_cassettes/all_receipts.yml +0 -53
- data/test/fixtures/quaderno_cassettes/all_webhooks.yml +0 -214
- data/test/fixtures/quaderno_cassettes/create_estimate_on_downgraded_API.yml +0 -156
- data/test/fixtures/quaderno_cassettes/create_expense_on_downgraded_API.yml +0 -278
- data/test/fixtures/quaderno_cassettes/create_invoice_on_downgraded_API.yml +0 -159
- data/test/fixtures/quaderno_cassettes/create_receipt_on_downgraded_API.yml +0 -196
- data/test/fixtures/quaderno_cassettes/deleted_contact.yml +0 -187
- data/test/fixtures/quaderno_cassettes/deleted_contact_by_access_token.yml +0 -199
- data/test/fixtures/quaderno_cassettes/deleted_contact_by_authentication_token.yml +0 -199
- data/test/fixtures/quaderno_cassettes/deleted_estimate.yml +0 -187
- data/test/fixtures/quaderno_cassettes/deleted_expense.yml +0 -189
- data/test/fixtures/quaderno_cassettes/deleted_invoice.yml +0 -190
- data/test/fixtures/quaderno_cassettes/deleted_item.yml +0 -128
- data/test/fixtures/quaderno_cassettes/deleted_receipt.yml +0 -223
- data/test/fixtures/quaderno_cassettes/deleted_webhook.yml +0 -257
- data/test/fixtures/quaderno_cassettes/delivered_estimate.yml +0 -136
- data/test/fixtures/quaderno_cassettes/delivered_invoice.yml +0 -143
- data/test/fixtures/quaderno_cassettes/delivered_receipt.yml +0 -140
- data/test/fixtures/quaderno_cassettes/evidence_invoice.yml +0 -98
- data/test/fixtures/quaderno_cassettes/found_contact.yml +0 -95
- data/test/fixtures/quaderno_cassettes/found_contact_by_access_token.yml +0 -99
- data/test/fixtures/quaderno_cassettes/found_contact_by_authentication_token.yml +0 -100
- data/test/fixtures/quaderno_cassettes/found_estimate.yml +0 -97
- data/test/fixtures/quaderno_cassettes/found_expense.yml +0 -99
- data/test/fixtures/quaderno_cassettes/found_invoice.yml +0 -100
- data/test/fixtures/quaderno_cassettes/found_item.yml +0 -91
- data/test/fixtures/quaderno_cassettes/found_receipt.yml +0 -98
- data/test/fixtures/quaderno_cassettes/found_webhook.yml +0 -130
- data/test/fixtures/quaderno_cassettes/new_contact.yml +0 -48
- data/test/fixtures/quaderno_cassettes/new_contact_by_access_token.yml +0 -48
- data/test/fixtures/quaderno_cassettes/new_contact_by_authentication_token.yml +0 -48
- data/test/fixtures/quaderno_cassettes/new_estimate.yml +0 -137
- data/test/fixtures/quaderno_cassettes/new_evidence.yml +0 -48
- data/test/fixtures/quaderno_cassettes/new_expense.yml +0 -189
- data/test/fixtures/quaderno_cassettes/new_invoice.yml +0 -137
- data/test/fixtures/quaderno_cassettes/new_item.yml +0 -48
- data/test/fixtures/quaderno_cassettes/new_receipt.yml +0 -173
- data/test/fixtures/quaderno_cassettes/new_webhook.yml +0 -87
- data/test/fixtures/quaderno_cassettes/paid_expense.yml +0 -98
- data/test/fixtures/quaderno_cassettes/paid_invoice.yml +0 -99
- data/test/fixtures/quaderno_cassettes/rate_limit.yml +0 -46
- data/test/fixtures/quaderno_cassettes/unpay_an_expense.yml +0 -138
- data/test/fixtures/quaderno_cassettes/unpay_an_invoice.yml +0 -138
- data/test/fixtures/quaderno_cassettes/updated_contact.yml +0 -97
- data/test/fixtures/quaderno_cassettes/updated_contact_by_access_token.yml +0 -101
- data/test/fixtures/quaderno_cassettes/updated_contact_by_authentication_token.yml +0 -102
- data/test/fixtures/quaderno_cassettes/updated_estimate.yml +0 -185
- data/test/fixtures/quaderno_cassettes/updated_expense.yml +0 -184
- data/test/fixtures/quaderno_cassettes/updated_invoice.yml +0 -184
- data/test/fixtures/quaderno_cassettes/updated_item.yml +0 -93
- data/test/fixtures/quaderno_cassettes/updated_receipt.yml +0 -220
- data/test/fixtures/quaderno_cassettes/updated_webhook.yml +0 -175
- data/test/fixtures/quaderno_cassettes/validate_invalid_VAT_number.yml +0 -44
- data/test/fixtures/quaderno_cassettes/validate_valid_VAT_number.yml +0 -44
- data/test/helper.rb +0 -32
- data/test/unit/test_quaderno_contacts.rb +0 -83
- data/test/unit/test_quaderno_contacts_thread_safe.rb +0 -104
- data/test/unit/test_quaderno_estimates.rb +0 -155
- data/test/unit/test_quaderno_evidences.rb +0 -41
- data/test/unit/test_quaderno_expenses.rb +0 -162
- data/test/unit/test_quaderno_invoices.rb +0 -177
- data/test/unit/test_quaderno_items.rb +0 -84
- data/test/unit/test_quaderno_receipts.rb +0 -156
- data/test/unit/test_quaderno_tax.rb +0 -46
- data/test/unit/test_quaderno_webhooks.rb +0 -93
@@ -1,9 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
include Quaderno::Behavior::Retrieve
|
1
|
+
class Quaderno::Contact < Quaderno::Base
|
2
|
+
include Quaderno::Behavior::Retrieve
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
4
|
+
api_model Quaderno::Contact
|
5
|
+
api_path 'contacts'
|
6
|
+
retrieve_path 'customers'
|
7
|
+
end
|
data/lib/quaderno-ruby/credit.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
include Quaderno::Behavior::Block
|
1
|
+
class Quaderno::Credit < Quaderno::Base
|
2
|
+
include Quaderno::Behavior::Deliver
|
3
|
+
include Quaderno::Behavior::Payment
|
4
|
+
include Quaderno::Behavior::Retrieve
|
5
|
+
include Quaderno::Behavior::Block
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
7
|
+
api_model Quaderno::Credit
|
8
|
+
api_path 'credits'
|
9
|
+
retrieve_path 'refunds'
|
10
|
+
is_a_document? true
|
11
|
+
end
|
@@ -1,9 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
include Quaderno::Behavior::Deliver
|
1
|
+
class Quaderno::Estimate < Quaderno::Base
|
2
|
+
include Quaderno::Behavior::Deliver
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end
|
4
|
+
api_model Quaderno::Estimate
|
5
|
+
api_path 'estimates'
|
6
|
+
is_a_document? true
|
9
7
|
end
|
@@ -1,10 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
api_path 'evidences'
|
1
|
+
class Quaderno::Evidence < Quaderno::Base
|
2
|
+
api_model Quaderno::Evidence
|
3
|
+
api_path 'evidences'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
end
|
5
|
+
class << self
|
6
|
+
undef :all, :find, :update, :delete, :parse_nested
|
9
7
|
end
|
10
8
|
end
|
@@ -1,56 +1,62 @@
|
|
1
|
-
module Quaderno
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module Quaderno::Exceptions
|
2
|
+
class BaseException < StandardError
|
3
|
+
include Quaderno::Helpers::RateLimit
|
4
|
+
end
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
class InvalidSubdomainOrToken < BaseException
|
7
|
+
end
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
class InvalidID < BaseException
|
10
|
+
end
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
class RateLimitExceeded < BaseException
|
13
|
+
end
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
class HasAssociatedDocuments < BaseException
|
16
|
+
end
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
class RequiredFieldsEmptyOrInvalid < BaseException
|
19
|
+
end
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
class ThrottleLimitExceeded < BaseException
|
22
|
+
end
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
class UnsupportedApiVersion < BaseException
|
25
|
+
end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
def self.included(receiver)
|
28
|
+
receiver.send :extend, ClassMethods
|
29
|
+
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
44
|
-
if params[:id].nil? == false
|
45
|
-
raise(Quaderno::Exceptions::InvalidID, "Invalid #{ api_model } instance identifier") if (party_response.response.class == Net::HTTPInternalServerError) || (party_response.response.class == Net::HTTPNotFound)
|
46
|
-
end
|
47
|
-
if params[:required_fields].nil? == false
|
48
|
-
raise(Quaderno::Exceptions::RequiredFieldsEmptyOrInvalid, party_response.body) if party_response.response.class == Net::HTTPUnprocessableEntity
|
49
|
-
end
|
50
|
-
if params[:has_documents].nil? == false
|
51
|
-
raise(Quaderno::Exceptions::HasAssociatedDocuments, party_response.body) if party_response.response.class == Net::HTTPClientError
|
52
|
-
end
|
31
|
+
module ClassMethods
|
32
|
+
def check_exception_for(party_response, params = {})
|
33
|
+
raise_exception(Quaderno::Exceptions::UnsupportedApiVersion, 'Unsupported API version', party_response) if !!(party_response.body =~ /Unsupported API version/)
|
34
|
+
|
35
|
+
if params[:throttle_limit].nil? == false && party_response.response.class == Net::HTTPServiceUnavailable
|
36
|
+
raise_exception(Quaderno::Exceptions::ThrottleLimitExceeded, 'Throttle limit exceeded, please try again later', party_response)
|
37
|
+
end
|
38
|
+
if params[:rate_limit].nil? == false && party_response.response.class == Net::HTTPForbidden
|
39
|
+
raise_exception(Quaderno::Exceptions::RateLimitExceeded, 'Rate limit exceeded', party_response)
|
40
|
+
end
|
41
|
+
if params[:subdomain_or_token].nil? == false
|
42
|
+
raise_exception(Quaderno::Exceptions::InvalidSubdomainOrToken, 'Invalid subdomain or token', party_response) if party_response.response.class == Net::HTTPUnauthorized
|
53
43
|
end
|
44
|
+
if params[:id].nil? == false
|
45
|
+
raise_exception(Quaderno::Exceptions::InvalidID, "Invalid #{ api_model } instance identifier", party_response) if (party_response.response.class == Net::HTTPInternalServerError) || (party_response.response.class == Net::HTTPNotFound)
|
46
|
+
end
|
47
|
+
if params[:required_fields].nil? == false
|
48
|
+
raise_exception(Quaderno::Exceptions::RequiredFieldsEmptyOrInvalid, party_response.body, party_response) if party_response.response.class == Net::HTTPUnprocessableEntity
|
49
|
+
end
|
50
|
+
if params[:has_documents].nil? == false
|
51
|
+
raise_exception(Quaderno::Exceptions::HasAssociatedDocuments, party_response.body, party_response) if party_response.response.class == Net::HTTPClientError
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def raise_exception(klass, message, response)
|
56
|
+
exception = klass.new(message)
|
57
|
+
exception.rate_limit_info = response
|
58
|
+
|
59
|
+
raise exception
|
54
60
|
end
|
55
61
|
end
|
56
|
-
end
|
62
|
+
end
|
@@ -1,10 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
include Quaderno::Behavior::Block
|
1
|
+
class Quaderno::Expense < Quaderno::Base
|
2
|
+
include Quaderno::Behavior::Payment
|
3
|
+
include Quaderno::Behavior::Block
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
5
|
+
api_model Quaderno::Expense
|
6
|
+
api_path 'expenses'
|
7
|
+
is_a_document? true
|
10
8
|
end
|
@@ -1,26 +1,24 @@
|
|
1
|
-
module Quaderno
|
2
|
-
module
|
3
|
-
module Authentication
|
1
|
+
module Quaderno::Helpers
|
2
|
+
module Authentication
|
4
3
|
|
5
|
-
|
6
|
-
|
4
|
+
def get_authentication(options = {})
|
5
|
+
mode = options[:mode] || :production
|
7
6
|
|
8
|
-
|
9
|
-
|
7
|
+
local_api_model = options[:api_model]
|
8
|
+
url = options[:api_url] || (local_api_model && local_api_model.url) || (mode == :production ? 'https://quadernoapp.com/api/' : 'http://sandbox-quadernoapp.com/api/')
|
10
9
|
|
11
|
-
|
12
|
-
|
10
|
+
auth_token = options[:auth_token] || options['auth_token'] || (local_api_model && local_api_model.auth_token)
|
11
|
+
access_token = options[:access_token] || options['access_token']
|
13
12
|
|
14
|
-
|
13
|
+
authentication = { url: url, headers: {}, basic_auth: nil }
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
authentication
|
15
|
+
if access_token
|
16
|
+
authentication[:headers] = { 'Authorization' => "Bearer #{access_token}" }
|
17
|
+
elsif auth_token
|
18
|
+
authentication[:basic_auth] = { username: auth_token }
|
23
19
|
end
|
20
|
+
|
21
|
+
authentication
|
24
22
|
end
|
25
23
|
end
|
26
|
-
end
|
24
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Quaderno::Helpers
|
2
|
+
module RateLimit
|
3
|
+
|
4
|
+
def rate_limit_info=(response)
|
5
|
+
@rate_limit_info = { reset: response.headers['x-ratelimit-reset'].to_i, remaining: response.headers["x-ratelimit-remaining"].to_i }
|
6
|
+
end
|
7
|
+
|
8
|
+
def rate_limit_info
|
9
|
+
@rate_limit_info
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/quaderno-ruby/income.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
include Quaderno::Behavior::Block
|
1
|
+
class Quaderno::Income < Quaderno::Base
|
2
|
+
include Quaderno::Behavior::Block
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
api_model Quaderno::Income
|
10
|
-
api_path 'income'
|
11
|
-
is_a_document? true
|
4
|
+
class << self
|
5
|
+
undef :find, :update, :delete
|
12
6
|
end
|
7
|
+
|
8
|
+
api_model Quaderno::Income
|
9
|
+
api_path 'income'
|
10
|
+
is_a_document? true
|
13
11
|
end
|
@@ -1,13 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
include Quaderno::Behavior::Block
|
1
|
+
class Quaderno::Invoice < Quaderno::Base
|
2
|
+
include Quaderno::Behavior::Deliver
|
3
|
+
include Quaderno::Behavior::Payment
|
4
|
+
include Quaderno::Behavior::Retrieve
|
5
|
+
include Quaderno::Behavior::Block
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
7
|
+
api_model Quaderno::Invoice
|
8
|
+
api_path 'invoices'
|
9
|
+
retrieve_path 'charges'
|
10
|
+
is_a_document? true
|
13
11
|
end
|
data/lib/quaderno-ruby/item.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
include Quaderno::Behavior::Block
|
1
|
+
class Quaderno::Receipt < Quaderno::Base
|
2
|
+
include Quaderno::Behavior::Deliver
|
3
|
+
include Quaderno::Behavior::Block
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
5
|
+
api_model Quaderno::Receipt
|
6
|
+
api_path 'receipts'
|
7
|
+
is_a_document? true
|
10
8
|
end
|
data/lib/quaderno-ruby/report.rb
CHANGED
@@ -1,40 +1,78 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
api_path 'reports'
|
1
|
+
class Quaderno::Report < Quaderno::Base
|
2
|
+
api_model Quaderno::Report
|
3
|
+
api_path 'reports'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
class << self
|
6
|
+
undef :all, :find, :create, :update, :delete, :parse_nested
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.journal(options = {})
|
10
|
+
authentication = get_authentication(options.merge(api_model: api_model))
|
11
|
+
filter = options.delete_if { |k,v| %w(auth_token access_token api_url mode api_model).include? k.to_s }
|
12
|
+
|
13
|
+
response = get("#{authentication[:url]}#{api_model.api_path}/journal.json",
|
14
|
+
query: filter,
|
15
|
+
basic_auth: authentication[:basic_auth],
|
16
|
+
headers: version_header.merge(authentication[:headers])
|
17
|
+
)
|
18
|
+
|
19
|
+
check_exception_for(response, { rate_limit: true, subdomain_or_token: true })
|
20
|
+
|
21
|
+
response.parsed_response
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.taxes(options = {})
|
25
|
+
authentication = get_authentication(options.merge(api_model: api_model))
|
26
|
+
filter = options.delete_if { |k,v| %w(auth_token access_token api_url mode api_model).include? k.to_s }
|
27
|
+
|
28
|
+
response = get("#{authentication[:url]}#{api_model.api_path}/taxes.json",
|
29
|
+
query: filter,
|
30
|
+
basic_auth: authentication[:basic_auth],
|
31
|
+
headers: version_header.merge(authentication[:headers])
|
32
|
+
)
|
9
33
|
|
10
|
-
|
11
|
-
|
12
|
-
|
34
|
+
check_exception_for(response, { rate_limit: true, subdomain_or_token: true })
|
35
|
+
|
36
|
+
response.parsed_response
|
37
|
+
end
|
13
38
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
39
|
+
def self.domestic_taxes(options = {})
|
40
|
+
request_tax_report('domestic_taxes', options)
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.sales_taxes(options = {})
|
44
|
+
request_tax_report('sales_taxes', options)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.vat_moss(options = {})
|
48
|
+
request_tax_report('vat_moss', options)
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.ec_sales(options = {})
|
52
|
+
request_tax_report('ec_sales', options)
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.international_taxes(options = {})
|
56
|
+
request_tax_report('international_taxes', options)
|
57
|
+
end
|
19
58
|
|
20
|
-
|
59
|
+
private
|
21
60
|
|
22
|
-
|
23
|
-
|
61
|
+
def self.request_tax_report(tax_report_type, options)
|
62
|
+
authentication = get_authentication(options.merge(api_model: api_model))
|
63
|
+
filter = options.delete_if { |k,v| %w(auth_token access_token api_url mode api_model).include? k.to_s }
|
24
64
|
|
25
|
-
|
26
|
-
|
27
|
-
|
65
|
+
response = get("#{authentication[:url]}#{api_model.api_path}/#{tax_report_type}.json",
|
66
|
+
query: filter,
|
67
|
+
basic_auth: authentication[:basic_auth],
|
68
|
+
headers: version_header.merge(authentication[:headers])
|
69
|
+
)
|
28
70
|
|
29
|
-
|
30
|
-
query: filter,
|
31
|
-
basic_auth: authentication[:basic_auth],
|
32
|
-
headers: version_header.merge(authentication[:headers])
|
33
|
-
)
|
71
|
+
check_exception_for(response, { rate_limit: true, subdomain_or_token: true })
|
34
72
|
|
35
|
-
|
73
|
+
collection = Array.new
|
74
|
+
response.parsed_response.each { |tax_report| collection << self.new(tax_report) }
|
36
75
|
|
37
|
-
|
38
|
-
end
|
76
|
+
collection
|
39
77
|
end
|
40
78
|
end
|