trolley 1.0.2 → 1.1.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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trolley/Client.rb +6 -1
  3. data/lib/trolley/Gateway.rb +7 -1
  4. data/lib/trolley/InvoicePayment.rb +6 -1
  5. data/lib/trolley/OfflinePayment.rb +2 -1
  6. data/lib/trolley/Payment.rb +4 -1
  7. data/lib/trolley/Recipient.rb +0 -2
  8. data/lib/trolley/RecipientAccount.rb +4 -1
  9. data/lib/trolley/RecipientLog.rb +12 -0
  10. data/lib/trolley/gateways/BalanceGateway.rb +18 -1
  11. data/lib/trolley/gateways/PaymentGateway.rb +5 -0
  12. data/lib/trolley/gateways/RecipientGateway.rb +5 -1
  13. data/lib/trolley/gateways/VerificationGateway.rb +40 -0
  14. data/lib/trolley/utils/PaginatedArray.rb +8 -3
  15. data/lib/trolley/utils/ResponseMapper.rb +2 -1
  16. data/lib/trolley.rb +3 -1
  17. data/test/fixtures/BalanceTest/test_find.yml +71 -0
  18. data/test/fixtures/BalanceTest/test_find_with_term.yml +71 -0
  19. data/test/fixtures/BatchTest/test_create.yml +150 -0
  20. data/test/fixtures/BatchTest/test_create_with_payments.yml +541 -0
  21. data/test/fixtures/BatchTest/test_delete_multiple.yml +209 -0
  22. data/test/fixtures/BatchTest/test_payments.yml +434 -0
  23. data/test/fixtures/BatchTest/test_processing.yml +578 -0
  24. data/test/fixtures/BatchTest/test_summary.yml +440 -0
  25. data/test/fixtures/BatchTest/test_update.yml +356 -0
  26. data/test/fixtures/InvoicePaymentTest/test_create.yml +489 -0
  27. data/test/fixtures/InvoicePaymentTest/test_delete.yml +634 -0
  28. data/test/fixtures/InvoicePaymentTest/test_find.yml +420 -0
  29. data/test/fixtures/InvoicePaymentTest/test_update.yml +634 -0
  30. data/test/fixtures/InvoiceTest/test_create.yml +293 -0
  31. data/test/fixtures/InvoiceTest/test_create_line.yml +353 -0
  32. data/test/fixtures/InvoiceTest/test_delete.yml +433 -0
  33. data/test/fixtures/InvoiceTest/test_delete_line.yml +353 -0
  34. data/test/fixtures/InvoiceTest/test_find.yml +284 -0
  35. data/test/fixtures/InvoiceTest/test_search.yml +293 -0
  36. data/test/fixtures/InvoiceTest/test_support_error_arrays.yml +71 -0
  37. data/test/fixtures/InvoiceTest/test_update.yml +428 -0
  38. data/test/fixtures/InvoiceTest/test_update_line.yml +422 -0
  39. data/test/fixtures/OfflinePaymentTest/test_create.yml +213 -0
  40. data/test/fixtures/OfflinePaymentTest/test_delete.yml +281 -0
  41. data/test/fixtures/OfflinePaymentTest/test_search.yml +281 -0
  42. data/test/fixtures/OfflinePaymentTest/test_update.yml +281 -0
  43. data/test/fixtures/PaymentTest/test_crud.yml +510 -0
  44. data/test/fixtures/PaymentTest/test_search.yml +366 -0
  45. data/test/fixtures/RecipientAccountTest/test_basic_crud.yml +351 -0
  46. data/test/fixtures/RecipientTest/test_account.yml +499 -0
  47. data/test/fixtures/RecipientTest/test_create.yml +72 -0
  48. data/test/fixtures/RecipientTest/test_delete_multiple.yml +347 -0
  49. data/test/fixtures/RecipientTest/test_find_logs.yml +278 -0
  50. data/test/fixtures/RecipientTest/test_find_payments.yml +512 -0
  51. data/test/fixtures/RecipientTest/test_lifecycle.yml +347 -0
  52. data/test/integration/BalanceTest.rb +22 -0
  53. data/test/integration/BatchTest.rb +157 -0
  54. data/test/integration/InvoicePaymentTest.rb +109 -0
  55. data/test/integration/InvoiceTest.rb +156 -0
  56. data/test/integration/OfflinePaymentTest.rb +109 -0
  57. data/test/integration/PaymentTest.rb +73 -0
  58. data/test/integration/RecipientAccountTest.rb +52 -0
  59. data/test/integration/RecipientTest.rb +176 -0
  60. data/test/test_helper.rb +45 -0
  61. data/test/unit/ClientRequestTest.rb +54 -0
  62. data/{spec → test}/unit/ConfigurationTest.rb +1 -1
  63. data/test/unit/GatewayParityTest.rb +184 -0
  64. data/{spec → test}/unit/PaginatedArrayTest.rb +3 -1
  65. data/{spec → test}/unit/TrolleyTest.rb +2 -2
  66. data/trolley.gemspec +11 -8
  67. metadata +101 -18
  68. data/spec/integration/BatchTest.rb +0 -126
  69. data/spec/integration/InvoicePaymentTest.rb +0 -92
  70. data/spec/integration/InvoiceTest.rb +0 -128
  71. data/spec/integration/RecipientAccountTest.rb +0 -48
  72. data/spec/integration/RecipientTest.rb +0 -159
  73. data/spec/integration/helper.rb +0 -19
  74. /data/{spec → test}/unit/ResponseMapperTest.rb +0 -0
