jortt 4.1.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/rspec.yml +27 -0
  3. data/.ruby-version +1 -1
  4. data/README.md +75 -133
  5. data/Rakefile +0 -1
  6. data/jortt.gemspec +7 -7
  7. data/lib/jortt/client/customers.rb +71 -42
  8. data/lib/jortt/client/error.rb +33 -0
  9. data/lib/jortt/client/invoices.rb +55 -31
  10. data/lib/jortt/client/ledger_accounts.rb +27 -0
  11. data/lib/jortt/client/version.rb +1 -2
  12. data/lib/jortt/client.rb +65 -16
  13. data/lib/jortt.rb +0 -1
  14. data/spec/fixtures/vcr_cassettes/Jortt/_client/1_1_1.yml +64 -0
  15. data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_customers/1_1_1_1.yml +64 -0
  16. data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_invoices/1_1_2_1.yml +64 -0
  17. data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_ledger_accounts/1_1_3_1.yml +64 -0
  18. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_create/faulty_payload/shows_a_nice_error.yml +413 -0
  19. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_create/valid_payload/creates_the_customer.yml +505 -0
  20. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_delete/deletes_the_customer.yml +505 -0
  21. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_direct_debit_mandate/sends_direct_debit_mandate_to_the_customer_or_responds_with_an_error_when_not_possible.yml +470 -0
  22. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_index/query/returns_the_queried_customers.yml +464 -0
  23. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_index/without_params/returns_customers.yml +415 -0
  24. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_show/returns_the_customer.yml +464 -0
  25. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_update/updates_the_customer.yml +603 -0
  26. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_vat_percentages/returns_the_vat_percentages.yml +330 -0
  27. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_create/creates_the_invoice.yml +170 -0
  28. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_credit/credits_the_invoice.yml +374 -0
  29. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_download/returns_the_invoice_download_link.yml +168 -0
  30. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_index/invoice_status/returns_those_invoices.yml +776 -0
  31. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_index/query/returns_the_queried_invoices.yml +315 -0
  32. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_show/returns_the_invoice.yml +421 -0
  33. data/spec/fixtures/vcr_cassettes/Jortt_Client_LedgerAccounts/_index/returns_invoices.yml +118 -0
  34. data/spec/jortt/client/customers_spec.rb +109 -20
  35. data/spec/jortt/client/invoices_spec.rb +118 -20
  36. data/spec/jortt/client/ledger_accounts_spec.rb +19 -0
  37. data/spec/jortt/client_spec.rb +5 -27
  38. data/spec/jortt_spec.rb +2 -3
  39. data/spec/spec_helper.rb +18 -4
  40. metadata +85 -41
  41. data/.rubocop.yml +0 -26
  42. data/.travis.yml +0 -7
  43. data/lib/jortt/client/invoice.rb +0 -50
  44. data/spec/jortt/client/invoice_spec.rb +0 -23
