fattura24 1.0.0 → 1.0.1

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
2
  SHA256:
3
- metadata.gz: 0e934fe8759d86f4496f479edf1a3f08e4f76897f33ba01b8bd719b3e6ed948b
4
- data.tar.gz: 15df3a4e5e7bea14a0faa4c6efa27f4f0c3d38799a5f67468ff73559e7225138
3
+ metadata.gz: 77ff34df45eb0015f41015e7ef0c382243c6a4917e6b7daefe05f0a6262ad024
4
+ data.tar.gz: 2691e00ed33979575aa89c227f0e3884a3b8774df6beb535ce21cf8571e763b9
5
5
  SHA512:
6
- metadata.gz: 9a85ba7a87636c19a547b98587ad1e1ab5678529571d24e582e49bf8a8ab550ea096b4f4a15600b6fefe504029b1371f8267707fe6893d1ec91f123effc0c7e7
7
- data.tar.gz: 4518e73a7700f1a63ec15729b42d24866dc00fece3a601e5b6f51180093dec248318539a974a7ba72efcba52c7433fc68d0aaed94be95b01e9934388444ea888
6
+ metadata.gz: 503b8f59559c148c5f5265f152bca5423776192aaa14af31bfd57613905f487b560173f090aac2d0d86014f5d9ded589c0a7ad8f085f4e333f3f344bc7992c54
7
+ data.tar.gz: 48a73cd8b5307d7b723b4283eeb66789d30d500af6bed174fccb0f7776cc7c84b07308ff24b26b3ab929cf07b997afedc9618a6f2b6142c8746bda0d93838473
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Maintainability](https://api.codeclimate.com/v1/badges/8db0d6f2c8e567f09319/maintainability)](https://codeclimate.com/github/snada/fattura24/maintainability)
5
5
  [![Test Coverage](https://api.codeclimate.com/v1/badges/8db0d6f2c8e567f09319/test_coverage)](https://codeclimate.com/github/snada/fattura24/test_coverage)
6
6
 
7
- Simple, lightweight and with minimal dependencies ruby 2 wrapper for the [Fattura24](https://www.fattura24.com/) apis.
7
+ Simple, lightweight and with minimal dependencies ruby 2+ wrapper for the [Fattura24](https://www.fattura24.com/) apis.
8
8
 
9
9
  Tested and developed on rubies 2.4+.
10
10
 
@@ -93,6 +93,7 @@ r = Fattura24::Api.save_document(
93
93
  customer_address: '100 Yonge Street',
94
94
  customer_city: 'Toronto',
95
95
  customer_country: 'CA',
96
+ fe_payment_code: Fattura24::FePaymentCode::CREDIT_CARD,
96
97
  payments: [
97
98
  {
98
99
  date: '2020-04-27',
data/docs/Fattura24.html CHANGED
@@ -21,7 +21,6 @@
21
21
  <link href="./css/rdoc.css" rel="stylesheet">
22
22
 
23
23
 
24
-
25
24
  <body id="top" role="document" class="module">
26
25
  <nav role="navigation">
27
26
  <div id="project-navigation">
@@ -61,16 +60,14 @@
61
60
 
62
61
 
63
62
 
64
- <!-- Method Quickref -->
63
+
64
+ <!-- Method Quickref -->
65
65
  <div id="method-list-section" class="nav-section">
66
66
  <h3>Methods</h3>
67
67
 
68
68
  <ul class="link-list" role="directory">
69
-
70
69
  <li ><a href="#method-c-configuration">::configuration</a>
71
-
72
70
  <li ><a href="#method-c-configure">::configure</a>
73
-
74
71
  </ul>
75
72
  </div>
76
73
 
@@ -86,112 +83,77 @@
86
83
 
87
84
  </section>
88
85
 
89
-
90
86
  <section id="5Buntitled-5D" class="documentation-section">
91
-
92
87
 
93
-
94
88
 
95
-
96
89
  <section class="constants-list">
97
90
  <header>
98
91
  <h3>Constants</h3>
99
92
  </header>
100
93
  <dl>
101
-
102
94
  <dt id="VERSION">VERSION
103
-
104
95
  <dd>
105
-
106
-
107
96
  </dl>
108
97
  </section>
109
-
110
98
 
111
-
112
99
 
113
-
100
+
114
101
  <section id="public-class-5Buntitled-5D-method-details" class="method-section">
115
102
  <header>
116
103
  <h3>Public Class Methods</h3>
117
104
  </header>
118
105
 
119
-
120
106
  <div id="method-c-configuration" class="method-detail ">
121
-
122
107
  <div class="method-heading">
123
108
  <span class="method-name">configuration</span><span
124
109
  class="method-args">()</span>
125
-
126
110
  <span class="method-click-advice">click to toggle source</span>
127
-
128
111
  </div>
129
-
130
112
 
131
113
  <div class="method-description">
132
-
133
114
  <p>Returns current configuration object</p>
134
-
135
-
136
115
 
137
-
138
116
  <div class="method-source-code" id="configuration-source">
139
- <pre><span class="ruby-comment"># File lib/fattura24.rb, line 18</span>
117
+ <pre><span class="ruby-comment"># File lib/fattura24.rb, line 19</span>
140
118
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">configuration</span>
141
119
  <span class="ruby-ivar">@configuration</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">new</span>
142
120
  <span class="ruby-keyword">end</span></pre>
143
121
  </div>
144
-
145
122
  </div>
146
123
 
147
-
148
124
 
149
-
150
125
  </div>
151
126
 
152
-
153
127
  <div id="method-c-configure" class="method-detail ">
154
-
155
128
  <div class="method-heading">
156
129
  <span class="method-name">configure</span><span
157
130
  class="method-args">() { |configuration| ... }</span>
158
-
159
131
  <span class="method-click-advice">click to toggle source</span>
160
-
161
132
  </div>
162
-
163
133
 
164
134
  <div class="method-description">
165
-
166
135
  <p>Calling this method will yield to a block passing the <code>configuration</code> object as parameter.</p>
167
-
168
-
169
136
 
170
-
171
137
  <div class="method-source-code" id="configure-source">
172
- <pre><span class="ruby-comment"># File lib/fattura24.rb, line 25</span>
138
+ <pre><span class="ruby-comment"># File lib/fattura24.rb, line 26</span>
173
139
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">configure</span>
174
140
  <span class="ruby-keyword">yield</span> <span class="ruby-identifier">configuration</span>
175
141
  <span class="ruby-keyword">end</span></pre>
176
142
  </div>
177
-
178
143
  </div>
179
144
 
180
-
181
145
 
182
-
183
146
  </div>
184
147
 
185
-
186
148
  </section>
187
-
149
+
188
150
  </section>
189
151
  </main>
190
152
 
191
153
 
192
154
  <footer id="validator-badges" role="contentinfo">
193
155
  <p><a href="https://validator.w3.org/check/referer">Validate</a>
194
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
156
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
195
157
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
196
158
  </footer>
197
159
 
@@ -21,7 +21,6 @@
21
21
  <link href="../css/rdoc.css" rel="stylesheet">
22
22
 
23
23
 
24
-
25
24
  <body id="top" role="document" class="module">
26
25
  <nav role="navigation">
27
26
  <div id="project-navigation">
@@ -61,32 +60,22 @@
61
60
 
62
61
 
63
62
 
64
- <!-- Method Quickref -->
63
+
64
+ <!-- Method Quickref -->
65
65
  <div id="method-list-section" class="nav-section">
66
66
  <h3>Methods</h3>
67
67
 
68
68
  <ul class="link-list" role="directory">
69
-
70
69
  <li ><a href="#method-c-get_file">::get_file</a>
71
-
72
70
  <li ><a href="#method-c-get_numerator">::get_numerator</a>
73
-
74
71
  <li ><a href="#method-c-get_pdc">::get_pdc</a>
75
-
76
72
  <li ><a href="#method-c-get_product">::get_product</a>
77
-
78
73
  <li ><a href="#method-c-get_template">::get_template</a>
79
-
80
74
  <li ><a href="#method-c-request">::request</a>
81
-
82
75
  <li ><a href="#method-c-save_customer">::save_customer</a>
83
-
84
76
  <li ><a href="#method-c-save_document">::save_document</a>
85
-
86
77
  <li ><a href="#method-c-save_item">::save_item</a>
87
-
88
78
  <li ><a href="#method-c-test_key">::test_key</a>
89
-
90
79
  </ul>
91
80
  </div>
92
81
 
@@ -102,55 +91,36 @@
102
91
 
103
92
  </section>
104
93
 
105
-
106
94
  <section id="5Buntitled-5D" class="documentation-section">
107
-
108
95
 
109
-
110
96
 
111
-
112
97
  <section class="constants-list">
113
98
  <header>
114
99
  <h3>Constants</h3>
115
100
  </header>
116
101
  <dl>
117
-
118
102
  <dt id="API_HOST">API_HOST
119
-
120
103
  <dd><p>This library uses <a href="https://fattura24.com">fattura24.com</a> v0.3 apis. Check their docs <a href="https://www.fattura24.com/api-documentazione/">here</a>.</p>
121
-
122
-
123
104
  </dl>
124
105
  </section>
125
-
126
106
 
127
-
128
107
 
129
-
108
+
130
109
  <section id="public-class-5Buntitled-5D-method-details" class="method-section">
131
110
  <header>
132
111
  <h3>Public Class Methods</h3>
133
112
  </header>
134
113
 
135
-
136
114
  <div id="method-c-get_file" class="method-detail ">
137
-
138
115
  <div class="method-heading">
139
116
  <span class="method-name">get_file</span><span
140
117
  class="method-args">(id)</span>
141
-
142
118
  <span class="method-click-advice">click to toggle source</span>
143
-
144
119
  </div>
145
-
146
120
 
147
121
  <div class="method-description">
148
-
149
122
  <p>Donwloads a pdf file for an existing document. Requires an existing document id, throws <a href="MissingInput.html">MissingInput</a> when passing a nil <code>id</code>. Returns a <a href="Api/Response.html">Response</a> object: refer to it&#39;s documentation to detect a binary file and instruction to save it to disk.</p>
150
-
151
-
152
123
 
153
-
154
124
  <div class="method-source-code" id="get_file-source">
155
125
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 71</span>
156
126
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">get_file</span>(<span class="ruby-identifier">id</span>)
@@ -159,99 +129,63 @@
159
129
  <span class="ruby-identifier">request</span>(<span class="ruby-string">&#39;/GetFile&#39;</span>, { <span class="ruby-value">docId:</span> <span class="ruby-identifier">id</span> })
160
130
  <span class="ruby-keyword">end</span></pre>
161
131
  </div>
162
-
163
132
  </div>
164
133
 
165
-
166
134
 
167
-
168
135
  </div>
169
136
 
170
-
171
137
  <div id="method-c-get_numerator" class="method-detail ">
172
-
173
138
  <div class="method-heading">
174
139
  <span class="method-name">get_numerator</span><span
175
140
  class="method-args">()</span>
176
-
177
141
  <span class="method-click-advice">click to toggle source</span>
178
-
179
142
  </div>
180
-
181
143
 
182
144
  <div class="method-description">
183
-
184
145
  <p>Gets numerator list. Returns a <a href="Api/Response.html">Response</a> object.</p>
185
-
186
-
187
146
 
188
-
189
147
  <div class="method-source-code" id="get_numerator-source">
190
148
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 60</span>
191
149
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">get_numerator</span>
192
150
  <span class="ruby-identifier">request</span>(<span class="ruby-string">&#39;/GetNumerator&#39;</span>)
193
151
  <span class="ruby-keyword">end</span></pre>
194
152
  </div>
195
-
196
153
  </div>
197
154
 
198
-
199
155
 
200
-
201
156
  </div>
202
157
 
203
-
204
158
  <div id="method-c-get_pdc" class="method-detail ">
205
-
206
159
  <div class="method-heading">
207
160
  <span class="method-name">get_pdc</span><span
208
161
  class="method-args">()</span>
209
-
210
162
  <span class="method-click-advice">click to toggle source</span>
211
-
212
163
  </div>
213
-
214
164
 
215
165
  <div class="method-description">
216
-
217
166
  <p>Gets &#39;piano dei conti&#39; Returns a <a href="Api/Response.html">Response</a> object.</p>
218
-
219
-
220
167
 
221
-
222
168
  <div class="method-source-code" id="get_pdc-source">
223
169
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 53</span>
224
170
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">get_pdc</span>
225
171
  <span class="ruby-identifier">request</span>(<span class="ruby-string">&#39;/GetPdc&#39;</span>)
226
172
  <span class="ruby-keyword">end</span></pre>
227
173
  </div>
228
-
229
174
  </div>
230
175
 
231
-
232
176
 
233
-
234
177
  </div>
235
178
 
236
-
237
179
  <div id="method-c-get_product" class="method-detail ">
238
-
239
180
  <div class="method-heading">
240
181
  <span class="method-name">get_product</span><span
241
182
  class="method-args">(options = {})</span>
242
-
243
183
  <span class="method-click-advice">click to toggle source</span>
244
-
245
184
  </div>
246
-
247
185
 
248
186
  <div class="method-description">
249
-
250
187
  <p>Gets a list of products. You can pass a Hash containing a <code>code</code> or <code>category</code> to filter your existing products by them. Throws a <a href="InvalidParams.html">InvalidParams</a> when passing an hash containing unrecognized options. Returns a <a href="Api/Response.html">Response</a> object.</p>
251
-
252
-
253
188
 
254
-
255
189
  <div class="method-source-code" id="get_product-source">
256
190
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 85</span>
257
191
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">get_product</span>(<span class="ruby-identifier">options</span> = {})
@@ -259,66 +193,42 @@
259
193
  <span class="ruby-identifier">request</span>(<span class="ruby-string">&#39;/GetProduct&#39;</span>, <span class="ruby-identifier">options</span>)
260
194
  <span class="ruby-keyword">end</span></pre>
261
195
  </div>
262
-
263
196
  </div>
264
197
 
265
-
266
198
 
267
-
268
199
  </div>
269
200
 
270
-
271
201
  <div id="method-c-get_template" class="method-detail ">
272
-
273
202
  <div class="method-heading">
274
203
  <span class="method-name">get_template</span><span
275
204
  class="method-args">()</span>
276
-
277
205
  <span class="method-click-advice">click to toggle source</span>
278
-
279
206
  </div>
280
-
281
207
 
282
208
  <div class="method-description">
283
-
284
209
  <p>Gets a list of document templates. Returns a <a href="Api/Response.html">Response</a> object.</p>
285
-
286
-
287
210
 
288
-
289
211
  <div class="method-source-code" id="get_template-source">
290
212
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 46</span>
291
213
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">get_template</span>
292
214
  <span class="ruby-identifier">request</span>(<span class="ruby-string">&#39;/GetTemplate&#39;</span>)
293
215
  <span class="ruby-keyword">end</span></pre>
294
216
  </div>
295
-
296
217
  </div>
297
218
 
298
-
299
219
 
300
-
301
220
  </div>
302
221
 
303
-
304
222
  <div id="method-c-request" class="method-detail ">
305
-
306
223
  <div class="method-heading">
307
224
  <span class="method-name">request</span><span
308
225
  class="method-args">(path, body = {})</span>
309
-
310
226
  <span class="method-click-advice">click to toggle source</span>
311
-
312
227
  </div>
313
-
314
228
 
315
229
  <div class="method-description">
316
-
317
230
  <p>Performs a generic request on the api endpoint using Ruby&#39;s <a href="https://ruby-doc.org/stdlib-2.7.0/libdoc/net/http/rdoc/Net/HTTP.html">Net::HTTP</a>. All the other api methods call this one. Parameter <code>path</code> should always be prepended with &#39;/&#39;. Body will default to an empty hash. Returns a <a href="Api/Response.html">Response</a> object.</p>
318
-
319
-
320
231
 
321
-
322
232
  <div class="method-source-code" id="request-source">
323
233
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 19</span>
324
234
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">request</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">body</span> = {})
@@ -336,33 +246,21 @@
336
246
  <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">response</span>)
337
247
  <span class="ruby-keyword">end</span></pre>
338
248
  </div>
339
-
340
249
  </div>
341
250
 
342
-
343
251
 
344
-
345
252
  </div>
346
253
 
347
-
348
254
  <div id="method-c-save_customer" class="method-detail ">
349
-
350
255
  <div class="method-heading">
351
256
  <span class="method-name">save_customer</span><span
352
257
  class="method-args">(data = {})</span>
353
-
354
258
  <span class="method-click-advice">click to toggle source</span>
355
-
356
259
  </div>
357
-
358
260
 
359
261
  <div class="method-description">
360
-
361
262
  <p>Saves a customer in your contact list. Any <code>nil</code> parameter will be deeply removed by using the <a href="Utils.html#method-c-crush">crush</a> utility. Returns a <a href="Api/Response.html">Response</a> object.</p>
362
-
363
-
364
263
 
365
-
366
264
  <div class="method-source-code" id="save_customer-source">
367
265
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 97</span>
368
266
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">save_customer</span>(<span class="ruby-identifier">data</span> = {})
@@ -371,33 +269,21 @@
371
269
  })
372
270
  <span class="ruby-keyword">end</span></pre>
373
271
  </div>
374
-
375
272
  </div>
376
273
 
377
-
378
274
 
379
-
380
275
  </div>
381
276
 
382
-
383
277
  <div id="method-c-save_document" class="method-detail ">
384
-
385
278
  <div class="method-heading">
386
279
  <span class="method-name">save_document</span><span
387
280
  class="method-args">(data = {})</span>
388
-
389
281
  <span class="method-click-advice">click to toggle source</span>
390
-
391
282
  </div>
392
-
393
283
 
394
284
  <div class="method-description">
395
-
396
285
  <p>Use this to create documents. Pass a hash with the data, check the <a href="../README_md.html">README</a> file for examples. Use <a href="DocumentType.html">DocumentType</a> enums to specify document type. Any <code>nil</code> parameter will be deeply removed by using the <a href="Utils.html#method-c-crush">crush</a> utility. Returns a <a href="Api/Response.html">Response</a> object.</p>
397
-
398
-
399
286
 
400
-
401
287
  <div class="method-source-code" id="save_document-source">
402
288
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 111</span>
403
289
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">save_document</span>(<span class="ruby-identifier">data</span> = {})
@@ -406,33 +292,21 @@
406
292
  })
407
293
  <span class="ruby-keyword">end</span></pre>
408
294
  </div>
409
-
410
295
  </div>
411
296
 
412
-
413
297
 
414
-
415
298
  </div>
416
299
 
417
-
418
300
  <div id="method-c-save_item" class="method-detail ">
419
-
420
301
  <div class="method-heading">
421
302
  <span class="method-name">save_item</span><span
422
303
  class="method-args">(data = {})</span>
423
-
424
304
  <span class="method-click-advice">click to toggle source</span>
425
-
426
305
  </div>
427
-
428
306
 
429
307
  <div class="method-description">
430
-
431
308
  <p>Creates a credit. Any <code>nil</code> parameter will be deeply removed by using the <a href="Utils.html#method-c-crush">crush</a> utility. Returns a <a href="Api/Response.html">Response</a> object.</p>
432
-
433
-
434
309
 
435
-
436
310
  <div class="method-source-code" id="save_item-source">
437
311
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 122</span>
438
312
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">save_item</span>(<span class="ruby-identifier">data</span> = {})
@@ -441,57 +315,41 @@
441
315
  })
442
316
  <span class="ruby-keyword">end</span></pre>
443
317
  </div>
444
-
445
318
  </div>
446
319
 
447
-
448
320
 
449
-
450
321
  </div>
451
322
 
452
-
453
323
  <div id="method-c-test_key" class="method-detail ">
454
-
455
324
  <div class="method-heading">
456
325
  <span class="method-name">test_key</span><span
457
326
  class="method-args">()</span>
458
-
459
327
  <span class="method-click-advice">click to toggle source</span>
460
-
461
328
  </div>
462
-
463
329
 
464
330
  <div class="method-description">
465
-
466
331
  <p>Tests validity of your api key. Returns a <a href="Api/Response.html">Response</a> object.</p>
467
-
468
-
469
332
 
470
-
471
333
  <div class="method-source-code" id="test_key-source">
472
334
  <pre><span class="ruby-comment"># File lib/fattura24/api/client.rb, line 37</span>
473
335
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">test_key</span>
474
336
  <span class="ruby-identifier">request</span>(<span class="ruby-string">&#39;/TestKey&#39;</span>)
475
337
  <span class="ruby-keyword">end</span></pre>
476
338
  </div>
477
-
478
339
  </div>
479
340
 
480
-
481
341
 
482
-
483
342
  </div>
484
343
 
485
-
486
344
  </section>
487
-
345
+
488
346
  </section>
489
347
  </main>
490
348
 
491
349
 
492
350
  <footer id="validator-badges" role="contentinfo">
493
351
  <p><a href="https://validator.w3.org/check/referer">Validate</a>
494
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
352
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
495
353
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
496
354
  </footer>
497
355