@@ -0,0 +1,634 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.trolley.com/v1/recipients/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"type":"individual","firstName":"Tom","lastName":"Jones","email":"test.batchda5046a1-055d-4a87-bd18-d9f312af3c78@example.com","address":{"street1":"123
9
+ Wolfstrasse","city":"Berlin","country":"DE","postalCode":"123123"}}'
10
+ headers:
11
+ X-Pr-Timestamp:
12
+ - '1688741140'
13
+ Content-Type:
14
+ - application/json
15
+ Accept-Encoding:
16
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
17
+ Accept:
18
+ - "*/*"
19
+ User-Agent:
20
+ - Ruby
21
+ response:
22
+ status:
23
+ code: 200
24
+ message: OK
25
+ headers:
26
+ Date:
27
+ - Fri, 07 Jul 2023 14:45:40 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Content-Length:
31
+ - '1289'
32
+ Connection:
33
+ - keep-alive
34
+ Cache-Control:
35
+ - no-store, no-cache
36
+ Content-Security-Policy:
37
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
38
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
39
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
40
+ X-Dns-Prefetch-Control:
41
+ - 'off'
42
+ Expect-Ct:
43
+ - max-age=0
44
+ Strict-Transport-Security:
45
+ - max-age=15552000; includeSubDomains
46
+ X-Download-Options:
47
+ - noopen
48
+ X-Content-Type-Options:
49
+ - nosniff
50
+ X-Permitted-Cross-Domain-Policies:
51
+ - none
52
+ Referrer-Policy:
53
+ - no-referrer
54
+ X-Xss-Protection:
55
+ - '0'
56
+ Access-Control-Allow-Origin:
57
+ - "*"
58
+ X-Rate-Limit-Limit:
59
+ - '600'
60
+ X-Rate-Limit-Remaining:
61
+ - '583'
62
+ X-Rate-Limit-Reset:
63
+ - '1688741188'
64
+ Vary:
65
+ - Origin
66
+ Etag:
67
+ - W/"509-WZTqgOT4LlwexRuakzlmyQ+iIz4"
68
+ body:
69
+ encoding: UTF-8
70
+ string: '{"ok":true,"recipient":{"id":"R-Ae6THsUfXUafQVoMugH9vJ","referenceId":"R-Ae6THsUfXUafQVoMugH9vJ","parentRecipientId":null,"email":"test.batchda5046a1-055d-4a87-bd18-d9f312af3c78@example.com","name":"Tom
71
+ Jones","lastName":"Jones","firstName":"Tom","legalName":"","type":"individual","status":"incomplete","language":"en","complianceStatus":"pending","dob":null,"passport":"","placeOfBirth":null,"updatedAt":"2023-07-07T14:45:40.592Z","createdAt":"2023-07-07T14:45:40.592Z","tags":[],"isPortalUser":false,"taxDeliveryType":"mail","contactEmails":[],"occupation":"","address":{"street1":"123
72
+ Wolfstrasse","street2":"","city":"Berlin","postalCode":"123123","country":"DE","region":null,"phone":"","phoneValidated":false},"compliance":{"status":"pending","checkedAt":null},"gravatarUrl":"https://www.gravatar.com/avatar/96a497694b8e7d339da17fd5a554c1ab?d=404","governmentId":null,"ssn":null,"governmentIds":[],"birthplace":{"country":null,"region":null,"city":null},"citizenships":[],"routeType":"sepa","routeMinimum":"0","estimatedFees":"3","accounts":[],"payoutMethod":null,"primaryCurrency":null,"riskScore":null,"riskScoreLabel":null,"merchantId":"M-C7AsydAeAqW3husDNHSAND","inactiveReasons":{"primaryAccount":"missing"},"taxWithholdingPercentage":null,"taxForm":null,"taxFormStatus":null}}'
73
+ recorded_at: Fri, 07 Jul 2023 14:45:40 GMT
74
+ - request:
75
+ method: post
76
+ uri: https://api.trolley.com/v1/recipients/R-Ae6THsUfXUafQVoMugH9vJ/accounts
77
+ body:
78
+ encoding: UTF-8
79
+ string: '{"type":"bank-transfer","currency":"EUR","country":"DE","iban":"DE89
80
+ 3704 0044 0532 0130 00"}'
81
+ headers:
82
+ X-Pr-Timestamp:
83
+ - '1688741140'
84
+ Content-Type:
85
+ - application/json
86
+ Accept-Encoding:
87
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
88
+ Accept:
89
+ - "*/*"
90
+ User-Agent:
91
+ - Ruby
92
+ response:
93
+ status:
94
+ code: 200
95
+ message: OK
96
+ headers:
97
+ Date:
98
+ - Fri, 07 Jul 2023 14:45:41 GMT
99
+ Content-Type:
100
+ - application/json; charset=utf-8
101
+ Content-Length:
102
+ - '657'
103
+ Connection:
104
+ - keep-alive
105
+ Cache-Control:
106
+ - no-store, no-cache
107
+ Content-Security-Policy:
108
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
109
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
110
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
111
+ X-Dns-Prefetch-Control:
112
+ - 'off'
113
+ Expect-Ct:
114
+ - max-age=0
115
+ Strict-Transport-Security:
116
+ - max-age=15552000; includeSubDomains
117
+ X-Download-Options:
118
+ - noopen
119
+ X-Content-Type-Options:
120
+ - nosniff
121
+ X-Permitted-Cross-Domain-Policies:
122
+ - none
123
+ Referrer-Policy:
124
+ - no-referrer
125
+ X-Xss-Protection:
126
+ - '0'
127
+ Access-Control-Allow-Origin:
128
+ - "*"
129
+ X-Rate-Limit-Limit:
130
+ - '600'
131
+ X-Rate-Limit-Remaining:
132
+ - '582'
133
+ X-Rate-Limit-Reset:
134
+ - '1688741188'
135
+ Vary:
136
+ - Origin
137
+ Etag:
138
+ - W/"291-R4B6WutZokM3yCLg9Kj0ccvX4x0"
139
+ body:
140
+ encoding: UTF-8
141
+ string: '{"ok":true,"account":{"status":"primary","type":"bank-transfer","primary":true,"currency":"EUR","id":"A-0d9Zu9m848wPqyTxweQAxb","recipientId":"R-Ae6THsUfXUafQVoMugH9vJ","recipientAccountId":"A-0d9Zu9m848wPqyTxweQAxb","disabledAt":null,"deliveryBusinessDaysEstimate":5,"country":"DE","iban":"********************00","accountNum":"","bankAccountType":null,"bankCodeMappingId":null,"accountHolderName":"Tom
142
+ Jones","swiftBic":"COBADEFFXXX","branchId":"","bankId":"","bankName":"Commerzbank
143
+ AG","bankAddress":"Unter Sachsenhausen 21-27","bankCity":"Cologne","bankRegionCode":"Nordrhein-Westfalen","bankPostalCode":"50667","routeType":"sepa","recipientFees":"2"}}'
144
+ recorded_at: Fri, 07 Jul 2023 14:45:41 GMT
145
+ - request:
146
+ method: post
147
+ uri: https://api.trolley.com/v1/invoices/create
148
+ body:
149
+ encoding: UTF-8
150
+ string: '{"recipientId":"R-Ae6THsUfXUafQVoMugH9vJ","description":"Integration
151
+ Test Invoice Create"}'
152
+ headers:
153
+ X-Pr-Timestamp:
154
+ - '1688741141'
155
+ Content-Type:
156
+ - application/json
157
+ Accept-Encoding:
158
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
159
+ Accept:
160
+ - "*/*"
161
+ User-Agent:
162
+ - Ruby
163
+ response:
164
+ status:
165
+ code: 200
166
+ message: OK
167
+ headers:
168
+ Date:
169
+ - Fri, 07 Jul 2023 14:45:42 GMT
170
+ Content-Type:
171
+ - application/json; charset=utf-8
172
+ Content-Length:
173
+ - '582'
174
+ Connection:
175
+ - keep-alive
176
+ Cache-Control:
177
+ - no-store, no-cache
178
+ Content-Security-Policy:
179
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
180
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
181
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
182
+ X-Dns-Prefetch-Control:
183
+ - 'off'
184
+ Expect-Ct:
185
+ - max-age=0
186
+ Strict-Transport-Security:
187
+ - max-age=15552000; includeSubDomains
188
+ X-Download-Options:
189
+ - noopen
190
+ X-Content-Type-Options:
191
+ - nosniff
192
+ X-Permitted-Cross-Domain-Policies:
193
+ - none
194
+ Referrer-Policy:
195
+ - no-referrer
196
+ X-Xss-Protection:
197
+ - '0'
198
+ Access-Control-Allow-Origin:
199
+ - "*"
200
+ X-Rate-Limit-Limit:
201
+ - '600'
202
+ X-Rate-Limit-Remaining:
203
+ - '581'
204
+ X-Rate-Limit-Reset:
205
+ - '1688741188'
206
+ Vary:
207
+ - Origin
208
+ Etag:
209
+ - W/"246-/Ez6vpB4VUUHGSGWFyGX4T1D6ko"
210
+ body:
211
+ encoding: UTF-8
212
+ string: '{"ok":true,"invoice":{"id":"I-Y3B3d1RexwPr8c5AACWzdc","invoiceNumber":"","description":"Integration
213
+ Test Invoice Create","status":"open","externalId":null,"invoiceDate":"2023-07-07T14:45:42.016Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-07-07T14:45:42.015Z","updatedAt":"2023-07-07T14:45:42.015Z","totalAmount":{"value":"0.00","currency":"CAD"},"paidAmount":{"value":"0.00","currency":"CAD"},"pendingAmount":{"value":"0.00","currency":"CAD"},"dueAmount":{"value":"0.00","currency":"CAD"},"tags":[],"lines":[],"recipientId":"R-Ae6THsUfXUafQVoMugH9vJ","syncDetails":null}}'
214
+ recorded_at: Fri, 07 Jul 2023 14:45:42 GMT
215
+ - request:
216
+ method: post
217
+ uri: https://api.trolley.com/v1/invoices/search
218
+ body:
219
+ encoding: UTF-8
220
+ string: "{}"
221
+ headers:
222
+ X-Pr-Timestamp:
223
+ - '1688741142'
224
+ Content-Type:
225
+ - application/json
226
+ Accept-Encoding:
227
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
228
+ Accept:
229
+ - "*/*"
230
+ User-Agent:
231
+ - Ruby
232
+ response:
233
+ status:
234
+ code: 200
235
+ message: OK
236
+ headers:
237
+ Date:
238
+ - Fri, 07 Jul 2023 14:45:42 GMT
239
+ Content-Type:
240
+ - application/json; charset=utf-8
241
+ Content-Length:
242
+ - '8957'
243
+ Connection:
244
+ - keep-alive
245
+ Cache-Control:
246
+ - no-store, no-cache
247
+ Content-Security-Policy:
248
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
249
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
250
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
251
+ X-Dns-Prefetch-Control:
252
+ - 'off'
253
+ Expect-Ct:
254
+ - max-age=0
255
+ Strict-Transport-Security:
256
+ - max-age=15552000; includeSubDomains
257
+ X-Download-Options:
258
+ - noopen
259
+ X-Content-Type-Options:
260
+ - nosniff
261
+ X-Permitted-Cross-Domain-Policies:
262
+ - none
263
+ Referrer-Policy:
264
+ - no-referrer
265
+ X-Xss-Protection:
266
+ - '0'
267
+ Access-Control-Allow-Origin:
268
+ - "*"
269
+ X-Rate-Limit-Limit:
270
+ - '600'
271
+ X-Rate-Limit-Remaining:
272
+ - '580'
273
+ X-Rate-Limit-Reset:
274
+ - '1688741188'
275
+ Vary:
276
+ - Origin
277
+ Etag:
278
+ - W/"22fd-8JwVa18fdQ2/+0wv2tw+hEf0q3U"
279
+ body:
280
+ encoding: UTF-8
281
+ string: '{"ok":true,"invoices":[{"id":"I-Y3B3d1RexwPr8c5AACWzdc","invoiceNumber":"","description":"Integration
282
+ Test Invoice Create","status":"open","externalId":null,"invoiceDate":"2023-07-07T14:45:42.016Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-07-07T14:45:42.015Z","updatedAt":"2023-07-07T14:45:42.015Z","totalAmount":{"value":"0.00","currency":"CAD"},"paidAmount":{"value":"0.00","currency":"CAD"},"pendingAmount":{"value":"0.00","currency":"CAD"},"dueAmount":{"value":"0.00","currency":"CAD"},"tags":[],"lines":[],"recipientId":"R-Ae6THsUfXUafQVoMugH9vJ","syncDetails":null},{"id":"I-KyBtB1G8BMQWBsDkqPcxSx","invoiceNumber":"","description":"Integration
283
+ Test Invoice Create","status":"open","externalId":null,"invoiceDate":"2023-07-07T14:45:35.394Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-07-07T14:45:35.393Z","updatedAt":"2023-07-07T14:45:39.540Z","totalAmount":{"value":"2000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"dueAmount":{"value":"2000.00","currency":"USD"},"tags":[],"lines":[{"id":"IL-VNTkt2Yc5xcKFWPZG7B7vJ","status":"open","itemUrl":null,"description":"","unitAmount":{"value":"2000.00","currency":"USD"},"quantity":"1","discountAmount":{"value":"0.00","currency":"USD"},"taxAmount":{"value":"0.00","currency":"USD"},"totalAmount":{"value":"2000.00","currency":"USD"},"dueAmount":{"value":"2000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"externalId":null,"taxReportable":true,"tags":[],"category":"services","forceUsTaxActivity":false}],"recipientId":"R-YYzDLzqxLGzzmjg799e4CB","syncDetails":null},{"id":"I-WPxnDpA98RBkfFSuARC9kc","invoiceNumber":"","description":"Integration
284
+ Test Invoice Create","status":"pending","externalId":null,"invoiceDate":"2023-07-07T14:45:29.111Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-07-07T14:45:29.110Z","updatedAt":"2023-07-07T14:45:31.918Z","totalAmount":{"value":"2000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"2000.00","currency":"USD"},"dueAmount":{"value":"0.00","currency":"USD"},"tags":[],"lines":[{"id":"IL-12Gk2jDnmcJF4jWBwmDEFN","status":"pending","itemUrl":null,"description":"","unitAmount":{"value":"2000.00","currency":"USD"},"quantity":"1","discountAmount":{"value":"0.00","currency":"USD"},"taxAmount":{"value":"0.00","currency":"USD"},"totalAmount":{"value":"2000.00","currency":"USD"},"dueAmount":{"value":"0.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"2000.00","currency":"USD"},"externalId":null,"taxReportable":true,"tags":[],"category":"services","forceUsTaxActivity":false}],"recipientId":"R-LWsKrAVjMtJizN4MYwijhK","syncDetails":null},{"id":"I-AR5CSPdacZ7KFXEVQQj1vy","invoiceNumber":"","description":"Integration
285
+ Test Invoice Create","status":"open","externalId":null,"invoiceDate":"2023-07-07T14:23:04.408Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-07-07T14:23:04.407Z","updatedAt":"2023-07-07T14:23:05.380Z","totalAmount":{"value":"3000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"dueAmount":{"value":"3000.00","currency":"USD"},"tags":[],"lines":[{"id":"IL-FTd1tUYPqn836ykHBwpUXc","status":"open","itemUrl":null,"description":"","unitAmount":{"value":"3000.00","currency":"USD"},"quantity":"1","discountAmount":{"value":"0.00","currency":"USD"},"taxAmount":{"value":"0.00","currency":"USD"},"totalAmount":{"value":"3000.00","currency":"USD"},"dueAmount":{"value":"3000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"externalId":null,"taxReportable":true,"tags":[],"category":"services","forceUsTaxActivity":false}],"recipientId":"R-KyYipkQVKGBZtvN9HF1rxe","syncDetails":null},{"id":"I-LkR5vNkM9e6cJBZWbcDbbu","invoiceNumber":"","description":"Integration
286
+ Test Invoice Update","status":"open","externalId":null,"invoiceDate":"2023-07-07T14:23:01.495Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-07-07T14:23:01.494Z","updatedAt":"2023-07-07T14:23:02.432Z","totalAmount":{"value":"0.00","currency":"CAD"},"paidAmount":{"value":"0.00","currency":"CAD"},"pendingAmount":{"value":"0.00","currency":"CAD"},"dueAmount":{"value":"0.00","currency":"CAD"},"tags":[],"lines":[],"recipientId":"R-BYXWLU8BdiMqPRAq3KdR4A","syncDetails":null},{"id":"I-4kkBfJj4eqkb2LwfqoGcB2","invoiceNumber":"","description":"Integration
287
+ Test Invoice Create","status":"open","externalId":null,"invoiceDate":"2023-07-07T14:22:58.372Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-07-07T14:22:58.371Z","updatedAt":"2023-07-07T14:22:59.507Z","totalAmount":{"value":"0.00","currency":"CAD"},"paidAmount":{"value":"0.00","currency":"CAD"},"pendingAmount":{"value":"0.00","currency":"CAD"},"dueAmount":{"value":"0.00","currency":"CAD"},"tags":[],"lines":[],"recipientId":"R-6U3ScNUsyv3c93kp1Ye7sZ","syncDetails":null},{"id":"I-CRzRPFRAAuSgQpETFFT2NQ","invoiceNumber":"","description":"Integration
288
+ Test Invoice Create","status":"open","externalId":null,"invoiceDate":"2023-04-27T05:19:28.431Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-04-27T05:19:28.430Z","updatedAt":"2023-04-27T05:19:30.860Z","totalAmount":{"value":"2000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"dueAmount":{"value":"2000.00","currency":"USD"},"tags":[],"lines":[{"id":"IL-SQumcQpXFbr35Hi4d3jPxP","status":"open","itemUrl":null,"description":"","unitAmount":{"value":"2000.00","currency":"USD"},"quantity":"1","discountAmount":{"value":"0.00","currency":"USD"},"taxAmount":{"value":"0.00","currency":"USD"},"totalAmount":{"value":"2000.00","currency":"USD"},"dueAmount":{"value":"2000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"externalId":null,"taxReportable":true,"tags":[],"category":"services","forceUsTaxActivity":false}],"recipientId":"R-4npnPs9g4tTVELyN5ok9Pq","syncDetails":null},{"id":"I-0trcKbHjGnfF9ZgUhZ2cFa","invoiceNumber":"","description":"Integration
289
+ Test Invoice Create","status":"pending","externalId":null,"invoiceDate":"2023-04-27T05:19:25.460Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-04-27T05:19:25.460Z","updatedAt":"2023-04-27T05:19:26.416Z","totalAmount":{"value":"2000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"2000.00","currency":"USD"},"dueAmount":{"value":"0.00","currency":"USD"},"tags":[],"lines":[{"id":"IL-492gJCBUAXsMk4SSMJVsuk","status":"pending","itemUrl":null,"description":"","unitAmount":{"value":"2000.00","currency":"USD"},"quantity":"1","discountAmount":{"value":"0.00","currency":"USD"},"taxAmount":{"value":"0.00","currency":"USD"},"totalAmount":{"value":"2000.00","currency":"USD"},"dueAmount":{"value":"0.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"2000.00","currency":"USD"},"externalId":null,"taxReportable":true,"tags":[],"category":"services","forceUsTaxActivity":false}],"recipientId":"R-BmeaJoSH5PMxnVKgQZ8UmZ","syncDetails":null},{"id":"I-EntdoCRegJUPDiEQpRPgSB","invoiceNumber":"","description":"Integration
290
+ Test Invoice Create","status":"open","externalId":null,"invoiceDate":"2023-04-27T05:17:04.527Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-04-27T05:17:04.526Z","updatedAt":"2023-04-27T05:17:05.266Z","totalAmount":{"value":"3000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"dueAmount":{"value":"3000.00","currency":"USD"},"tags":[],"lines":[{"id":"IL-GEi47z564qg2XTdPAKJ27U","status":"open","itemUrl":null,"description":"","unitAmount":{"value":"3000.00","currency":"USD"},"quantity":"1","discountAmount":{"value":"0.00","currency":"USD"},"taxAmount":{"value":"0.00","currency":"USD"},"totalAmount":{"value":"3000.00","currency":"USD"},"dueAmount":{"value":"3000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"externalId":null,"taxReportable":true,"tags":[],"category":"services","forceUsTaxActivity":false}],"recipientId":"R-2npVASUJCBjzJJAZhPQCaw","syncDetails":null},{"id":"I-WTnNRv99BK8ioisUQjmCdi","invoiceNumber":"","description":"Integration
291
+ Test Invoice Update","status":"open","externalId":null,"invoiceDate":"2023-04-27T05:17:02.294Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-04-27T05:17:02.293Z","updatedAt":"2023-04-27T05:17:03.036Z","totalAmount":{"value":"0.00","currency":"CAD"},"paidAmount":{"value":"0.00","currency":"CAD"},"pendingAmount":{"value":"0.00","currency":"CAD"},"dueAmount":{"value":"0.00","currency":"CAD"},"tags":[],"lines":[],"recipientId":"R-5vuuMrEtptPXPzeJaVFL5D","syncDetails":null}],"meta":{"page":1,"pages":2,"records":11}}'
292
+ recorded_at: Fri, 07 Jul 2023 14:45:42 GMT
293
+ - request:
294
+ method: post
295
+ uri: https://api.trolley.com/v1/invoices/create-lines
296
+ body:
297
+ encoding: UTF-8
298
+ string: '{"invoiceId":"I-Y3B3d1RexwPr8c5AACWzdc","lines":[{"unitAmount":{"value":"2000","currency":"USD"}}]}'
299
+ headers:
300
+ X-Pr-Timestamp:
301
+ - '1688741142'
302
+ Content-Type:
303
+ - application/json
304
+ Accept-Encoding:
305
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
306
+ Accept:
307
+ - "*/*"
308
+ User-Agent:
309
+ - Ruby
310
+ response:
311
+ status:
312
+ code: 200
313
+ message: OK
314
+ headers:
315
+ Date:
316
+ - Fri, 07 Jul 2023 14:45:43 GMT
317
+ Content-Type:
318
+ - application/json; charset=utf-8
319
+ Content-Length:
320
+ - '1127'
321
+ Connection:
322
+ - keep-alive
323
+ Cache-Control:
324
+ - no-store, no-cache
325
+ Content-Security-Policy:
326
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
327
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
328
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
329
+ X-Dns-Prefetch-Control:
330
+ - 'off'
331
+ Expect-Ct:
332
+ - max-age=0
333
+ Strict-Transport-Security:
334
+ - max-age=15552000; includeSubDomains
335
+ X-Download-Options:
336
+ - noopen
337
+ X-Content-Type-Options:
338
+ - nosniff
339
+ X-Permitted-Cross-Domain-Policies:
340
+ - none
341
+ Referrer-Policy:
342
+ - no-referrer
343
+ X-Xss-Protection:
344
+ - '0'
345
+ Access-Control-Allow-Origin:
346
+ - "*"
347
+ X-Rate-Limit-Limit:
348
+ - '600'
349
+ X-Rate-Limit-Remaining:
350
+ - '579'
351
+ X-Rate-Limit-Reset:
352
+ - '1688741188'
353
+ Vary:
354
+ - Origin
355
+ Etag:
356
+ - W/"467-QSYvZj5mB54tCrST0T6+cN0TAhE"
357
+ body:
358
+ encoding: UTF-8
359
+ string: '{"ok":true,"invoice":{"id":"I-Y3B3d1RexwPr8c5AACWzdc","invoiceNumber":"","description":"Integration
360
+ Test Invoice Create","status":"open","externalId":null,"invoiceDate":"2023-07-07T14:45:42.016Z","dueDate":null,"releaseAfter":null,"createdAt":"2023-07-07T14:45:42.015Z","updatedAt":"2023-07-07T14:45:43.789Z","totalAmount":{"value":"2000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"dueAmount":{"value":"2000.00","currency":"USD"},"tags":[],"lines":[{"id":"IL-GJD3MWDy8cREWJW366Dqo8","status":"open","itemUrl":null,"description":"","unitAmount":{"value":"2000.00","currency":"USD"},"quantity":"1","discountAmount":{"value":"0.00","currency":"USD"},"taxAmount":{"value":"0.00","currency":"USD"},"totalAmount":{"value":"2000.00","currency":"USD"},"dueAmount":{"value":"2000.00","currency":"USD"},"paidAmount":{"value":"0.00","currency":"USD"},"pendingAmount":{"value":"0.00","currency":"USD"},"externalId":null,"taxReportable":true,"tags":[],"category":"services","forceUsTaxActivity":false}],"recipientId":"R-Ae6THsUfXUafQVoMugH9vJ","syncDetails":null}}'
361
+ recorded_at: Fri, 07 Jul 2023 14:45:43 GMT
362
+ - request:
363
+ method: post
364
+ uri: https://api.trolley.com/v1/invoices/payment/create
365
+ body:
366
+ encoding: UTF-8
367
+ string: '{"ids":[{"invoiceId":"I-Y3B3d1RexwPr8c5AACWzdc"}]}'
368
+ headers:
369
+ X-Pr-Timestamp:
370
+ - '1688741143'
371
+ Content-Type:
372
+ - application/json
373
+ Accept-Encoding:
374
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
375
+ Accept:
376
+ - "*/*"
377
+ User-Agent:
378
+ - Ruby
379
+ response:
380
+ status:
381
+ code: 200
382
+ message: OK
383
+ headers:
384
+ Date:
385
+ - Fri, 07 Jul 2023 14:45:44 GMT
386
+ Content-Type:
387
+ - application/json; charset=utf-8
388
+ Content-Length:
389
+ - '315'
390
+ Connection:
391
+ - keep-alive
392
+ Cache-Control:
393
+ - no-store, no-cache
394
+ Content-Security-Policy:
395
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
396
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
397
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
398
+ X-Dns-Prefetch-Control:
399
+ - 'off'
400
+ Expect-Ct:
401
+ - max-age=0
402
+ Strict-Transport-Security:
403
+ - max-age=15552000; includeSubDomains
404
+ X-Download-Options:
405
+ - noopen
406
+ X-Content-Type-Options:
407
+ - nosniff
408
+ X-Permitted-Cross-Domain-Policies:
409
+ - none
410
+ Referrer-Policy:
411
+ - no-referrer
412
+ X-Xss-Protection:
413
+ - '0'
414
+ Access-Control-Allow-Origin:
415
+ - "*"
416
+ X-Rate-Limit-Limit:
417
+ - '600'
418
+ X-Rate-Limit-Remaining:
419
+ - '578'
420
+ X-Rate-Limit-Reset:
421
+ - '1688741188'
422
+ Vary:
423
+ - Origin
424
+ Etag:
425
+ - W/"13b-oTvrVfCr45PAfcYHipixzSaqlpw"
426
+ body:
427
+ encoding: UTF-8
428
+ string: '{"ok":true,"invoicePayment":{"batchId":"B-YEB6tiEvqRBPuuYEvh1Jef","paymentId":"P-CmBTYcBm58Gqjvzojs1HBn","invoicePayments":[{"invoiceId":"I-Y3B3d1RexwPr8c5AACWzdc","invoiceLineId":"IL-GJD3MWDy8cREWJW366Dqo8","paymentId":"P-CmBTYcBm58Gqjvzojs1HBn","amount":{"value":"2000.00","currency":"USD"},"status":"pending"}]}}'
429
+ recorded_at: Fri, 07 Jul 2023 14:45:44 GMT
430
+ - request:
431
+ method: post
432
+ uri: https://api.trolley.com/v1/invoices/payment/search
433
+ body:
434
+ encoding: UTF-8
435
+ string: '{"invoiceIds":["I-Y3B3d1RexwPr8c5AACWzdc"]}'
436
+ headers:
437
+ X-Pr-Timestamp:
438
+ - '1688741144'
439
+ Content-Type:
440
+ - application/json
441
+ Accept-Encoding:
442
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
443
+ Accept:
444
+ - "*/*"
445
+ User-Agent:
446
+ - Ruby
447
+ response:
448
+ status:
449
+ code: 200
450
+ message: OK
451
+ headers:
452
+ Date:
453
+ - Fri, 07 Jul 2023 14:45:45 GMT
454
+ Content-Type:
455
+ - application/json; charset=utf-8
456
+ Content-Length:
457
+ - '260'
458
+ Connection:
459
+ - keep-alive
460
+ Cache-Control:
461
+ - no-store, no-cache
462
+ Content-Security-Policy:
463
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
464
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
465
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
466
+ X-Dns-Prefetch-Control:
467
+ - 'off'
468
+ Expect-Ct:
469
+ - max-age=0
470
+ Strict-Transport-Security:
471
+ - max-age=15552000; includeSubDomains
472
+ X-Download-Options:
473
+ - noopen
474
+ X-Content-Type-Options:
475
+ - nosniff
476
+ X-Permitted-Cross-Domain-Policies:
477
+ - none
478
+ Referrer-Policy:
479
+ - no-referrer
480
+ X-Xss-Protection:
481
+ - '0'
482
+ Access-Control-Allow-Origin:
483
+ - "*"
484
+ X-Rate-Limit-Limit:
485
+ - '600'
486
+ X-Rate-Limit-Remaining:
487
+ - '577'
488
+ X-Rate-Limit-Reset:
489
+ - '1688741188'
490
+ Vary:
491
+ - Origin
492
+ Etag:
493
+ - W/"104-zQYo1MgXcQT1+VcUEQpDqrzOtmw"
494
+ body:
495
+ encoding: UTF-8
496
+ string: '{"ok":true,"invoicePayments":[{"invoiceId":"I-Y3B3d1RexwPr8c5AACWzdc","invoiceLineId":"IL-GJD3MWDy8cREWJW366Dqo8","paymentId":"P-CmBTYcBm58Gqjvzojs1HBn","amount":{"value":"2000.00","currency":"USD"},"status":"pending"}],"meta":{"page":1,"pages":1,"records":1}}'
497
+ recorded_at: Fri, 07 Jul 2023 14:45:45 GMT
498
+ - request:
499
+ method: post
500
+ uri: https://api.trolley.com/v1/invoices/payment/update
501
+ body:
502
+ encoding: UTF-8
503
+ string: '{"paymentId":"P-CmBTYcBm58Gqjvzojs1HBn","invoiceLineId":"IL-GJD3MWDy8cREWJW366Dqo8","amount":{"value":"5000","currency":"USD"}}'
504
+ headers:
505
+ X-Pr-Timestamp:
506
+ - '1688741145'
507
+ Content-Type:
508
+ - application/json
509
+ Accept-Encoding:
510
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
511
+ Accept:
512
+ - "*/*"
513
+ User-Agent:
514
+ - Ruby
515
+ response:
516
+ status:
517
+ code: 200
518
+ message: OK
519
+ headers:
520
+ Date:
521
+ - Fri, 07 Jul 2023 14:45:45 GMT
522
+ Content-Type:
523
+ - application/json; charset=utf-8
524
+ Content-Length:
525
+ - '11'
526
+ Connection:
527
+ - keep-alive
528
+ Cache-Control:
529
+ - no-store, no-cache
530
+ Content-Security-Policy:
531
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
532
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
533
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
534
+ X-Dns-Prefetch-Control:
535
+ - 'off'
536
+ Expect-Ct:
537
+ - max-age=0
538
+ Strict-Transport-Security:
539
+ - max-age=15552000; includeSubDomains
540
+ X-Download-Options:
541
+ - noopen
542
+ X-Content-Type-Options:
543
+ - nosniff
544
+ X-Permitted-Cross-Domain-Policies:
545
+ - none
546
+ Referrer-Policy:
547
+ - no-referrer
548
+ X-Xss-Protection:
549
+ - '0'
550
+ Access-Control-Allow-Origin:
551
+ - "*"
552
+ X-Rate-Limit-Limit:
553
+ - '600'
554
+ X-Rate-Limit-Remaining:
555
+ - '576'
556
+ X-Rate-Limit-Reset:
557
+ - '1688741188'
558
+ Vary:
559
+ - Origin
560
+ Etag:
561
+ - W/"b-Ai2R8hgEarLmHKwesT1qcY913ys"
562
+ body:
563
+ encoding: UTF-8
564
+ string: '{"ok":true}'
565
+ recorded_at: Fri, 07 Jul 2023 14:45:45 GMT
566
+ - request:
567
+ method: post
568
+ uri: https://api.trolley.com/v1/invoices/payment/search
569
+ body:
570
+ encoding: UTF-8
571
+ string: '{"invoiceIds":["I-Y3B3d1RexwPr8c5AACWzdc"]}'
572
+ headers:
573
+ X-Pr-Timestamp:
574
+ - '1688741145'
575
+ Content-Type:
576
+ - application/json
577
+ Accept-Encoding:
578
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
579
+ Accept:
580
+ - "*/*"
581
+ User-Agent:
582
+ - Ruby
583
+ response:
584
+ status:
585
+ code: 200
586
+ message: OK
587
+ headers:
588
+ Date:
589
+ - Fri, 07 Jul 2023 14:45:46 GMT
590
+ Content-Type:
591
+ - application/json; charset=utf-8
592
+ Content-Length:
593
+ - '260'
594
+ Connection:
595
+ - keep-alive
596
+ Cache-Control:
597
+ - no-store, no-cache
598
+ Content-Security-Policy:
599
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
600
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
601
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
602
+ X-Dns-Prefetch-Control:
603
+ - 'off'
604
+ Expect-Ct:
605
+ - max-age=0
606
+ Strict-Transport-Security:
607
+ - max-age=15552000; includeSubDomains
608
+ X-Download-Options:
609
+ - noopen
610
+ X-Content-Type-Options:
611
+ - nosniff
612
+ X-Permitted-Cross-Domain-Policies:
613
+ - none
614
+ Referrer-Policy:
615
+ - no-referrer
616
+ X-Xss-Protection:
617
+ - '0'
618
+ Access-Control-Allow-Origin:
619
+ - "*"
620
+ X-Rate-Limit-Limit:
621
+ - '600'
622
+ X-Rate-Limit-Remaining:
623
+ - '575'
624
+ X-Rate-Limit-Reset:
625
+ - '1688741188'
626
+ Vary:
627
+ - Origin
628
+ Etag:
629
+ - W/"104-moKu2/RlugQNTNqiJuZnp5SKnZU"
630
+ body:
631
+ encoding: UTF-8
632
+ string: '{"ok":true,"invoicePayments":[{"invoiceId":"I-Y3B3d1RexwPr8c5AACWzdc","invoiceLineId":"IL-GJD3MWDy8cREWJW366Dqo8","paymentId":"P-CmBTYcBm58Gqjvzojs1HBn","amount":{"value":"5000.00","currency":"USD"},"status":"pending"}],"meta":{"page":1,"pages":1,"records":1}}'
633
+ recorded_at: Fri, 07 Jul 2023 14:45:46 GMT
634
+ recorded_with: VCR 6.2.0