@@ -0,0 +1,168 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://app.jortt.nl/oauth-provider/oauth/token
6
+ body:
7
+ encoding: UTF-8
8
+ string: grant_type=client_credentials&scope=invoices%3Aread+invoices%3Awrite+customers%3Aread+customers%3Awrite
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v1.0.1
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Thu, 24 Sep 2020 15:03:34 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Status:
32
+ - 200 OK
33
+ Cache-Control:
34
+ - private, no-store
35
+ Referrer-Policy:
36
+ - strict-origin-when-cross-origin
37
+ X-Permitted-Cross-Domain-Policies:
38
+ - none
39
+ Pragma:
40
+ - no-cache
41
+ X-Xss-Protection:
42
+ - 1; mode=block
43
+ X-Request-Id:
44
+ - 571bb0a8-eae0-4c8d-908a-0f05228ae7f1
45
+ X-Download-Options:
46
+ - noopen
47
+ Etag:
48
+ - W/"f5ff4029cd3ff8024d105668befd03e2"
49
+ X-Frame-Options:
50
+ - SAMEORIGIN
51
+ X-Runtime:
52
+ - '0.317214'
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Powered-By:
56
+ - Phusion Passenger
57
+ Server:
58
+ - nginx + Phusion Passenger
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"access_token":"qUCGp3DsxLLzRAIhGVlXagVeHBoyRCeRlGj1EVCOw6o","token_type":"Bearer","expires_in":7200,"scope":"invoices:read
62
+ invoices:write customers:read customers:write","created_at":1600959814}'
63
+ recorded_at: Thu, 24 Sep 2020 15:03:34 GMT
64
+ - request:
65
+ method: get
66
+ uri: https://api.jortt.nl/invoices?invoice_status&page=1&query=Download%20test
67
+ body:
68
+ encoding: US-ASCII
69
+ string: ''
70
+ headers:
71
+ User-Agent:
72
+ - Faraday v1.0.1
73
+ Accept-Encoding:
74
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
75
+ Accept:
76
+ - "*/*"
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ Date:
83
+ - Thu, 24 Sep 2020 15:03:34 GMT
84
+ Content-Type:
85
+ - application/json
86
+ Content-Length:
87
+ - '1673'
88
+ Connection:
89
+ - keep-alive
90
+ Server:
91
+ - Apache
92
+ Status:
93
+ - 200 OK
94
+ Content-Security-Policy:
95
+ - 'default-src ''self'' ''unsafe-inline'' blob: data: *.jortt.nl; script-src
96
+ ''self'' ''unsafe-eval'' blob: ''unsafe-inline'' files.jortt.nl *.googletagmanager.com
97
+ *.uservoice.com inlinemanual.com *.google-analytics.com *.googleadservices.com
98
+ bat.bing.com tapfiliate.com static.ads-twitter.com tagmanager.google.com analytics.twitter.com
99
+ https://connect.facebook.net https://app.inlinemanual.com; connect-src
100
+ ''self'' https://*.jortt.nl wss://*.jortt.nl analytics.inlinemanual.com files.jortt.nl
101
+ www.google-analytics.com stats.g.doubleclick.net file-storage-app-production.s3.eu-central-1.amazonaws.com
102
+ https://app.inlinemanual.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com
103
+ files.jortt.nl tagmanager.google.com https://app.inlinemanual.com; font-src
104
+ ''self'' data: fonts.gstatic.com files.jortt.nl https://app.inlinemanual.com; frame-src
105
+ ''self'' *.jortt.nl files.jortt.nl b.frstre.com beacon.tapfiliate.com jortt.uservoice.com
106
+ *.vimeo.com https://connect.facebook.net; img-src ''self'' blob: data:
107
+ *.jortt.nl https://www.facebook.com files.jortt.nl www.google-analytics.com
108
+ stats.g.doubleclick.net www.google.nl www.google.com bat.bing.com googleads.g.doubleclick.net
109
+ https://www.googletagmanager.com https://widget.uservoice.com www.google.de
110
+ t.co *.gstatic.com https://ssl.google-analytics.com https://app.inlinemanual.com'
111
+ body:
112
+ encoding: UTF-8
113
+ string: '{"data":[{"id":"75d6f559-0295-4586-9aa9-2ab3ce42f6a6","invoice_status":"sent","customer_id":"21a81a13-312f-4914-886b-75746c300a92","invoice_number":"202009-010","invoice_date":"2020-09-22","invoice_due_date":"2020-10-22","invoice_delivery_period":"2020-09-01","invoice_date_sent":"2020-09-22","invoice_total":{"value":"100.00","currency":"EUR"},"invoice_total_incl_vat":{"value":"121.00","currency":"EUR"},"invoice_due_amount":{"value":"121.00","currency":"EUR"},"send_method":"self","net_amounts":false,"invoice_marked_free_of_vat":false,"credited_invoice_id":null,"remarks":null,"introduction":null,"number_of_reminders_sent":0,"last_reminded_at":null,"payment_method":"pay_later","customer_company_name":"Search
114
+ target","customer_attn":null,"customer_address_street":null,"customer_address_city":null,"customer_address_postal_code":null,"customer_address_country_code":"NL","customer_address_country_name":"Nederland","customer_address_extra_information":null,"customer_vat_shifted":null,"customer_vat_number":null,"customer_in_eu":true,"customer_reference":null,"customer_mail_to":null,"customer_mail_cc_addresses":[],"language":"nl","line_items":[{"description":"Download
115
+ test","vat":21.0,"amount_per_unit":{"value":"100.00","currency":"EUR"},"total_amount_excl_vat":{"value":"100.00","currency":"EUR"},"units":1.0,"ledger_account_id":"05ba2a61-a0cc-4736-9000-89fb361e85c8"}],"reference":null,"created_at":"2020-09-22T15:12:16+02:00"}],"_links":{"previous":null,"next":null,"self":{"href":"https://api.jortt.nl/invoices?query=Download%20test\u0026page=1","type":"application/json"},"documentation":{"href":"https://developer.jortt.nl/#pagination","type":"text/html"}}}'
116
+ recorded_at: Thu, 24 Sep 2020 15:03:34 GMT
117
+ - request:
118
+ method: get
119
+ uri: https://api.jortt.nl/invoices/75d6f559-0295-4586-9aa9-2ab3ce42f6a6/download
120
+ body:
121
+ encoding: US-ASCII
122
+ string: ''
123
+ headers:
124
+ User-Agent:
125
+ - Faraday v1.0.1
126
+ Accept-Encoding:
127
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
128
+ Accept:
129
+ - "*/*"
130
+ response:
131
+ status:
132
+ code: 200
133
+ message: OK
134
+ headers:
135
+ Date:
136
+ - Thu, 24 Sep 2020 15:03:34 GMT
137
+ Content-Type:
138
+ - application/json
139
+ Content-Length:
140
+ - '615'
141
+ Connection:
142
+ - keep-alive
143
+ Server:
144
+ - Apache
145
+ Status:
146
+ - 200 OK
147
+ Content-Security-Policy:
148
+ - 'default-src ''self'' ''unsafe-inline'' blob: data: *.jortt.nl; script-src
149
+ ''self'' ''unsafe-eval'' blob: ''unsafe-inline'' files.jortt.nl *.googletagmanager.com
150
+ *.uservoice.com inlinemanual.com *.google-analytics.com *.googleadservices.com
151
+ bat.bing.com tapfiliate.com static.ads-twitter.com tagmanager.google.com analytics.twitter.com
152
+ https://connect.facebook.net https://app.inlinemanual.com; connect-src
153
+ ''self'' https://*.jortt.nl wss://*.jortt.nl analytics.inlinemanual.com files.jortt.nl
154
+ www.google-analytics.com stats.g.doubleclick.net file-storage-app-production.s3.eu-central-1.amazonaws.com
155
+ https://app.inlinemanual.com; style-src ''self'' ''unsafe-inline'' fonts.googleapis.com
156
+ files.jortt.nl tagmanager.google.com https://app.inlinemanual.com; font-src
157
+ ''self'' data: fonts.gstatic.com files.jortt.nl https://app.inlinemanual.com; frame-src
158
+ ''self'' *.jortt.nl files.jortt.nl b.frstre.com beacon.tapfiliate.com jortt.uservoice.com
159
+ *.vimeo.com https://connect.facebook.net; img-src ''self'' blob: data:
160
+ *.jortt.nl https://www.facebook.com files.jortt.nl www.google-analytics.com
161
+ stats.g.doubleclick.net www.google.nl www.google.com bat.bing.com googleads.g.doubleclick.net
162
+ https://www.googletagmanager.com https://widget.uservoice.com www.google.de
163
+ t.co *.gstatic.com https://ssl.google-analytics.com https://app.inlinemanual.com'
164
+ body:
165
+ encoding: UTF-8
166
+ string: '{"data":{"download_location":"https://files.jortt.nl/29d26011-51ed-418d-a9f2-2e55349d37d6/75d6f559-0295-4586-9aa9-2ab3ce42f6a6?response-content-disposition=attachment;filename=202009-010.pdf\u0026Expires=1600960414\u0026Signature=aPu1qDX1M-NbnKYF7jaShsC3ur~iqcjI-Rg7U92LDbdWdWip413aBGMqXQ8FR8QAFsZL6Zvfid2mT4sYy7V1t3gHYBrVJFdCc-z3HXQwNRAM-SeGhWFDMio2IIa4LGaA6N3RT-5P53uMi7ceh96NXxTDET-DhGhiQFHzffaGSKsYGTm0QV9u998e2IfpjBBZtXDRm72QLI48Cb~kvryv8GhbZ0qFoGp8Ser9UXQqWtoTmmHLdB-ABjsZZJzYZQKqkCxbDViV-pVRVyHMGCc1TwY8bNRYPlZ7TARCxPbAm3tXmY~1eJp0ua6U~1P2LlJE-kXDM~IDD4ruD5L627YLzA__\u0026Key-Pair-Id=APKAJQLVUY5LXNQN6NRQ"}}'
167
+ recorded_at: Thu, 24 Sep 2020 15:03:34 GMT
168
+ recorded_with: VCR 6.0.0