quaderno 2.2.0 → 3.0.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 +4 -4
- data/README.md +257 -28
- data/changelog.md +14 -0
- data/lib/quaderno-ruby/account.rb +37 -0
- data/lib/quaderno-ruby/address.rb +10 -0
- data/lib/quaderno-ruby/behavior/crud.rb +1 -2
- data/lib/quaderno-ruby/behavior/retrieve.rb +3 -2
- data/lib/quaderno-ruby/exceptions/exceptions.rb +27 -10
- data/lib/quaderno-ruby/helpers/response.rb +13 -0
- data/lib/quaderno-ruby/tax.rb +4 -2
- data/lib/quaderno-ruby/tax_code.rb +10 -0
- data/lib/quaderno-ruby/tax_id.rb +24 -0
- data/lib/quaderno-ruby/tax_jurisdiction.rb +10 -0
- data/lib/quaderno-ruby/tax_rate.rb +23 -0
- data/lib/quaderno-ruby/version.rb +1 -1
- data/lib/quaderno-ruby.rb +3 -2
- data/quaderno.gemspec +4 -4
- metadata +35 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 110d06dbefd7137c90b3446ba4fbd0e6cb967e215244de1c7a1f54d9beecf46c
|
4
|
+
data.tar.gz: 5f484fa04535448a06fd960e0656ab29b1abefea9db2dfa7e672f83511891af4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 925cbcdacf1bfa00b11c3b3f3e9f5791da6295f550d1feac7dd37d00dc2d5963752840c66cfb9e88d9e56d6e6d1fe4175ba4a1c084b83ba295971862056e0d64
|
7
|
+
data.tar.gz: 5439f1cb10b38539450c5351a256117fa39d906245a985533fc56a49d78ce456634aa1963f97fcbef57ce0f28227082a717b154618d987e3f5cd857e4c434552
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# quaderno-ruby
|
2
2
|
|
3
|
-
Quaderno-ruby is a ruby wrapper for [Quaderno API]
|
3
|
+
Quaderno-ruby is a ruby wrapper for the [Quaderno API](https://developers.quaderno.io/api).
|
4
4
|
|
5
|
-
Current version is
|
5
|
+
Current version is 3.0.0 → See the changelog [here](https://github.com/quaderno/quaderno-ruby/blob/master/changelog.md).
|
6
|
+
|
7
|
+
To learn more about our API and ecosystem, check [developers.quaderno.io](https://developers.quaderno.io).
|
6
8
|
|
7
9
|
## Installation & Configuration
|
8
10
|
|
@@ -23,7 +25,11 @@ To configure just add this to your initializers
|
|
23
25
|
end
|
24
26
|
```
|
25
27
|
|
26
|
-
|
28
|
+
## Quaderno Sandbox
|
29
|
+
|
30
|
+
Quaderno Sandbox is our public staging environment, a safe space to experiment with our set of APIs and products. As a complete separate environment, it has it's own URL https://sandbox-quadernoapp.com and credentials.
|
31
|
+
|
32
|
+
It's perfect for your first steps with our tools. Please check https://developers.quaderno.io/dev_tools/sandbox to learn about its test data and limitations.
|
27
33
|
|
28
34
|
## Get authorization data
|
29
35
|
|
@@ -34,12 +40,13 @@ You can get your account subdomain by grabbing it from your account url or by ca
|
|
34
40
|
response.identity # => {"id"=>737000, "name"=>"Walter White", "email"=>"cooking@br.bd", "href"=>"https://my_subdomain.quadernoapp.com/api/"}
|
35
41
|
```
|
36
42
|
|
37
|
-
`environment` is an optional argument. By passing `:sandbox`, you will retrieve your credentials for the sandbox environment and not for production.
|
43
|
+
Note that `environment` is an optional argument. By passing `:sandbox`, you will retrieve your credentials for the sandbox environment and not for production.
|
38
44
|
|
39
45
|
This will return a hash with the information about your api url, which includes the account subdomain.
|
40
46
|
|
41
47
|
## Ping the service
|
42
|
-
|
48
|
+
|
49
|
+
You can ping the service in order to check if it is up with:
|
43
50
|
|
44
51
|
```ruby
|
45
52
|
response = Quaderno::Base.ping #=> Quaderno::Base
|
@@ -57,7 +64,7 @@ This will return `status: true` if the service is up or `status: false` if it is
|
|
57
64
|
|
58
65
|
```
|
59
66
|
|
60
|
-
This will return a hash with information about the seconds until the rate limit reset and your remaining requests per minute ([check the API documentation for more information](https://
|
67
|
+
This will return a hash with information about the seconds until the rate limit reset and your remaining requests per minute ([check the API documentation for more information](https://developers.quaderno.io/api#tag/API-features/Rate-Limiting)).
|
61
68
|
|
62
69
|
You can also check the rate limit for each request by checking the `rate_limit_info` method on the response:
|
63
70
|
|
@@ -98,6 +105,7 @@ Quaderno-ruby parses all the json responses in human readable data, so you can a
|
|
98
105
|
## Managing contacts
|
99
106
|
|
100
107
|
### Getting contacts
|
108
|
+
|
101
109
|
```ruby
|
102
110
|
Quaderno::Contact.all #=> Array
|
103
111
|
```
|
@@ -109,6 +117,7 @@ Quaderno-ruby parses all the json responses in human readable data, so you can a
|
|
109
117
|
```
|
110
118
|
|
111
119
|
### Finding a contact
|
120
|
+
|
112
121
|
```ruby
|
113
122
|
Quaderno::Contact.find(id) #=> Quaderno::Contact
|
114
123
|
```
|
@@ -116,15 +125,15 @@ Quaderno-ruby parses all the json responses in human readable data, so you can a
|
|
116
125
|
will return the contact with the id passed as parameter.
|
117
126
|
|
118
127
|
### Retrieving a contact by its payment gateway customer ID
|
128
|
+
|
119
129
|
```ruby
|
120
130
|
Quaderno::Contact.retrieve(PAYMENT_GATEWAY_CUSTOMER_ID, PAYMENT_GATEWAY) #=> Quaderno::Contact
|
121
131
|
```
|
122
|
-
will return the contact with the customer id passed as parameter.
|
123
|
-
|
124
|
-
*_Note_: `Quaderno::Contact.retrieve_customer` has been deprecated in favor of `Quaderno::Contact.retrieve`
|
125
132
|
|
133
|
+
will return the contact with the customer id passed as parameter.
|
126
134
|
|
127
135
|
### Creating a new contact
|
136
|
+
|
128
137
|
```ruby
|
129
138
|
Quaderno::Contact.create(params) #=> Quaderno::Contact
|
130
139
|
```
|
@@ -132,6 +141,7 @@ will return the contact with the customer id passed as parameter.
|
|
132
141
|
will create a contact using the information of the hash passed as parameter and return an instance of Quaderno::Contact with the created contact.
|
133
142
|
|
134
143
|
### Updating an existing contact
|
144
|
+
|
135
145
|
```ruby
|
136
146
|
Quaderno::Contact.update(id, params) #=> Quaderno::Contact
|
137
147
|
```
|
@@ -139,6 +149,7 @@ will create a contact using the information of the hash passed as parameter and
|
|
139
149
|
will update the specified contact with the data of the hash passed as second parameter.
|
140
150
|
|
141
151
|
### Deleting a contact
|
152
|
+
|
142
153
|
```ruby
|
143
154
|
Quaderno::Contact.delete(id) #=> Quaderno::Contact
|
144
155
|
```
|
@@ -148,6 +159,7 @@ will delete the contact with the id passed as parameter. If the deletion was suc
|
|
148
159
|
## Managing items
|
149
160
|
|
150
161
|
### Getting items
|
162
|
+
|
151
163
|
```ruby
|
152
164
|
Quaderno::Item.all #=> Array
|
153
165
|
```
|
@@ -155,6 +167,7 @@ will delete the contact with the id passed as parameter. If the deletion was suc
|
|
155
167
|
will return an array with all your items.
|
156
168
|
|
157
169
|
### Finding an item
|
170
|
+
|
158
171
|
```ruby
|
159
172
|
Quaderno::Item.find(id) #=> Quaderno::Item
|
160
173
|
```
|
@@ -162,6 +175,7 @@ will return an array with all your items.
|
|
162
175
|
will return the items with the id passed as parameter.
|
163
176
|
|
164
177
|
### Creating a new item
|
178
|
+
|
165
179
|
```ruby
|
166
180
|
Quaderno::Item.create(params) #=> Quaderno::Item
|
167
181
|
```
|
@@ -169,6 +183,7 @@ will return the items with the id passed as parameter.
|
|
169
183
|
will create an item using the information of the hash passed as parameter and return an instance of Quaderno::Item with the created contact.
|
170
184
|
|
171
185
|
### Updating an existing item
|
186
|
+
|
172
187
|
```ruby
|
173
188
|
Quaderno::Item.update(id, params) #=> Quaderno::Item
|
174
189
|
```
|
@@ -176,6 +191,7 @@ will create an item using the information of the hash passed as parameter and re
|
|
176
191
|
will update the specified item with the data of the hash passed as second parameter.
|
177
192
|
|
178
193
|
### Deleting an item
|
194
|
+
|
179
195
|
```ruby
|
180
196
|
Quaderno::Item.delete(id) #=> Quaderno::Item
|
181
197
|
```
|
@@ -192,10 +208,10 @@ will delete the item with the id passed as parameter. If the deletion was succe
|
|
192
208
|
|
193
209
|
will create a sale or refund transaction using the information of the hash passed as parameter.
|
194
210
|
|
195
|
-
|
196
211
|
## Managing invoices
|
197
212
|
|
198
213
|
### Getting invoices
|
214
|
+
|
199
215
|
```ruby
|
200
216
|
Quaderno::Invoice.all #=> Array
|
201
217
|
```
|
@@ -203,6 +219,7 @@ will create a sale or refund transaction using the information of the hash passe
|
|
203
219
|
will return an array with all your invoices. You can also pass query strings using the attribute :q in order to filter the results by contact name, :state to filter by state or :date to filter by date
|
204
220
|
|
205
221
|
### Finding an invoice
|
222
|
+
|
206
223
|
```ruby
|
207
224
|
Quaderno::Invoice.find(id) #=> Quaderno::Invoice
|
208
225
|
```
|
@@ -210,11 +227,12 @@ will create a sale or refund transaction using the information of the hash passe
|
|
210
227
|
will return the invoice with the id passed as parameter.
|
211
228
|
|
212
229
|
### Retrieving an invoice by its payment gateway transaction ID
|
230
|
+
|
213
231
|
```ruby
|
214
232
|
Quaderno::Invoice.retrieve(PAYMENT_GATEWAY_TRANSACTION_ID, PAYMENT_GATEWAY) #=> Quaderno::Invoice
|
215
233
|
```
|
216
|
-
will return the invoice with the transaction id passed as parameter.
|
217
234
|
|
235
|
+
will return the invoice with the transaction id passed as parameter.
|
218
236
|
|
219
237
|
### Creating a new invoice
|
220
238
|
|
@@ -225,6 +243,7 @@ will return the invoice with the transaction id passed as parameter.
|
|
225
243
|
will create an invoice using the information of the hash passed as parameter.
|
226
244
|
|
227
245
|
### Updating an existing invoice
|
246
|
+
|
228
247
|
```ruby
|
229
248
|
Quaderno::Invoice.update(id, params) #=> Quaderno::Invoice
|
230
249
|
```
|
@@ -239,9 +258,9 @@ will update the specified invoice with the data of the hash passed as second par
|
|
239
258
|
|
240
259
|
will delete the invoice with the id passed as parameter. If the deletion was successful, an instance of `Quaderno::Item` with the `deleted` attribute set to `true` will be returned.
|
241
260
|
|
261
|
+
### Adding or removing a payment
|
242
262
|
|
243
|
-
|
244
|
-
In order to add a payment you will need the Invoice instance you want to update.
|
263
|
+
In order to add a payment you will need the Invoice instance you want to update.
|
245
264
|
|
246
265
|
```ruby
|
247
266
|
invoice = Quaderno::Invoice.find(invoice_id)
|
@@ -271,6 +290,7 @@ In order to remove a payment you will need the Invoice instance you want to upd
|
|
271
290
|
## Managing credits
|
272
291
|
|
273
292
|
### Getting credits
|
293
|
+
|
274
294
|
```ruby
|
275
295
|
Quaderno::Credit.all #=> Array
|
276
296
|
```
|
@@ -278,6 +298,7 @@ In order to remove a payment you will need the Invoice instance you want to upd
|
|
278
298
|
will return an array with all your credit notes. You can also pass query strings using the attribute :q in order to filter the results by contact name, :state to filter by state or :date to filter by date
|
279
299
|
|
280
300
|
### Finding a credit
|
301
|
+
|
281
302
|
```ruby
|
282
303
|
Quaderno::Credit.find(id) #=> Quaderno::Credit
|
283
304
|
```
|
@@ -285,9 +306,11 @@ In order to remove a payment you will need the Invoice instance you want to upd
|
|
285
306
|
will return the credit with the id passed as parameter.
|
286
307
|
|
287
308
|
### Retrieving a credit by its payment gateway transaction ID
|
309
|
+
|
288
310
|
```ruby
|
289
311
|
Quaderno::Credit.retrieve(PAYMENT_GATEWAY_TRANSACTION_ID, PAYMENT_GATEWAY) #=> Quaderno::Credit
|
290
312
|
```
|
313
|
+
|
291
314
|
will return the credit note with the transaction id passed as parameter.
|
292
315
|
|
293
316
|
### Creating a new credit
|
@@ -299,6 +322,7 @@ will return the credit note with the transaction id passed as parameter.
|
|
299
322
|
will create a credit from the invoice specified in the parameter.
|
300
323
|
|
301
324
|
### Updating an existing credit
|
325
|
+
|
302
326
|
```ruby
|
303
327
|
Quaderno::Credit.update(id, params) #=> Quaderno::Credit
|
304
328
|
```
|
@@ -313,8 +337,8 @@ will update the specified credit with the data of the hash passed as second para
|
|
313
337
|
|
314
338
|
will delete the credit with the id passed as parameter. If the deletion was successful, an instance of `Quaderno::Credit` with the `deleted` attribute set to `true` will be returned.
|
315
339
|
|
316
|
-
|
317
340
|
### Adding or removing a payment
|
341
|
+
|
318
342
|
In order to add a payment you will need the Credit instance you want to update.
|
319
343
|
|
320
344
|
```ruby
|
@@ -344,11 +368,10 @@ If the deletion was successful, an instance of `Quaderno::Payment` with the `del
|
|
344
368
|
result.success #=> Boolean
|
345
369
|
```
|
346
370
|
|
347
|
-
|
348
371
|
## Managing estimates
|
349
372
|
|
350
|
-
|
351
373
|
### Getting estimates
|
374
|
+
|
352
375
|
```ruby
|
353
376
|
Quaderno::Estimate.all #=> Array
|
354
377
|
```
|
@@ -356,6 +379,7 @@ If the deletion was successful, an instance of `Quaderno::Payment` with the `del
|
|
356
379
|
will return an array with all your estimates.
|
357
380
|
|
358
381
|
### Finding an estimate
|
382
|
+
|
359
383
|
```ruby
|
360
384
|
Quaderno::Estimate.find(id) #=> Quaderno::Estimate
|
361
385
|
```
|
@@ -371,6 +395,7 @@ will return the estimate with the id passed as parameter.
|
|
371
395
|
will create an estimate using the information of the hash passed as parameter.
|
372
396
|
|
373
397
|
### Updating an existing estimate
|
398
|
+
|
374
399
|
```ruby
|
375
400
|
Quaderno::Estimate.update(id, params)
|
376
401
|
```
|
@@ -385,9 +410,9 @@ will update the specified estimate with the data of the hash passed as second pa
|
|
385
410
|
|
386
411
|
will delete the estimate with the id passed as parameter. If the deletion was successful, an instance of `Quaderno::Contact` with the `deleted` attribute set to `true` will be returned.
|
387
412
|
|
413
|
+
### Adding or removing a payment
|
388
414
|
|
389
|
-
|
390
|
-
In order to add a payment you will need the estimate you want to update.
|
415
|
+
In order to add a payment you will need the estimate you want to update.
|
391
416
|
|
392
417
|
```ruby
|
393
418
|
estimate = Quaderno::Estimate.find(estimate_id)
|
@@ -404,7 +429,8 @@ In order to remove a payment you will need the estimate you want to update.
|
|
404
429
|
```
|
405
430
|
|
406
431
|
### Delivering the estimate
|
407
|
-
|
432
|
+
|
433
|
+
In order to deliver the estimate to the default recipient you will need the estimate you want to send.
|
408
434
|
|
409
435
|
```ruby
|
410
436
|
estimate = Quaderno::Estimate.find(estimate_id)
|
@@ -413,10 +439,10 @@ In order to remove a payment you will need the estimate you want to update.
|
|
413
439
|
result.success #=> Boolean
|
414
440
|
```
|
415
441
|
|
416
|
-
|
417
442
|
## Managing expenses
|
418
443
|
|
419
444
|
### Getting expenses
|
445
|
+
|
420
446
|
```ruby
|
421
447
|
Quaderno::Expense.all #=> Array
|
422
448
|
```
|
@@ -424,6 +450,7 @@ In order to remove a payment you will need the estimate you want to update.
|
|
424
450
|
will return an array with all your expenses. You can also pass query strings using the attribute :q in order to filter the results by contact name, :state to filter by state or :date to filter by date.
|
425
451
|
|
426
452
|
### Finding an expense
|
453
|
+
|
427
454
|
```ruby
|
428
455
|
Quaderno::Expense.find(id) #=> Quaderno::Expense
|
429
456
|
```
|
@@ -431,6 +458,7 @@ In order to remove a payment you will need the estimate you want to update.
|
|
431
458
|
will return the expense with the id passed as parameter.
|
432
459
|
|
433
460
|
### Creating a new expense
|
461
|
+
|
434
462
|
```ruby
|
435
463
|
Quaderno::Expense.create(params) #=> Quaderno::Expense
|
436
464
|
```
|
@@ -438,6 +466,7 @@ will return the expense with the id passed as parameter.
|
|
438
466
|
will create an expense using the information of the hash passed as parameter and return an instance of Quaderno::Expense with the created expense.
|
439
467
|
|
440
468
|
### Updating an existing expense
|
469
|
+
|
441
470
|
```ruby
|
442
471
|
Quaderno::Expense.update(id, params) #=> Quaderno::Expense
|
443
472
|
```
|
@@ -445,16 +474,17 @@ will create an expense using the information of the hash passed as parameter and
|
|
445
474
|
will update the specified expense with the data of the hash passed as second parameter.
|
446
475
|
|
447
476
|
### Deleting an expense
|
477
|
+
|
448
478
|
```ruby
|
449
479
|
Quaderno::Expense.delete(id) #=> Quaderno::Expense
|
450
480
|
```
|
451
481
|
|
452
482
|
will delete the expense with the id passed as parameter. If the deletion was successful, an instance of `Quaderno::Expense` with the `deleted` attribute set to `true` will be returned.
|
453
483
|
|
454
|
-
|
455
484
|
## Managing recurrings
|
456
485
|
|
457
486
|
### Getting recurrings
|
487
|
+
|
458
488
|
```ruby
|
459
489
|
Quaderno::Recurring.all #=> Array
|
460
490
|
```
|
@@ -462,6 +492,7 @@ will delete the expense with the id passed as parameter. If the deletion was suc
|
|
462
492
|
will return an array with all your recurring notes. You can also pass query strings using the attribute :q in order to filter the results by contact name, :state to filter by state or :date to filter by date
|
463
493
|
|
464
494
|
### Finding a recurring
|
495
|
+
|
465
496
|
```ruby
|
466
497
|
Quaderno::Recurring.find(id) #=> Quaderno::Recurring
|
467
498
|
```
|
@@ -477,6 +508,7 @@ will return the recurring with the id passed as parameter.
|
|
477
508
|
will create a recurring using the information of the hash passed as parameter.
|
478
509
|
|
479
510
|
### Updating an existing recurring
|
511
|
+
|
480
512
|
```ruby
|
481
513
|
Quaderno::Recurring.update(id, params) #=> Quaderno::Recurring
|
482
514
|
```
|
@@ -491,10 +523,10 @@ will update the specified recurring with the data of the hash passed as second p
|
|
491
523
|
|
492
524
|
will delete the recurring with the id passed as parameter. If the deletion was successful, an instance of `Quaderno::Recurring` with the `deleted` attribute set to `true` will be returned.
|
493
525
|
|
494
|
-
|
495
526
|
## Managing webhooks
|
496
527
|
|
497
528
|
### Getting webhooks
|
529
|
+
|
498
530
|
```ruby
|
499
531
|
Quaderno::Webhook.all #=> Array
|
500
532
|
```
|
@@ -502,6 +534,7 @@ will delete the recurring with the id passed as parameter. If the deletion was s
|
|
502
534
|
will return an array with all the webhooks you have subscribed.
|
503
535
|
|
504
536
|
### Finding a webhook
|
537
|
+
|
505
538
|
```ruby
|
506
539
|
Quaderno::Webhook.find(id) #=> Quaderno::Webhook
|
507
540
|
```
|
@@ -509,6 +542,7 @@ will delete the recurring with the id passed as parameter. If the deletion was s
|
|
509
542
|
will return the webhook with the id passed as parameter.
|
510
543
|
|
511
544
|
### Creating a new webhook
|
545
|
+
|
512
546
|
```ruby
|
513
547
|
Quaderno::Webhook.create(params) #=> Quaderno::Webhook
|
514
548
|
```
|
@@ -516,6 +550,7 @@ will return the webhook with the id passed as parameter.
|
|
516
550
|
will create a webhook using the information of the hash passed as parameter and return an instance of Quaderno::Webhook with the created webhook.
|
517
551
|
|
518
552
|
### Updating an existing webhook
|
553
|
+
|
519
554
|
```ruby
|
520
555
|
Quaderno::Webhook.update(id, params) #=> Quaderno::Webhook
|
521
556
|
```
|
@@ -523,27 +558,108 @@ will create a webhook using the information of the hash passed as parameter and
|
|
523
558
|
will update the specified webhook with the data of the hash passed as second parameter.
|
524
559
|
|
525
560
|
### Deleting a webhook
|
561
|
+
|
526
562
|
```ruby
|
527
563
|
Quaderno::Webhook.delete(id) #=> Quaderno::Webhook
|
528
564
|
```
|
529
|
-
will delete the webhook with the id passed as parameter. If the deletion was successful, an instance of `Quaderno::Webhook` with the `deleted` attribute set to `true` will be returned.
|
530
565
|
|
566
|
+
will delete the webhook with the id passed as parameter. If the deletion was successful, an instance of `Quaderno::Webhook` with the `deleted` attribute set to `true` will be returned.
|
531
567
|
|
532
|
-
##
|
568
|
+
## Tax rates
|
533
569
|
|
534
570
|
### Calculating taxes
|
571
|
+
|
535
572
|
```ruby
|
536
|
-
Quaderno::
|
573
|
+
Quaderno::TaxRate.calculate(params) #=> Quaderno::TaxRate
|
537
574
|
```
|
538
575
|
|
539
576
|
will calculate the taxes applied for a customer based on the data pased as parameters.
|
540
577
|
|
541
|
-
|
578
|
+
## Tax jurisdictions
|
579
|
+
|
580
|
+
### Listing tax jurisdictions
|
581
|
+
|
582
|
+
```ruby
|
583
|
+
Quaderno::TaxJurisdiction.all #=> Array
|
584
|
+
```
|
585
|
+
|
586
|
+
will return an array with all the tax jurisdictions supported in Quaderno.
|
587
|
+
|
588
|
+
### Finding a tax jurisdiction
|
589
|
+
|
590
|
+
```ruby
|
591
|
+
Quaderno::TaxJurisdiction.find(id) #=> Quaderno::TaxJurisdiction
|
592
|
+
```
|
593
|
+
|
594
|
+
will return the tax jurisdiction with the id passed as parameter.
|
595
|
+
|
596
|
+
## Tax codes
|
597
|
+
|
598
|
+
### Listing tax codes
|
599
|
+
|
600
|
+
```ruby
|
601
|
+
Quaderno::TaxCode.all #=> Array
|
602
|
+
```
|
603
|
+
|
604
|
+
will return an array with all the tax codes supported in Quaderno.
|
605
|
+
|
606
|
+
### Finding a tax jurisdiction
|
607
|
+
|
608
|
+
```ruby
|
609
|
+
Quaderno::TaxCode.find(id) #=> Quaderno::TaxCode
|
610
|
+
```
|
611
|
+
|
612
|
+
will return the tax code with the id passed as parameter.
|
613
|
+
|
614
|
+
## Managing Tax ids
|
615
|
+
|
616
|
+
### Getting tax ids
|
617
|
+
|
618
|
+
```ruby
|
619
|
+
Quaderno::TaxId.all #=> Array
|
620
|
+
```
|
621
|
+
|
622
|
+
will return an array with all the tax ids in the target account.
|
623
|
+
|
624
|
+
### Finding a tax id
|
625
|
+
|
626
|
+
```ruby
|
627
|
+
Quaderno::TaxId.find(id) #=> Quaderno::TaxId
|
628
|
+
```
|
629
|
+
|
630
|
+
will return the tax id with the id passed as parameter.
|
631
|
+
|
632
|
+
### Adding a new tax id
|
633
|
+
|
634
|
+
```ruby
|
635
|
+
Quaderno::TaxId.create(params) #=> Quaderno::TaxId
|
636
|
+
```
|
637
|
+
|
638
|
+
will create a tax id using the information of the hash passed as parameter and return an instance of Quaderno::TaxId with the created tax id.
|
639
|
+
|
640
|
+
### Updating an existing tax id
|
641
|
+
|
642
|
+
```ruby
|
643
|
+
Quaderno::TaxId.update(id, params) #=> Quaderno::TaxId
|
644
|
+
```
|
645
|
+
|
646
|
+
will update the specified tax id with the data of the hash passed as second parameter.
|
647
|
+
|
648
|
+
### Deleting a tax id
|
649
|
+
|
650
|
+
```ruby
|
651
|
+
Quaderno::TaxId.delete(id) #=> Quaderno::TaxId
|
652
|
+
```
|
653
|
+
|
654
|
+
will delete the tax id with the id passed as parameter. If the deletion was successful, an instance of `Quaderno::TaxId` with the `deleted` attribute set to `true` will be returned.
|
655
|
+
|
656
|
+
### Validate a tax id
|
657
|
+
|
542
658
|
```ruby
|
543
659
|
country = 'IE'
|
544
660
|
tax_id = 'IE6388047V'
|
545
661
|
|
546
|
-
result = Quaderno::
|
662
|
+
result = Quaderno::TaxId.validate(country, tax_id) #=> Quaderno::TaxId
|
547
663
|
|
548
664
|
result.valid #=> Boolean or nil
|
549
665
|
```
|
@@ -553,6 +669,7 @@ will validate the tax ID or business number for the specified country.
|
|
553
669
|
## Evidences
|
554
670
|
|
555
671
|
### Creating location evidences
|
672
|
+
|
556
673
|
```ruby
|
557
674
|
Quaderno::Evidence.create(params) #=> Quaderno::Evidence
|
558
675
|
```
|
@@ -569,6 +686,7 @@ will create an evidence based on the data pased as parameters.
|
|
569
686
|
will return an array with all the checkout sessions in your account.
|
570
687
|
|
571
688
|
### Finding a checkout session
|
689
|
+
|
572
690
|
```ruby
|
573
691
|
Quaderno::CheckoutSession.find(id) #=> Quaderno::CheckoutSession
|
574
692
|
```
|
@@ -576,6 +694,7 @@ will create an evidence based on the data pased as parameters.
|
|
576
694
|
will return the checkout session with the id passed as parameter.
|
577
695
|
|
578
696
|
### Creating a new checkout session
|
697
|
+
|
579
698
|
```ruby
|
580
699
|
Quaderno::CheckoutSession.create(params) #=> Quaderno::CheckoutSession
|
581
700
|
```
|
@@ -583,6 +702,7 @@ will return the checkout session with the id passed as parameter.
|
|
583
702
|
will create a checkout session using the information of the hash passed as parameter and return an instance of Quaderno::CheckoutSession with the created checout session.
|
584
703
|
|
585
704
|
### Updating an existing checkout session
|
705
|
+
|
586
706
|
```ruby
|
587
707
|
Quaderno::CheckoutSession.update(id, params) #=> Quaderno::CheckoutSession
|
588
708
|
```
|
@@ -590,14 +710,17 @@ will create a checkout session using the information of the hash passed as param
|
|
590
710
|
will update the specified checkout session with the data of the hash passed as second parameter.
|
591
711
|
|
592
712
|
### Deleting a checkout session
|
713
|
+
|
593
714
|
```ruby
|
594
715
|
Quaderno::CheckoutSession.delete(id) #=> Quaderno::CheckoutSession
|
595
716
|
```
|
717
|
+
|
596
718
|
will delete the checkout session with the id passed as parameter. If the deletion was successful, an instance of `Quaderno::CheckoutSession` with the `deleted` attribute set to `true` will be returned.
|
597
719
|
|
598
720
|
## Managing report requests
|
599
721
|
|
600
722
|
### Getting report requests
|
723
|
+
|
601
724
|
```ruby
|
602
725
|
Quaderno::ReportRequest.all #=> Array
|
603
726
|
```
|
@@ -605,6 +728,7 @@ will delete the checkout session with the id passed as parameter. If the deletio
|
|
605
728
|
will return an array with all your report requests.
|
606
729
|
|
607
730
|
### Finding a report request
|
731
|
+
|
608
732
|
```ruby
|
609
733
|
Quaderno::ReportRequest.find(id) #=> Quaderno::ReportRequest
|
610
734
|
```
|
@@ -619,7 +743,93 @@ will return the report request with the id passed as parameter.
|
|
619
743
|
|
620
744
|
will create a report request using the information of the hash passed as parameter and return an instance of Quaderno::ReportRequest with the created report request.
|
621
745
|
|
746
|
+
## Connect: Managing custom accounts
|
747
|
+
|
748
|
+
### Getting custom accounts
|
749
|
+
|
750
|
+
```ruby
|
751
|
+
Quaderno::Account.all #=> Array
|
752
|
+
```
|
753
|
+
|
754
|
+
will return an array with all your custom accounts
|
755
|
+
|
756
|
+
### Finding a custom account
|
757
|
+
|
758
|
+
```ruby
|
759
|
+
Quaderno::Account.find(id) #=> Quaderno::Account
|
760
|
+
```
|
761
|
+
|
762
|
+
will return the account with the id passed as parameter.
|
763
|
+
|
764
|
+
### Creating a new custom account
|
765
|
+
|
766
|
+
```ruby
|
767
|
+
Quaderno::Account.create(params) #=> Quaderno::Account
|
768
|
+
```
|
769
|
+
|
770
|
+
will create a custom account using the information of the hash passed as parameter.
|
771
|
+
|
772
|
+
### Updating an existing custom account
|
773
|
+
|
774
|
+
```ruby
|
775
|
+
Quaderno::Account.update(id, params) #=> Quaderno::Account
|
776
|
+
```
|
777
|
+
|
778
|
+
will update the specified custom account with the data of the hash passed as second parameter.
|
779
|
+
|
780
|
+
### Deactivating a custom account
|
781
|
+
|
782
|
+
```ruby
|
783
|
+
Quaderno::Account.deactivate(id) #=> Quaderno::Account
|
784
|
+
```
|
785
|
+
|
786
|
+
will deactivate the custom account with the id passed as parameter.
|
787
|
+
|
788
|
+
### Activating a custom account
|
789
|
+
|
790
|
+
```ruby
|
791
|
+
Quaderno::Account.activate(id) #=> Quaderno::Account
|
792
|
+
```
|
793
|
+
|
794
|
+
will activate the custom account with the id passed as parameter.
|
795
|
+
|
796
|
+
## Connect: Managing addresses
|
797
|
+
|
798
|
+
### Getting addresses
|
799
|
+
|
800
|
+
```ruby
|
801
|
+
Quaderno::Address.all(access_token: ACCESS_TOKEN) #=> Array
|
802
|
+
```
|
803
|
+
|
804
|
+
will return an array with all the addresses of the target custom account
|
805
|
+
|
806
|
+
### Finding a address
|
807
|
+
|
808
|
+
```ruby
|
809
|
+
Quaderno::Address.find(id, access_token: ACCESS_TOKEN) #=> Quaderno::Address
|
810
|
+
```
|
811
|
+
|
812
|
+
will return the address with the id passed as parameter.
|
813
|
+
|
814
|
+
### Creating a new address
|
815
|
+
|
816
|
+
```ruby
|
817
|
+
Quaderno::Address.create(params.merge(access_token: ACCESS_TOKEN)) #=> Quaderno::Address
|
818
|
+
```
|
819
|
+
|
820
|
+
will add an address on the target custom account using the information of the hash passed as parameter.
|
821
|
+
|
822
|
+
### Updating an existing address
|
823
|
+
|
824
|
+
```ruby
|
825
|
+
Quaderno::Address.update(id, params.merge(access_token: ACCESS_TOKEN)) #=> Quaderno::Address
|
826
|
+
```
|
827
|
+
|
828
|
+
will update the specified address with the data of the hash passed as second parameter.
|
829
|
+
|
830
|
+
|
622
831
|
## Exceptions
|
832
|
+
|
623
833
|
Quaderno-ruby exceptions raise depending on the type of error:
|
624
834
|
|
625
835
|
```ruby
|
@@ -629,6 +839,8 @@ Quaderno-ruby exceptions raise depending on the type of error:
|
|
629
839
|
|
630
840
|
Quaderno::Exceptions::InvalidID # Raised when the requested resource by ID does not exist in the account context.
|
631
841
|
|
842
|
+
Quaderno::Exceptions::InvalidRequest # Raised when the requested requirements are not fulfilled.
|
843
|
+
|
632
844
|
Quaderno::Exceptions::ThrottleLimitExceeded # Raised when the throttle limit is exceeded.
|
633
845
|
|
634
846
|
Quaderno::Exceptions::RateLimitExceeded # Raised when the rate limit is exceeded.
|
@@ -642,7 +854,19 @@ Quaderno-ruby exceptions raise depending on the type of error:
|
|
642
854
|
|
643
855
|
All those exceptions inherit from `Quaderno::Exceptions::BaseException`.
|
644
856
|
|
857
|
+
You can inspect a the error response from the API by rescuing the exception and checking `response_body`:
|
858
|
+
|
859
|
+
```ruby
|
860
|
+
begin
|
861
|
+
Quaderno::Invoice.find WRONG_ID
|
862
|
+
rescue Quaderno::Exceptions::BaseException => e
|
863
|
+
e.response_body # => {"error"=>"Unauthorized access or document does not exist."}
|
864
|
+
end
|
865
|
+
```
|
866
|
+
|
867
|
+
|
645
868
|
### Pagination information
|
869
|
+
|
646
870
|
Whenever you call the `all` method on one of the classes, the result will be a `Quaderno::Collection`. For example:
|
647
871
|
|
648
872
|
```ruby
|
@@ -711,9 +935,14 @@ Quaderno::Invoice.delete(INVOICE_ID,
|
|
711
935
|
|
712
936
|
## More information
|
713
937
|
|
714
|
-
Remember this is only a ruby wrapper for the
|
938
|
+
Remember this is only a ruby wrapper for the Quaderno API. Checkout our [OpenAPI documentation](https://developers.quaderno.io/api)!
|
939
|
+
|
940
|
+
If you need examples of `params` objects, head to our tests. For instance, in case you're an online store and want to register your sales and refunds, [here](https://github.com/quaderno/quaderno-ruby/blob/master/spec/unit/test_quaderno_transaction.rb) you can get examples of parameters to use with this Ruby gem.
|
941
|
+
|
942
|
+
---
|
715
943
|
|
716
944
|
## License
|
945
|
+
|
717
946
|
(The MIT License)
|
718
947
|
|
719
948
|
Copyright © 2013-2023 Quaderno
|
data/changelog.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.0.0
|
4
|
+
* Added support for accounts API
|
5
|
+
* Added support for addresses API
|
6
|
+
* Added support for tax rates API
|
7
|
+
* Added support for tax jurisdictions API
|
8
|
+
* Added support for tax codes API
|
9
|
+
* Clean parameters sent in the create request
|
10
|
+
* Phase out legacy `Quaderno::Tax` class in favour of `Quaderno::TaxRate` (the class will be removed in the next release)
|
11
|
+
* Relaxed httparty requirements
|
12
|
+
* Detect and handle `bad_request` response codes
|
13
|
+
* Added `Quaderno::Exceptions::InvalidRequest` to handle `not_acceptable` response codes
|
14
|
+
* Added `Quaderno::Exceptions::BaseException#response_body` to check the API response error
|
15
|
+
* Removed legacy `Quaderno::Contact.retrieve_customer` in favor of `Quaderno::Contact.retrieve`
|
16
|
+
|
3
17
|
## 2.2.0
|
4
18
|
* Added support for transactions API
|
5
19
|
* Bumped webmock to 3.18
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Quaderno::Account < Quaderno::Base
|
4
|
+
class << self
|
5
|
+
undef :delete
|
6
|
+
end
|
7
|
+
|
8
|
+
api_model Quaderno::Account
|
9
|
+
api_path 'accounts'
|
10
|
+
|
11
|
+
def self.activate(id, options = {})
|
12
|
+
setup_account('activate', id, options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.deactivate(id, options = {})
|
16
|
+
setup_account('deactivate', id, options)
|
17
|
+
end
|
18
|
+
|
19
|
+
private_class_method def self.setup_account(mode, id, options)
|
20
|
+
authentication = get_authentication(options.merge(api_model: api_model))
|
21
|
+
|
22
|
+
response = put("#{authentication[:url]}#{api_model.api_path}/#{id}/#{mode}.json", {
|
23
|
+
basic_auth: authentication[:basic_auth],
|
24
|
+
headers: default_headers.merge(authentication[:headers]).merge('Content-Type' => 'application/json')
|
25
|
+
})
|
26
|
+
|
27
|
+
check_exception_for(response, { rate_limit: true, required_fields: true, subdomain_or_token: true, id: true })
|
28
|
+
|
29
|
+
hash = response.parsed_response
|
30
|
+
hash[:authentication_data] = authentication
|
31
|
+
|
32
|
+
object = new hash
|
33
|
+
object.rate_limit_info = response
|
34
|
+
|
35
|
+
object
|
36
|
+
end
|
37
|
+
end
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Quaderno::Behavior
|
4
4
|
module Crud
|
5
|
-
|
6
5
|
def self.included(receiver)
|
7
6
|
receiver.send :extend, ClassMethods
|
8
7
|
end
|
@@ -71,7 +70,7 @@ module Quaderno::Behavior
|
|
71
70
|
|
72
71
|
def create(params = {})
|
73
72
|
authentication = get_authentication(params.merge(api_model: api_model))
|
74
|
-
params.dup.delete_if { |k, _| %w[auth_token access_token api_url mode api_model].include? k.to_s }
|
73
|
+
params = params.dup.delete_if { |k, _| %w[auth_token access_token api_url mode api_model].include? k.to_s }
|
75
74
|
|
76
75
|
response = post("#{authentication[:url]}#{api_model.api_path}.json",
|
77
76
|
body: params.to_json,
|
@@ -1,6 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Quaderno::Behavior
|
2
4
|
module Retrieve
|
3
|
-
|
4
5
|
def self.included(receiver)
|
5
6
|
receiver.send :extend, ClassMethods
|
6
7
|
end
|
@@ -25,9 +26,9 @@ module Quaderno::Behavior
|
|
25
26
|
|
26
27
|
object
|
27
28
|
end
|
28
|
-
alias_method :retrieve_customer, :retrieve
|
29
29
|
|
30
30
|
private
|
31
|
+
|
31
32
|
def retrieve_path(path)
|
32
33
|
@_retrieve_path = path
|
33
34
|
end
|
@@ -1,6 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Quaderno::Exceptions
|
2
4
|
class BaseException < StandardError
|
3
5
|
include Quaderno::Helpers::RateLimit
|
6
|
+
include Quaderno::Helpers::Response
|
4
7
|
end
|
5
8
|
|
6
9
|
class InvalidSubdomainOrToken < BaseException
|
@@ -9,6 +12,9 @@ module Quaderno::Exceptions
|
|
9
12
|
class InvalidID < BaseException
|
10
13
|
end
|
11
14
|
|
15
|
+
class InvalidRequest < BaseException
|
16
|
+
end
|
17
|
+
|
12
18
|
class RateLimitExceeded < BaseException
|
13
19
|
end
|
14
20
|
|
@@ -35,31 +41,42 @@ module Quaderno::Exceptions
|
|
35
41
|
def check_exception_for(party_response, params = {})
|
36
42
|
raise_exception(Quaderno::Exceptions::UnsupportedApiVersion, 'Unsupported API version', party_response) if !!(party_response.body =~ /Unsupported API version/)
|
37
43
|
|
38
|
-
if params[:throttle_limit].nil? == false && party_response.response.
|
44
|
+
if params[:throttle_limit].nil? == false && party_response.response.instance_of?(Net::HTTPServiceUnavailable)
|
39
45
|
raise_exception(Quaderno::Exceptions::ThrottleLimitExceeded, 'Throttle limit exceeded, please try again later', party_response)
|
40
46
|
end
|
41
|
-
|
47
|
+
|
48
|
+
if params[:rate_limit].nil? == false && party_response.response.instance_of?(Net::HTTPForbidden)
|
42
49
|
raise_exception(Quaderno::Exceptions::RateLimitExceeded, 'Rate limit exceeded', party_response)
|
43
50
|
end
|
44
|
-
|
45
|
-
|
51
|
+
|
52
|
+
if params[:subdomain_or_token].nil? == false && party_response.response.instance_of?(Net::HTTPUnauthorized)
|
53
|
+
raise_exception(Quaderno::Exceptions::InvalidSubdomainOrToken, 'Invalid subdomain or token', party_response)
|
54
|
+
end
|
55
|
+
|
56
|
+
if params[:id].nil? == false && (party_response.response.instance_of?(Net::HTTPInternalServerError) || party_response.response.instance_of?(Net::HTTPNotFound))
|
57
|
+
raise_exception(Quaderno::Exceptions::InvalidID, "Invalid #{api_model} instance identifier", party_response)
|
46
58
|
end
|
47
|
-
|
48
|
-
|
59
|
+
|
60
|
+
if params[:required_fields].nil? == false && party_response.response.instance_of?(Net::HTTPUnprocessableEntity)
|
61
|
+
raise_exception(Quaderno::Exceptions::RequiredFieldsEmptyOrInvalid, party_response.body, party_response)
|
49
62
|
end
|
50
|
-
|
51
|
-
|
63
|
+
|
64
|
+
if party_response.response.instance_of?(Net::HTTPBadRequest)
|
65
|
+
raise_exception(Quaderno::Exceptions::RequiredFieldsEmptyOrInvalid, party_response.body, party_response)
|
52
66
|
end
|
53
|
-
|
54
|
-
|
67
|
+
|
68
|
+
if params[:has_documents].nil? == false && party_response.response.instance_of?(Net::HTTPClientError)
|
69
|
+
raise_exception(Quaderno::Exceptions::HasAssociatedDocuments, party_response.body, party_response)
|
55
70
|
end
|
56
71
|
|
72
|
+
raise_exception(Quaderno::Exceptions::InvalidRequest, 'Invalid request', party_response) if party_response.response.instance_of?(Net::HTTPNotAcceptable)
|
57
73
|
raise_exception(Quaderno::Exceptions::ServerError, 'Server error', party_response) if party_response.response.is_a?(Net::HTTPServerError)
|
58
74
|
end
|
59
75
|
|
60
76
|
def raise_exception(klass, message, response)
|
61
77
|
exception = klass.new(message)
|
62
78
|
exception.rate_limit_info = response
|
79
|
+
exception.response_body = response.parsed_response
|
63
80
|
|
64
81
|
raise exception
|
65
82
|
end
|
data/lib/quaderno-ruby/tax.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Quaderno::TaxReport < OpenStruct
|
2
4
|
end
|
3
5
|
|
@@ -11,7 +13,7 @@ class Quaderno::Tax < Quaderno::Base
|
|
11
13
|
|
12
14
|
def self.calculate(options = {})
|
13
15
|
authentication = get_authentication(options.merge(api_model: api_model))
|
14
|
-
params = options.dup.delete_if { |k,
|
16
|
+
params = options.dup.delete_if { |k, _| %w[auth_token access_token api_url mode api_model].include? k.to_s }
|
15
17
|
|
16
18
|
response = get("#{authentication[:url]}tax_rates/calculate.json",
|
17
19
|
query: params,
|
@@ -47,7 +49,7 @@ class Quaderno::Tax < Quaderno::Base
|
|
47
49
|
|
48
50
|
def self.reports(options = {})
|
49
51
|
authentication = get_authentication(options.merge(api_model: api_model))
|
50
|
-
params = options.dup.delete_if { |k,
|
52
|
+
params = options.dup.delete_if { |k, _| %w[auth_token access_token api_url mode api_model].include? k.to_s }
|
51
53
|
|
52
54
|
response = get("#{authentication[:url]}taxes/reports.json",
|
53
55
|
query: params,
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Quaderno::TaxId < Quaderno::Base
|
4
|
+
api_model Quaderno::TaxId
|
5
|
+
api_path 'tax_ids'
|
6
|
+
is_a_document? false
|
7
|
+
|
8
|
+
def self.validate(country, tax_id, options = {})
|
9
|
+
authentication = get_authentication(options.merge(api_model: api_model))
|
10
|
+
|
11
|
+
response = get("#{authentication[:url]}#{api_path}/validate.json",
|
12
|
+
query: { country: country, tax_id: tax_id },
|
13
|
+
basic_auth: authentication[:basic_auth],
|
14
|
+
headers: default_headers.merge(authentication[:headers])
|
15
|
+
)
|
16
|
+
|
17
|
+
check_exception_for(response, { rate_limit: true, subdomain_or_token: true, id: true })
|
18
|
+
|
19
|
+
data = new({ valid: response.parsed_response['valid'] })
|
20
|
+
data.rate_limit_info = response
|
21
|
+
|
22
|
+
data
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Quaderno::TaxRate < Quaderno::Base
|
4
|
+
api_model Quaderno::TaxRate
|
5
|
+
api_path 'tax_rates'
|
6
|
+
|
7
|
+
def self.calculate(options = {})
|
8
|
+
authentication = get_authentication(options.merge(api_model: api_model))
|
9
|
+
params = options.dup.delete_if { |k, _| %w[auth_token access_token api_url mode api_model].include? k.to_s }
|
10
|
+
|
11
|
+
response = get("#{authentication[:url]}#{api_path}/calculate.json",
|
12
|
+
query: params,
|
13
|
+
basic_auth: authentication[:basic_auth],
|
14
|
+
headers: default_headers.merge(authentication[:headers])
|
15
|
+
)
|
16
|
+
|
17
|
+
check_exception_for(response, { rate_limit: true, subdomain_or_token: true, id: true })
|
18
|
+
data = new response.parsed_response
|
19
|
+
data.rate_limit_info = response
|
20
|
+
|
21
|
+
data
|
22
|
+
end
|
23
|
+
end
|
data/lib/quaderno-ruby.rb
CHANGED
@@ -7,9 +7,10 @@ require 'ostruct'
|
|
7
7
|
|
8
8
|
require 'quaderno-ruby/version'
|
9
9
|
require 'quaderno-ruby/helpers/rate_limit'
|
10
|
+
require 'quaderno-ruby/helpers/response'
|
10
11
|
require 'quaderno-ruby/exceptions/exceptions'
|
11
12
|
require 'quaderno-ruby/helpers/authentication'
|
12
13
|
require 'quaderno-ruby/collection'
|
13
14
|
|
14
|
-
%w
|
15
|
-
%w
|
15
|
+
%w[block crud deliver payment retrieve].each { |filename| require "quaderno-ruby/behavior/#{filename}" }
|
16
|
+
%w[base account address contact item transaction invoice receipt credit income estimate expense recurring document_item report report_request evidence payment webhook tax tax_id tax_rate tax_code tax_jurisdiction checkout_session].each { |filename| require "quaderno-ruby/#{filename}" }
|
data/quaderno.gemspec
CHANGED
@@ -21,12 +21,12 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.date = '2018-05-07'
|
22
22
|
spec.extra_rdoc_files = %w(LICENSE.txt README.md)
|
23
23
|
|
24
|
-
spec.add_dependency('httparty', '~> 0.21
|
25
|
-
spec.add_development_dependency('rdoc', '>= 6.3.1')
|
24
|
+
spec.add_dependency('httparty', '~> 0.21')
|
26
25
|
spec.add_development_dependency('activesupport', '~> 4.2.0')
|
27
|
-
spec.add_development_dependency('webmock', '~> 3.18')
|
28
|
-
spec.add_development_dependency('vcr', '>= 0')
|
29
26
|
spec.add_development_dependency('bundler', '~> 2.2')
|
30
27
|
spec.add_development_dependency('rake', '>= 12.3.3')
|
28
|
+
spec.add_development_dependency('rdoc', '>= 6.3.1')
|
31
29
|
spec.add_development_dependency('rspec', '~> 3.0')
|
30
|
+
spec.add_development_dependency('vcr', '>= 0')
|
31
|
+
spec.add_development_dependency('webmock', '~> 3.18')
|
32
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quaderno
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recrea
|
@@ -16,112 +16,112 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.21
|
19
|
+
version: '0.21'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.21
|
26
|
+
version: '0.21'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 4.2.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 4.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '2.2'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '2.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 12.3.3
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 12.3.3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rdoc
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 6.3.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 6.3.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '3.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '3.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: vcr
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: webmock
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '3.
|
117
|
+
version: '3.18'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '3.
|
124
|
+
version: '3.18'
|
125
125
|
description: " A ruby wrapper for Quaderno API "
|
126
126
|
email: carlos@recrea.es
|
127
127
|
executables: []
|
@@ -140,6 +140,8 @@ files:
|
|
140
140
|
- Rakefile
|
141
141
|
- changelog.md
|
142
142
|
- lib/quaderno-ruby.rb
|
143
|
+
- lib/quaderno-ruby/account.rb
|
144
|
+
- lib/quaderno-ruby/address.rb
|
143
145
|
- lib/quaderno-ruby/base.rb
|
144
146
|
- lib/quaderno-ruby/behavior/block.rb
|
145
147
|
- lib/quaderno-ruby/behavior/crud.rb
|
@@ -157,6 +159,7 @@ files:
|
|
157
159
|
- lib/quaderno-ruby/expense.rb
|
158
160
|
- lib/quaderno-ruby/helpers/authentication.rb
|
159
161
|
- lib/quaderno-ruby/helpers/rate_limit.rb
|
162
|
+
- lib/quaderno-ruby/helpers/response.rb
|
160
163
|
- lib/quaderno-ruby/income.rb
|
161
164
|
- lib/quaderno-ruby/invoice.rb
|
162
165
|
- lib/quaderno-ruby/item.rb
|
@@ -166,6 +169,10 @@ files:
|
|
166
169
|
- lib/quaderno-ruby/report.rb
|
167
170
|
- lib/quaderno-ruby/report_request.rb
|
168
171
|
- lib/quaderno-ruby/tax.rb
|
172
|
+
- lib/quaderno-ruby/tax_code.rb
|
173
|
+
- lib/quaderno-ruby/tax_id.rb
|
174
|
+
- lib/quaderno-ruby/tax_jurisdiction.rb
|
175
|
+
- lib/quaderno-ruby/tax_rate.rb
|
169
176
|
- lib/quaderno-ruby/transaction.rb
|
170
177
|
- lib/quaderno-ruby/version.rb
|
171
178
|
- lib/quaderno-ruby/webhook.rb
|