quaderno 1.5.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/changelog.md +3 -0
- data/lib/quaderno-ruby/base.rb +1 -1
- data/lib/quaderno-ruby/exceptions/exceptions.rb +1 -1
- data/lib/quaderno-ruby.rb +1 -1
- data/quaderno.gemspec +3 -8
- metadata +2 -7
- data/lib/quaderno-ruby/transaction.rb +0 -11
- data/test/fixtures/quaderno_cassettes/deleted_transaction.yml +0 -158
- data/test/fixtures/quaderno_cassettes/found_transaction.yml +0 -56
- data/test/fixtures/quaderno_cassettes/new_transaction.yml +0 -168
- data/test/unit/test_quaderno_transactions.rb +0 -78
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3341f598a7432dcc3657fa59f622d368e53e47a8
|
4
|
+
data.tar.gz: 20a127487c9e668de70515db45858779e5239e5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea3acb979ac8ac4967fa5d4eccb0dd3800a24b78ca3d3aa28dba86fdae7abd93d8fd9b0cf53b1b5d4eaafbaa9e1d87100b39759a33c1158c58de5f43fdf33e2e
|
7
|
+
data.tar.gz: da2969bf1165b381dc506c66dbc8e9e20b72ad57e222320f8eb13174b2413b934e133b52c750b88800ccaf6c737891e2a8a8205d4396825be09d49cc306e25aa
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Quaderno-ruby is a ruby wrapper for [Quaderno API] (https://github.com/quaderno/quaderno-api).
|
4
4
|
As the API, it's mostly CRUD.
|
5
5
|
|
6
|
-
Current version is 1.5.
|
6
|
+
Current version is 1.5.4. See the changelog [here](https://github.com/quaderno/quaderno-ruby/blob/master/changelog.md)
|
7
7
|
|
8
8
|
## Installation & Configuration
|
9
9
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.4
|
data/changelog.md
CHANGED
data/lib/quaderno-ruby/base.rb
CHANGED
@@ -32,7 +32,7 @@ module Quaderno
|
|
32
32
|
|
33
33
|
def self.configure
|
34
34
|
yield self
|
35
|
-
@@base_url = @@environment == :sandbox && !@@subdomain.nil? ? "http://#{@@subdomain}.
|
35
|
+
@@base_url = @@environment == :sandbox && !@@subdomain.nil? ? "http://#{@@subdomain}.sandbox-quadernoapp.com" : "https://#{@@subdomain}.quadernoapp.com"
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.environment=(mode)
|
@@ -24,7 +24,7 @@ module Quaderno
|
|
24
24
|
|
25
25
|
module ClassMethods
|
26
26
|
def check_exception_for(party_response, params = {})
|
27
|
-
if params[:throttle_limit]
|
27
|
+
if params[:throttle_limit].nil? == false
|
28
28
|
raise(Quaderno::Exceptions::ThrottleLimitExceeded, 'Throttle limit exceeded, please try again later') if party_response.response.class == Net::HTTPServiceUnavailable
|
29
29
|
end
|
30
30
|
if params[:rate_limit].nil? == false
|
data/lib/quaderno-ruby.rb
CHANGED
@@ -2,7 +2,7 @@ require 'ostruct'
|
|
2
2
|
|
3
3
|
require 'quaderno-ruby/exceptions/exceptions'
|
4
4
|
%w(crud deliver payment).each { |filename| require "quaderno-ruby/behavior/#{ filename }" }
|
5
|
-
%w(base contact item invoice estimate expense document_item payment webhook tax
|
5
|
+
%w(base contact item invoice estimate expense document_item payment webhook tax).each { |filename| require "quaderno-ruby/#{ filename }" }
|
6
6
|
|
7
7
|
module Quaderno
|
8
8
|
|
data/quaderno.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: quaderno 1.5.
|
5
|
+
# stub: quaderno 1.5.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "quaderno"
|
9
|
-
s.version = "1.5.
|
9
|
+
s.version = "1.5.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Recrea"]
|
14
|
-
s.date = "2014-12-
|
14
|
+
s.date = "2014-12-19"
|
15
15
|
s.description = " A ruby wrapper for Quaderno API "
|
16
16
|
s.email = "carlos@recrea.es"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -42,7 +42,6 @@ Gem::Specification.new do |s|
|
|
42
42
|
"lib/quaderno-ruby/item.rb",
|
43
43
|
"lib/quaderno-ruby/payment.rb",
|
44
44
|
"lib/quaderno-ruby/tax.rb",
|
45
|
-
"lib/quaderno-ruby/transaction.rb",
|
46
45
|
"lib/quaderno-ruby/webhook.rb",
|
47
46
|
"quaderno.gemspec",
|
48
47
|
"test/fixtures/quaderno_cassettes/.DS_Store",
|
@@ -58,7 +57,6 @@ Gem::Specification.new do |s|
|
|
58
57
|
"test/fixtures/quaderno_cassettes/deleted_expense.yml",
|
59
58
|
"test/fixtures/quaderno_cassettes/deleted_invoice.yml",
|
60
59
|
"test/fixtures/quaderno_cassettes/deleted_item.yml",
|
61
|
-
"test/fixtures/quaderno_cassettes/deleted_transaction.yml",
|
62
60
|
"test/fixtures/quaderno_cassettes/deleted_webhook.yml",
|
63
61
|
"test/fixtures/quaderno_cassettes/delivered_estimate.yml",
|
64
62
|
"test/fixtures/quaderno_cassettes/delivered_invoice.yml",
|
@@ -67,14 +65,12 @@ Gem::Specification.new do |s|
|
|
67
65
|
"test/fixtures/quaderno_cassettes/found_expense.yml",
|
68
66
|
"test/fixtures/quaderno_cassettes/found_invoice.yml",
|
69
67
|
"test/fixtures/quaderno_cassettes/found_item.yml",
|
70
|
-
"test/fixtures/quaderno_cassettes/found_transaction.yml",
|
71
68
|
"test/fixtures/quaderno_cassettes/found_webhook.yml",
|
72
69
|
"test/fixtures/quaderno_cassettes/new_contact.yml",
|
73
70
|
"test/fixtures/quaderno_cassettes/new_estimate.yml",
|
74
71
|
"test/fixtures/quaderno_cassettes/new_expense.yml",
|
75
72
|
"test/fixtures/quaderno_cassettes/new_invoice.yml",
|
76
73
|
"test/fixtures/quaderno_cassettes/new_item.yml",
|
77
|
-
"test/fixtures/quaderno_cassettes/new_transaction.yml",
|
78
74
|
"test/fixtures/quaderno_cassettes/new_webhook.yml",
|
79
75
|
"test/fixtures/quaderno_cassettes/paid_expense.yml",
|
80
76
|
"test/fixtures/quaderno_cassettes/paid_invoice.yml",
|
@@ -95,7 +91,6 @@ Gem::Specification.new do |s|
|
|
95
91
|
"test/unit/test_quaderno_invoices.rb",
|
96
92
|
"test/unit/test_quaderno_items.rb",
|
97
93
|
"test/unit/test_quaderno_tax.rb",
|
98
|
-
"test/unit/test_quaderno_transactions.rb",
|
99
94
|
"test/unit/test_quaderno_webhooks.rb"
|
100
95
|
]
|
101
96
|
s.homepage = "http://github.com/quaderno/quaderno-ruby"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quaderno
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recrea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -83,7 +83,6 @@ files:
|
|
83
83
|
- lib/quaderno-ruby/item.rb
|
84
84
|
- lib/quaderno-ruby/payment.rb
|
85
85
|
- lib/quaderno-ruby/tax.rb
|
86
|
-
- lib/quaderno-ruby/transaction.rb
|
87
86
|
- lib/quaderno-ruby/webhook.rb
|
88
87
|
- quaderno.gemspec
|
89
88
|
- test/fixtures/quaderno_cassettes/.DS_Store
|
@@ -99,7 +98,6 @@ files:
|
|
99
98
|
- test/fixtures/quaderno_cassettes/deleted_expense.yml
|
100
99
|
- test/fixtures/quaderno_cassettes/deleted_invoice.yml
|
101
100
|
- test/fixtures/quaderno_cassettes/deleted_item.yml
|
102
|
-
- test/fixtures/quaderno_cassettes/deleted_transaction.yml
|
103
101
|
- test/fixtures/quaderno_cassettes/deleted_webhook.yml
|
104
102
|
- test/fixtures/quaderno_cassettes/delivered_estimate.yml
|
105
103
|
- test/fixtures/quaderno_cassettes/delivered_invoice.yml
|
@@ -108,14 +106,12 @@ files:
|
|
108
106
|
- test/fixtures/quaderno_cassettes/found_expense.yml
|
109
107
|
- test/fixtures/quaderno_cassettes/found_invoice.yml
|
110
108
|
- test/fixtures/quaderno_cassettes/found_item.yml
|
111
|
-
- test/fixtures/quaderno_cassettes/found_transaction.yml
|
112
109
|
- test/fixtures/quaderno_cassettes/found_webhook.yml
|
113
110
|
- test/fixtures/quaderno_cassettes/new_contact.yml
|
114
111
|
- test/fixtures/quaderno_cassettes/new_estimate.yml
|
115
112
|
- test/fixtures/quaderno_cassettes/new_expense.yml
|
116
113
|
- test/fixtures/quaderno_cassettes/new_invoice.yml
|
117
114
|
- test/fixtures/quaderno_cassettes/new_item.yml
|
118
|
-
- test/fixtures/quaderno_cassettes/new_transaction.yml
|
119
115
|
- test/fixtures/quaderno_cassettes/new_webhook.yml
|
120
116
|
- test/fixtures/quaderno_cassettes/paid_expense.yml
|
121
117
|
- test/fixtures/quaderno_cassettes/paid_invoice.yml
|
@@ -136,7 +132,6 @@ files:
|
|
136
132
|
- test/unit/test_quaderno_invoices.rb
|
137
133
|
- test/unit/test_quaderno_items.rb
|
138
134
|
- test/unit/test_quaderno_tax.rb
|
139
|
-
- test/unit/test_quaderno_transactions.rb
|
140
135
|
- test/unit/test_quaderno_webhooks.rb
|
141
136
|
homepage: http://github.com/quaderno/quaderno-ruby
|
142
137
|
licenses:
|
@@ -1,158 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://rkHqiPxs4VFHgtqqjYqw@test-account.sandbox-quadernoapp.com/api/v1/transactions.json
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: country=ES&postal_code=08080&iin=424242&amount=1200&ip=85.155.156.215
|
9
|
-
headers:
|
10
|
-
authorization:
|
11
|
-
- Basic cmtIcWlQeHM0VkZIZ3RxcWpZcXc6
|
12
|
-
response:
|
13
|
-
status:
|
14
|
-
code: 200
|
15
|
-
message: OK
|
16
|
-
headers:
|
17
|
-
server:
|
18
|
-
- nginx/1.6.2
|
19
|
-
date:
|
20
|
-
- Thu, 04 Dec 2014 13:54:30 GMT
|
21
|
-
content-type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
transfer-encoding:
|
24
|
-
- chunked
|
25
|
-
connection:
|
26
|
-
- close
|
27
|
-
status:
|
28
|
-
- 200 OK
|
29
|
-
x-ratelimit-limit:
|
30
|
-
- '2000'
|
31
|
-
x-ratelimit-remaining:
|
32
|
-
- '1895'
|
33
|
-
x-ua-compatible:
|
34
|
-
- IE=Edge,chrome=1
|
35
|
-
etag:
|
36
|
-
- '"f285f54b8a0f537224daee598b6711d4"'
|
37
|
-
cache-control:
|
38
|
-
- max-age=0, private, must-revalidate
|
39
|
-
set-cookie:
|
40
|
-
- ahoy_visitor=0630f037-52d1-40b9-91b9-064ff28c4fc9; domain=.sandbox-quadernoapp.com;
|
41
|
-
path=/; expires=Sun, 04-Dec-2016 13:54:27 GMT
|
42
|
-
- ahoy_visit=a2d8164e-1d18-440c-8aa8-a3e6f5f897aa; domain=.sandbox-quadernoapp.com;
|
43
|
-
path=/; expires=Thu, 04-Dec-2014 17:54:27 GMT
|
44
|
-
- ahoy_track=true; domain=.sandbox-quadernoapp.com; path=/
|
45
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJTczYzAwMTM2M2Q2YzYwYTIzOWQyMzJlZDhjYWFiMjQ2BjsAVA%3D%3D--bcf144190c60c41ad50a5cf50ae775ab7c6049d4;
|
46
|
-
domain=sandbox-quadernoapp.com; path=/; HttpOnly
|
47
|
-
x-request-id:
|
48
|
-
- 513e1c32a3e2153376043b94b713be4c
|
49
|
-
x-runtime:
|
50
|
-
- '2.340178'
|
51
|
-
x-rack-cache:
|
52
|
-
- invalidate, pass
|
53
|
-
body:
|
54
|
-
encoding: UTF-8
|
55
|
-
string: '{"id":37,"tax_name":null,"tax_rate":0.0,"amount":1200,"tax_amount":0,"total_amount":1200}'
|
56
|
-
http_version: '1.1'
|
57
|
-
recorded_at: Thu, 04 Dec 2014 13:54:30 GMT
|
58
|
-
- request:
|
59
|
-
method: delete
|
60
|
-
uri: http://rkHqiPxs4VFHgtqqjYqw@test-account.sandbox-quadernoapp.com/api/v1/transactions/37.json
|
61
|
-
body:
|
62
|
-
encoding: US-ASCII
|
63
|
-
string: ''
|
64
|
-
headers:
|
65
|
-
authorization:
|
66
|
-
- Basic cmtIcWlQeHM0VkZIZ3RxcWpZcXc6
|
67
|
-
response:
|
68
|
-
status:
|
69
|
-
code: 204
|
70
|
-
message: No Content
|
71
|
-
headers:
|
72
|
-
server:
|
73
|
-
- nginx/1.6.2
|
74
|
-
date:
|
75
|
-
- Thu, 04 Dec 2014 13:54:30 GMT
|
76
|
-
connection:
|
77
|
-
- close
|
78
|
-
status:
|
79
|
-
- 204 No Content
|
80
|
-
x-ratelimit-limit:
|
81
|
-
- '2000'
|
82
|
-
x-ratelimit-remaining:
|
83
|
-
- '1894'
|
84
|
-
x-ua-compatible:
|
85
|
-
- IE=Edge,chrome=1
|
86
|
-
cache-control:
|
87
|
-
- no-cache
|
88
|
-
set-cookie:
|
89
|
-
- ahoy_visitor=0acea62b-ccc1-4889-b7e9-4390320ea7f5; domain=.sandbox-quadernoapp.com;
|
90
|
-
path=/; expires=Sun, 04-Dec-2016 13:54:30 GMT
|
91
|
-
- ahoy_visit=f306e6e8-1ebb-4c54-8312-9cebe4f2b325; domain=.sandbox-quadernoapp.com;
|
92
|
-
path=/; expires=Thu, 04-Dec-2014 17:54:30 GMT
|
93
|
-
- ahoy_track=true; domain=.sandbox-quadernoapp.com; path=/
|
94
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJWVhYTdiYmU4NmM1ZmY0NGZlZGZhMjM1N2RiODc0YjM1BjsAVA%3D%3D--ef2532e2bad0d52b6a962453dd8ad4873a9cde24;
|
95
|
-
domain=sandbox-quadernoapp.com; path=/; HttpOnly
|
96
|
-
x-request-id:
|
97
|
-
- ba917f6dad1bdba6691958701dda500b
|
98
|
-
x-runtime:
|
99
|
-
- '0.059911'
|
100
|
-
x-rack-cache:
|
101
|
-
- invalidate, pass
|
102
|
-
body:
|
103
|
-
encoding: US-ASCII
|
104
|
-
string: ''
|
105
|
-
http_version: '1.1'
|
106
|
-
recorded_at: Thu, 04 Dec 2014 13:54:30 GMT
|
107
|
-
- request:
|
108
|
-
method: get
|
109
|
-
uri: http://rkHqiPxs4VFHgtqqjYqw@test-account.sandbox-quadernoapp.com/api/v1/transactions/37.json
|
110
|
-
body:
|
111
|
-
encoding: US-ASCII
|
112
|
-
string: ''
|
113
|
-
headers:
|
114
|
-
authorization:
|
115
|
-
- Basic cmtIcWlQeHM0VkZIZ3RxcWpZcXc6
|
116
|
-
response:
|
117
|
-
status:
|
118
|
-
code: 401
|
119
|
-
message: Unauthorized
|
120
|
-
headers:
|
121
|
-
server:
|
122
|
-
- nginx/1.6.2
|
123
|
-
date:
|
124
|
-
- Thu, 04 Dec 2014 13:54:31 GMT
|
125
|
-
content-type:
|
126
|
-
- application/json; charset=utf-8
|
127
|
-
transfer-encoding:
|
128
|
-
- chunked
|
129
|
-
connection:
|
130
|
-
- close
|
131
|
-
status:
|
132
|
-
- 401 Unauthorized
|
133
|
-
x-ratelimit-limit:
|
134
|
-
- '2000'
|
135
|
-
x-ratelimit-remaining:
|
136
|
-
- '1893'
|
137
|
-
x-ua-compatible:
|
138
|
-
- IE=Edge,chrome=1
|
139
|
-
cache-control:
|
140
|
-
- no-cache, private
|
141
|
-
set-cookie:
|
142
|
-
- ahoy_visitor=35e27e33-a940-4f0e-99ac-69428b49a0a7; domain=.sandbox-quadernoapp.com;
|
143
|
-
path=/; expires=Sun, 04-Dec-2016 13:54:31 GMT
|
144
|
-
- ahoy_visit=63e91bd4-65ce-4425-9fa5-b9185fda6785; domain=.sandbox-quadernoapp.com;
|
145
|
-
path=/; expires=Thu, 04-Dec-2014 17:54:31 GMT
|
146
|
-
- ahoy_track=true; domain=.sandbox-quadernoapp.com; path=/
|
147
|
-
x-request-id:
|
148
|
-
- 14c73e0c11b8e38324bbd94d112fe68f
|
149
|
-
x-runtime:
|
150
|
-
- '0.044463'
|
151
|
-
x-rack-cache:
|
152
|
-
- miss
|
153
|
-
body:
|
154
|
-
encoding: UTF-8
|
155
|
-
string: '{"error":"Unauthorized access or transaction does not exist."}'
|
156
|
-
http_version: '1.1'
|
157
|
-
recorded_at: Thu, 04 Dec 2014 13:54:31 GMT
|
158
|
-
recorded_with: VCR 2.9.2
|
@@ -1,56 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: http://rkHqiPxs4VFHgtqqjYqw@test-account.sandbox-quadernoapp.com/api/v1/transactions/18.json
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
authorization:
|
11
|
-
- Basic cmtIcWlQeHM0VkZIZ3RxcWpZcXc6
|
12
|
-
response:
|
13
|
-
status:
|
14
|
-
code: 200
|
15
|
-
message: OK
|
16
|
-
headers:
|
17
|
-
server:
|
18
|
-
- nginx/1.6.2
|
19
|
-
date:
|
20
|
-
- Thu, 04 Dec 2014 13:45:20 GMT
|
21
|
-
content-type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
transfer-encoding:
|
24
|
-
- chunked
|
25
|
-
connection:
|
26
|
-
- close
|
27
|
-
status:
|
28
|
-
- 200 OK
|
29
|
-
x-ratelimit-limit:
|
30
|
-
- '2000'
|
31
|
-
x-ratelimit-remaining:
|
32
|
-
- '1901'
|
33
|
-
last-modified:
|
34
|
-
- Thu, 04 Dec 2014 12:14:01 GMT
|
35
|
-
cache-control:
|
36
|
-
- must-revalidate, private, max-age=0
|
37
|
-
x-ua-compatible:
|
38
|
-
- IE=Edge,chrome=1
|
39
|
-
set-cookie:
|
40
|
-
- ahoy_visitor=a3a7ea1f-ae44-4804-8509-5b901d685a9f; domain=.sandbox-quadernoapp.com;
|
41
|
-
path=/; expires=Sun, 04-Dec-2016 13:45:20 GMT
|
42
|
-
- ahoy_visit=d449d294-6f7f-4c4c-8710-d0db6010e863; domain=.sandbox-quadernoapp.com;
|
43
|
-
path=/; expires=Thu, 04-Dec-2014 17:45:20 GMT
|
44
|
-
- ahoy_track=true; domain=.sandbox-quadernoapp.com; path=/
|
45
|
-
x-request-id:
|
46
|
-
- 0c57a4f541a26832504285c5d15beb76
|
47
|
-
x-runtime:
|
48
|
-
- '0.056580'
|
49
|
-
x-rack-cache:
|
50
|
-
- miss
|
51
|
-
body:
|
52
|
-
encoding: UTF-8
|
53
|
-
string: '{"id":18,"tax_name":"IGIC","tax_rate":7.0,"amount":1200,"tax_amount":84,"total_amount":1284}'
|
54
|
-
http_version: '1.1'
|
55
|
-
recorded_at: Thu, 04 Dec 2014 13:45:20 GMT
|
56
|
-
recorded_with: VCR 2.9.2
|
@@ -1,168 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://rkHqiPxs4VFHgtqqjYqw@test-account.sandbox-quadernoapp.com/api/v1/transactions.json
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: country=ES&postal_code=35003&iin=424242&amount=1200&ip=85.155.157.215
|
9
|
-
headers:
|
10
|
-
authorization:
|
11
|
-
- Basic cmtIcWlQeHM0VkZIZ3RxcWpZcXc6
|
12
|
-
response:
|
13
|
-
status:
|
14
|
-
code: 200
|
15
|
-
message: OK
|
16
|
-
headers:
|
17
|
-
server:
|
18
|
-
- nginx/1.6.2
|
19
|
-
date:
|
20
|
-
- Thu, 04 Dec 2014 13:45:16 GMT
|
21
|
-
content-type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
transfer-encoding:
|
24
|
-
- chunked
|
25
|
-
connection:
|
26
|
-
- close
|
27
|
-
status:
|
28
|
-
- 200 OK
|
29
|
-
x-ratelimit-limit:
|
30
|
-
- '2000'
|
31
|
-
x-ratelimit-remaining:
|
32
|
-
- '1907'
|
33
|
-
x-ua-compatible:
|
34
|
-
- IE=Edge,chrome=1
|
35
|
-
etag:
|
36
|
-
- '"8e364ca38768f22d2a62dc71be9c223b"'
|
37
|
-
cache-control:
|
38
|
-
- max-age=0, private, must-revalidate
|
39
|
-
set-cookie:
|
40
|
-
- ahoy_visitor=56c36791-5d3b-4f3f-ab5b-99fb0eab2f54; domain=.sandbox-quadernoapp.com;
|
41
|
-
path=/; expires=Sun, 04-Dec-2016 13:45:16 GMT
|
42
|
-
- ahoy_visit=788482b8-87f7-4247-a2d5-840baa45f0ea; domain=.sandbox-quadernoapp.com;
|
43
|
-
path=/; expires=Thu, 04-Dec-2014 17:45:16 GMT
|
44
|
-
- ahoy_track=true; domain=.sandbox-quadernoapp.com; path=/
|
45
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJTgxZGFkZTY1ZThiZGZjMDljZDI1ZWRkODUxNjA1YzkyBjsAVA%3D%3D--0664177c24eccb156a3e29262d479738760f0fce;
|
46
|
-
domain=sandbox-quadernoapp.com; path=/; HttpOnly
|
47
|
-
x-request-id:
|
48
|
-
- a4dccd55e77728154d72e4a81ca87084
|
49
|
-
x-runtime:
|
50
|
-
- '0.217282'
|
51
|
-
x-rack-cache:
|
52
|
-
- invalidate, pass
|
53
|
-
body:
|
54
|
-
encoding: UTF-8
|
55
|
-
string: '{"id":33,"tax_name":"IGIC","tax_rate":7.0,"amount":1200,"tax_amount":84,"total_amount":1284}'
|
56
|
-
http_version: '1.1'
|
57
|
-
recorded_at: Thu, 04 Dec 2014 13:45:16 GMT
|
58
|
-
- request:
|
59
|
-
method: post
|
60
|
-
uri: http://rkHqiPxs4VFHgtqqjYqw@test-account.sandbox-quadernoapp.com/api/v1/transactions.json
|
61
|
-
body:
|
62
|
-
encoding: UTF-8
|
63
|
-
string: country=ES&postal_code=35003&iin=424242&amount=1200&ip=85.155.157.215
|
64
|
-
headers:
|
65
|
-
authorization:
|
66
|
-
- Basic cmtIcWlQeHM0VkZIZ3RxcWpZcXc6
|
67
|
-
response:
|
68
|
-
status:
|
69
|
-
code: 200
|
70
|
-
message: OK
|
71
|
-
headers:
|
72
|
-
server:
|
73
|
-
- nginx/1.6.2
|
74
|
-
date:
|
75
|
-
- Thu, 04 Dec 2014 13:45:17 GMT
|
76
|
-
content-type:
|
77
|
-
- application/json; charset=utf-8
|
78
|
-
transfer-encoding:
|
79
|
-
- chunked
|
80
|
-
connection:
|
81
|
-
- close
|
82
|
-
status:
|
83
|
-
- 200 OK
|
84
|
-
x-ratelimit-limit:
|
85
|
-
- '2000'
|
86
|
-
x-ratelimit-remaining:
|
87
|
-
- '1906'
|
88
|
-
x-ua-compatible:
|
89
|
-
- IE=Edge,chrome=1
|
90
|
-
etag:
|
91
|
-
- '"4b5cced371158aa38def383d8f0bfb5a"'
|
92
|
-
cache-control:
|
93
|
-
- max-age=0, private, must-revalidate
|
94
|
-
set-cookie:
|
95
|
-
- ahoy_visitor=40bd7748-a4ab-4436-9b66-ea47a0010947; domain=.sandbox-quadernoapp.com;
|
96
|
-
path=/; expires=Sun, 04-Dec-2016 13:45:17 GMT
|
97
|
-
- ahoy_visit=59defdfa-8952-4734-ae0e-94bdda1faaae; domain=.sandbox-quadernoapp.com;
|
98
|
-
path=/; expires=Thu, 04-Dec-2014 17:45:17 GMT
|
99
|
-
- ahoy_track=true; domain=.sandbox-quadernoapp.com; path=/
|
100
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJWQ5MmJkNGQzNTkzNzc4NGYwYzM1MjNhNzVmZjc1NTAyBjsAVA%3D%3D--45933484fbb855cd8227c0f49e84b4e9a9ca2c9b;
|
101
|
-
domain=sandbox-quadernoapp.com; path=/; HttpOnly
|
102
|
-
x-request-id:
|
103
|
-
- 914fde2d81b31656f5b3e4ac46654380
|
104
|
-
x-runtime:
|
105
|
-
- '0.166646'
|
106
|
-
x-rack-cache:
|
107
|
-
- invalidate, pass
|
108
|
-
body:
|
109
|
-
encoding: UTF-8
|
110
|
-
string: '{"id":34,"tax_name":"IGIC","tax_rate":7.0,"amount":1200,"tax_amount":84,"total_amount":1284}'
|
111
|
-
http_version: '1.1'
|
112
|
-
recorded_at: Thu, 04 Dec 2014 13:45:17 GMT
|
113
|
-
- request:
|
114
|
-
method: post
|
115
|
-
uri: http://rkHqiPxs4VFHgtqqjYqw@test-account.sandbox-quadernoapp.com/api/v1/transactions.json
|
116
|
-
body:
|
117
|
-
encoding: UTF-8
|
118
|
-
string: country=ES&postal_code=08080&iin=424242&amount=1200&ip=85.155.156.215
|
119
|
-
headers:
|
120
|
-
authorization:
|
121
|
-
- Basic cmtIcWlQeHM0VkZIZ3RxcWpZcXc6
|
122
|
-
response:
|
123
|
-
status:
|
124
|
-
code: 200
|
125
|
-
message: OK
|
126
|
-
headers:
|
127
|
-
server:
|
128
|
-
- nginx/1.6.2
|
129
|
-
date:
|
130
|
-
- Thu, 04 Dec 2014 13:45:17 GMT
|
131
|
-
content-type:
|
132
|
-
- application/json; charset=utf-8
|
133
|
-
transfer-encoding:
|
134
|
-
- chunked
|
135
|
-
connection:
|
136
|
-
- close
|
137
|
-
status:
|
138
|
-
- 200 OK
|
139
|
-
x-ratelimit-limit:
|
140
|
-
- '2000'
|
141
|
-
x-ratelimit-remaining:
|
142
|
-
- '1905'
|
143
|
-
x-ua-compatible:
|
144
|
-
- IE=Edge,chrome=1
|
145
|
-
etag:
|
146
|
-
- '"edc2c6a6a28827d40c387eab9e9c8366"'
|
147
|
-
cache-control:
|
148
|
-
- max-age=0, private, must-revalidate
|
149
|
-
set-cookie:
|
150
|
-
- ahoy_visitor=25850cb6-d521-4d42-835c-9107ec548daf; domain=.sandbox-quadernoapp.com;
|
151
|
-
path=/; expires=Sun, 04-Dec-2016 13:45:17 GMT
|
152
|
-
- ahoy_visit=9faf49c4-5639-4869-aced-81da1a6e3073; domain=.sandbox-quadernoapp.com;
|
153
|
-
path=/; expires=Thu, 04-Dec-2014 17:45:17 GMT
|
154
|
-
- ahoy_track=true; domain=.sandbox-quadernoapp.com; path=/
|
155
|
-
- _quaderno_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJTVlMzg1ZGZmOWZhZGEzODJhNjk0ZjEyY2VhYjUxYzg3BjsAVA%3D%3D--379bbbe281b0dfbf0766879837ff3d2d7b931a9b;
|
156
|
-
domain=sandbox-quadernoapp.com; path=/; HttpOnly
|
157
|
-
x-request-id:
|
158
|
-
- cf6bc554b8f0659e2595c5dd7e6ff7a9
|
159
|
-
x-runtime:
|
160
|
-
- '0.167067'
|
161
|
-
x-rack-cache:
|
162
|
-
- invalidate, pass
|
163
|
-
body:
|
164
|
-
encoding: UTF-8
|
165
|
-
string: '{"id":35,"tax_name":null,"tax_rate":0.0,"amount":1200,"tax_amount":0,"total_amount":1200}'
|
166
|
-
http_version: '1.1'
|
167
|
-
recorded_at: Thu, 04 Dec 2014 13:45:18 GMT
|
168
|
-
recorded_with: VCR 2.9.2
|
@@ -1,78 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
class TestQuadernoTransaction < Test::Unit::TestCase
|
4
|
-
context "A user with an authenticate token with transactions" do
|
5
|
-
|
6
|
-
setup do
|
7
|
-
Quaderno::Base.configure do |config|
|
8
|
-
config.auth_token = 'rkHqiPxs4VFHgtqqjYqw'
|
9
|
-
config.subdomain = 'test-account'
|
10
|
-
config.environment = :sandbox
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
should "get exception if pass wrong arguments" do
|
15
|
-
assert_raise ArgumentError do
|
16
|
-
VCR.use_cassette('found transaction') do
|
17
|
-
Quaderno::Transaction.find
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
should "find a transaction" do
|
23
|
-
VCR.use_cassette('found transaction') do
|
24
|
-
transaction = Quaderno::Transaction.find 18
|
25
|
-
|
26
|
-
assert_kind_of Quaderno::Transaction, transaction
|
27
|
-
assert_equal "IGIC", transaction.tax_name
|
28
|
-
assert_equal 7.0, transaction.tax_rate
|
29
|
-
assert_equal 1200, transaction.amount
|
30
|
-
assert_equal 84, transaction.tax_amount
|
31
|
-
assert_equal 1284, transaction.total_amount
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
should "create a transaction" do
|
36
|
-
VCR.use_cassette('new transaction') do
|
37
|
-
#Canarian company to a canarian consumer
|
38
|
-
transaction = Quaderno::Transaction.create(country: 'ES', postal_code: '35003', iin: '424242', amount: 1200, ip: '85.155.157.215')
|
39
|
-
|
40
|
-
assert_kind_of Quaderno::Transaction, transaction
|
41
|
-
assert_equal "IGIC", transaction.tax_name
|
42
|
-
assert_equal 7.0, transaction.tax_rate
|
43
|
-
assert_equal 1200, transaction.amount
|
44
|
-
assert_equal 84, transaction.tax_amount
|
45
|
-
assert_equal 1284, transaction.total_amount
|
46
|
-
|
47
|
-
transaction = Quaderno::Transaction.create(country: 'ES', postal_code: '35003', iin: '424242', amount: 1200, ip: '85.155.157.215')
|
48
|
-
|
49
|
-
assert_kind_of Quaderno::Transaction, transaction
|
50
|
-
assert_equal "IGIC", transaction.tax_name
|
51
|
-
assert_equal 7.0, transaction.tax_rate
|
52
|
-
assert_equal 1200, transaction.amount
|
53
|
-
assert_equal 84, transaction.tax_amount
|
54
|
-
assert_equal 1284, transaction.total_amount
|
55
|
-
|
56
|
-
#Canarian company to a non Canarian Spanish consumer
|
57
|
-
transaction = Quaderno::Transaction.create(country: 'ES', postal_code: '08080', iin: '424242', amount: 1200, ip: '85.155.156.215')
|
58
|
-
|
59
|
-
assert_kind_of Quaderno::Transaction, transaction
|
60
|
-
assert transaction.tax_name.nil?
|
61
|
-
assert_equal 0, transaction.tax_rate
|
62
|
-
assert_equal 1200, transaction.amount
|
63
|
-
assert_equal 0, transaction.tax_amount
|
64
|
-
assert_equal 1200, transaction.total_amount
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
should "delete a transaction" do
|
69
|
-
VCR.use_cassette('deleted transaction') do
|
70
|
-
new_transaction = Quaderno::Transaction.create(country: 'ES', postal_code: '08080', iin: '424242', amount: 1200, ip: '85.155.156.215')
|
71
|
-
Quaderno::Transaction.delete new_transaction.id
|
72
|
-
assert_raise Quaderno::Exceptions::InvalidSubdomainOrToken do
|
73
|
-
Quaderno::Transaction.find new_transaction.id
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|