pactas_itero 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1bc6c5dcbd7b3d3452d98aaa6fa08a4f2293a940
4
- data.tar.gz: ab8d8da8107bf030a685408492e9c6811ebdde00
2
+ SHA256:
3
+ metadata.gz: 963c5cd869bf3d165f342a3cd58227e1b20017f5810dced3e6c332f88ef9e64a
4
+ data.tar.gz: 17c378b016b8262023d23a49954b557e259397941f90952a2bd70ca5427a10de
5
5
  SHA512:
6
- metadata.gz: 5041f67b356be598b7205fdfe4c108cfb83213ffce791f5970a0205129367bf4853381a358b615cafc60048d2ab68f2c67424b75a70c04b5aef17bbb49073b1d
7
- data.tar.gz: 3783e55053dfb19c92296a7a890b94415be4ad7b45db4e99fd4b5243f490f74cf4e460b9fd9f9a08b84241a48d724ccd87ed6c2fb4e2e45ae06315de0d4a997d
6
+ metadata.gz: 43b6511d3f33da7079754cc4cbe972e9fb82aadffea500056a1cd2e8df2e185cd23941c754c9aa89656769ce7071146d511738e57f316c6a2b2b6ca61990aa5b
7
+ data.tar.gz: 8ee6479051a4adfd6476b3c765746eae9ec1328263ccb48307c5eb4e607c5e334033251d4e6209a3d7a724f274e7543cbaf44e5cdcbbbfbe1c574d8a0fb7b8ca
@@ -11,6 +11,13 @@
11
11
 
12
12
  ### Security
13
13
 
14
+ ## [0.4.0] - 2019-04-30
15
+ ### Added
16
+ * download Invoices as PDF (#60)
17
+
18
+ ### Changed
19
+ * new prodcution endpoint (#45)
20
+
14
21
  ## [0.3.0] - 2017-09-04
15
22
  ### Added
16
23
  - get a self service token for a given contract
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pactas_itero (0.2.0)
4
+ pactas_itero (0.3.0)
5
5
  faraday_middleware (>= 0.9.1, < 0.12)
6
6
  rash
7
7
 
@@ -10,19 +10,25 @@ GEM
10
10
  specs:
11
11
  addressable (2.5.0)
12
12
  public_suffix (~> 2.0, >= 2.0.2)
13
+ ast (2.4.0)
13
14
  crack (0.4.3)
14
15
  safe_yaml (~> 1.0.0)
15
16
  diff-lcs (1.3)
16
17
  docile (1.1.5)
17
- faraday (0.12.2)
18
+ faraday (0.14.0)
18
19
  multipart-post (>= 1.2, < 3)
19
20
  faraday_middleware (0.11.0.1)
20
21
  faraday (>= 0.7.4, < 1.0)
21
22
  hashdiff (0.3.2)
22
23
  hashie (2.0.5)
23
- json (2.0.2)
24
+ json (2.1.0)
24
25
  multipart-post (2.0.0)
26
+ parallel (1.12.1)
27
+ parser (2.5.0.5)
28
+ ast (~> 2.4.0)
29
+ powerpack (0.1.1)
25
30
  public_suffix (2.0.4)
31
+ rainbow (3.0.0)
26
32
  rake (10.4.2)
27
33
  rash (0.4.0)
28
34
  hashie (~> 2.0.0)
@@ -39,12 +45,21 @@ GEM
39
45
  diff-lcs (>= 1.2.0, < 2.0)
40
46
  rspec-support (~> 3.6.0)
41
47
  rspec-support (3.6.0)
48
+ rubocop (0.52.1)
49
+ parallel (~> 1.10)
50
+ parser (>= 2.4.0.2, < 3.0)
51
+ powerpack (~> 0.1)
52
+ rainbow (>= 2.2.2, < 4.0)
53
+ ruby-progressbar (~> 1.7)
54
+ unicode-display_width (~> 1.0, >= 1.0.1)
55
+ ruby-progressbar (1.9.0)
42
56
  safe_yaml (1.0.4)
43
- simplecov (0.12.0)
57
+ simplecov (0.15.1)
44
58
  docile (~> 1.1.0)
45
59
  json (>= 1.8, < 3)
46
60
  simplecov-html (~> 0.10.0)
47
- simplecov-html (0.10.0)
61
+ simplecov-html (0.10.2)
62
+ unicode-display_width (1.3.0)
48
63
  webmock (2.3.2)
49
64
  addressable (>= 2.3.6)
50
65
  crack (>= 0.3.2)
@@ -58,8 +73,9 @@ DEPENDENCIES
58
73
  pactas_itero!
59
74
  rake
60
75
  rspec (~> 3.6.0)
61
- simplecov (~> 0.12.0)
76
+ rubocop (~> 0.52.1)
77
+ simplecov (~> 0.15.0)
62
78
  webmock (~> 2.3)
63
79
 
64
80
  BUNDLED WITH
65
- 1.15.3
81
+ 1.16.1
@@ -20,6 +20,11 @@ module PactasItero
20
20
  options = options.camelize_keys
21
21
  get "api/v1/invoices/#{invoice_id}", options
22
22
  end
23
+
24
+ def invoice_download(invoice_id, options = {})
25
+ options = options.camelize_keys
26
+ get "api/v1/invoices/#{invoice_id}/download", options
27
+ end
23
28
  end
24
29
  end
25
30
  end
@@ -9,7 +9,7 @@ module PactasItero
9
9
 
10
10
  SANDBOX_API_ENDPOINT = "https://sandbox.billwerk.com".freeze
11
11
 
12
- PRODUCTION_API_ENDPOINT = "https://itero.pactas.com".freeze
12
+ PRODUCTION_API_ENDPOINT = "https://app.billwerk.com".freeze
13
13
 
14
14
  PRODUCTION = false
15
15
 
@@ -1,3 +1,3 @@
1
1
  module PactasItero
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.4.0".freeze
3
3
  end
@@ -84,4 +84,20 @@ describe PactasItero::Api::Invoices do
84
84
  expect(request).to have_been_made
85
85
  end
86
86
  end
87
+
88
+ describe '.invoice_download' do
89
+ it "returns the pdf as a string after requesting the correct resource" do
90
+ client = PactasItero::Client.new(bearer_token: 'bt')
91
+ request = stub_get('/api/v1/invoices/54b67d9e995ec90bc8f37718/download').
92
+ to_return(
93
+ body: fixture('invoice_download.pdf'),
94
+ headers: { content_type: 'application/pdf'}
95
+ )
96
+
97
+ response = client.invoice_download('54b67d9e995ec90bc8f37718')
98
+
99
+ expect(request).to have_been_made
100
+ expect(response.class).to be String
101
+ end
102
+ end
87
103
  end
@@ -200,7 +200,7 @@ describe PactasItero::Client do
200
200
  it "uses the production endpoint when production is set to true" do
201
201
  client = PactasItero::Client.new(production: true)
202
202
 
203
- expect(client.api_endpoint).to eq 'https://itero.pactas.com/'
203
+ expect(client.api_endpoint).to eq "https://app.billwerk.com/"
204
204
  end
205
205
 
206
206
  it "sets a default user agent" do
@@ -310,7 +310,7 @@ describe PactasItero::Client do
310
310
  it 'returns url of the sandbox endpoint' do
311
311
  client = PactasItero::Client.new
312
312
 
313
- expect(client.production_api_endpoint).to eq 'https://itero.pactas.com'
313
+ expect(client.production_api_endpoint).to eq "https://app.billwerk.com"
314
314
  end
315
315
  end
316
316
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pactas_itero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Fröhler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-04 00:00:00.000000000 Z
11
+ date: 2019-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday_middleware
@@ -45,7 +45,7 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: bundler
48
+ name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
@@ -59,61 +59,61 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: rake
62
+ name: rspec
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ">="
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0'
67
+ version: 3.8.0
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ">="
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '0'
74
+ version: 3.8.0
75
75
  - !ruby/object:Gem::Dependency
76
- name: rspec
76
+ name: rubocop
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 3.6.0
81
+ version: 0.52.1
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 3.6.0
88
+ version: 0.52.1
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: simplecov
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 0.15.0
95
+ version: 0.16.1
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 0.15.0
102
+ version: 0.16.1
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: webmock
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '2.3'
109
+ version: '3.3'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '2.3'
116
+ version: '3.3'
117
117
  description: |-
118
118
  pactas_itero provides a client mapping for accessing
119
119
  the Pactas Itero API, making it easy to post your data to, adn read your
@@ -156,6 +156,7 @@ files:
156
156
  - spec/fixtures/customer.json
157
157
  - spec/fixtures/customers.json
158
158
  - spec/fixtures/invoice.json
159
+ - spec/fixtures/invoice_download.pdf
159
160
  - spec/fixtures/invoices.json
160
161
  - spec/fixtures/order.json
161
162
  - spec/fixtures/payment_transaction.json
@@ -190,8 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  - !ruby/object:Gem::Version
191
192
  version: '0'
192
193
  requirements: []
193
- rubyforge_project:
194
- rubygems_version: 2.6.13
194
+ rubygems_version: 3.0.3
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: pactas_itero provides a client mapping for accessing the Pactas Itero API.
@@ -207,6 +207,7 @@ test_files:
207
207
  - spec/fixtures/customer.json
208
208
  - spec/fixtures/customers.json
209
209
  - spec/fixtures/invoice.json
210
+ - spec/fixtures/invoice_download.pdf
210
211
  - spec/fixtures/invoices.json
211
212
  - spec/fixtures/order.json
212
213
  - spec/fixtures/payment_transaction.json