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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 262a1acbb09a0cd81c2c73058df52605cfb43e949a742dd5afb40bdcfc5b6b5b
4
- data.tar.gz: f900a5a7b7bfbdda5591d160e1a7dfdabd8c60c05de618047039b145af7f5b61
3
+ metadata.gz: df105ab4c5c1cc571f2b6ea9d08a2791faf46de8693010d09a22179afc37d93f
4
+ data.tar.gz: 1239e93a4b6c00576a31fc3edaf806161a3525bbcc9e1e0990f0ecdeaa92af85
5
5
  SHA512:
6
- metadata.gz: c9dea4abf4ad7ed4c11c936646b42991c70094000185a000a4725354ae374694c8ec599d51e607853cf6bf2075269545dcf573caff5b6c62c5ea5117b78f70c0
7
- data.tar.gz: dcb1e1788bc0435aebacf59518d6184048f6f6fc64d9e734d56176c958e5d1ed9a8b98ec47dbbb4a8ffadc1d721783f2aaa970518c3facec821504108fc22751
6
+ metadata.gz: c2e3abe34877a650a0544c6c05b163862ee8c0438623fc060a9d324df1a3b5025db934f754487c0f35f7518a0c3a64aa6131f1cf930237e99cad9730d2fc2713
7
+ data.tar.gz: b0200cbead27dce01ee53c56c638d60a9e49889a2292724e8463e91e9964d53efff8647f7025ce8dea45b6fcb1f9e6c9ba97a0b9e6e029cb8cd3173bc35cde28
@@ -31,6 +31,11 @@ module Trolley
31
31
  send_request(endPoint, 'PATCH', body)
32
32
  end
33
33
 
34
+ def request(method, endPoint, body = nil)
35
+ payload = body.nil? || body.is_a?(String) ? body.to_s : body.to_json
36
+ send_request(endPoint, method.to_s.upcase, payload)
37
+ end
38
+
34
39
  private
35
40
 
36
41
  # rubocop:disable Metrics/CyclomaticComplexity
@@ -64,7 +69,7 @@ module Trolley
64
69
 
65
70
  response = http.request(request)
66
71
 
67
- if response.code != '200' && response.code != '204'
72
+ unless response.code.to_i.between?(200, 299)
68
73
  throw_status_code_exception("#{response.message} #{response.body}" , response.code, response.body)
69
74
  end
70
75
  response.body
@@ -1,6 +1,6 @@
1
1
  module Trolley
2
2
  class Gateway
3
- attr_accessor :config, :client, :recipient, :recipient_account, :batch, :payment, :balance, :offline_payment, :invoice, :invoice_payment
3
+ attr_accessor :config, :client, :recipient, :recipient_account, :batch, :payment, :balance, :offline_payment, :invoice, :invoice_payment, :verification, :trust
4
4
 
5
5
  def initialize(config)
6
6
  @config = config
@@ -13,6 +13,12 @@ module Trolley
13
13
  @offline_payment = OfflinePaymentGateway.new(client)
14
14
  @invoice = InvoiceGateway.new(client)
15
15
  @invoice_payment = InvoicePaymentGateway.new(client)
16
+ @verification = VerificationGateway.new(client)
17
+ @trust = @verification
18
+ end
19
+
20
+ def request(method, end_point, body = nil)
21
+ @client.request(method, end_point, body)
16
22
  end
17
23
  end
18
24
  end
@@ -7,7 +7,12 @@ module Trolley
7
7
  :invoiceId,
8
8
  :invoiceLineId,
9
9
  :amount,
10
- :invoicePayments
10
+ :invoicePayments,
11
+ :status,
12
+ :memo,
13
+ :externalId,
14
+ :tags,
15
+ :coverFees
11
16
  )
12
17
  end
13
18
  end
@@ -17,7 +17,8 @@ module Trolley
17
17
  :equivalentWithholdingCurrency,
18
18
  :updatedAt,
19
19
  :createdAt,
20
- :deletedAt
20
+ :deletedAt,
21
+ :activityCount
21
22
  )
22
23
  end
23
24
  end
@@ -7,8 +7,10 @@ module Trolley
7
7
  :returnedAmount,
8
8
  :sourceAmount,
9
9
  :sourceCurrency,
10
+ :sourceCurrencyName,
10
11
  :targetAmount,
11
12
  :targetCurrency,
13
+ :targetCurrencyName,
12
14
  :exchangeRate,
13
15
  :fees,
14
16
  :recipientFees,
@@ -46,7 +48,8 @@ module Trolley
46
48
  :failureMessage,
47
49
  :merchantId,
48
50
  :checkNumber,
49
- :forceUsTaxActivity
51
+ :forceUsTaxActivity,
52
+ :visibleToRecipient
50
53
  )
51
54
  end
52
55
  end
@@ -22,7 +22,6 @@ module Trolley
22
22
  :createdAt,
23
23
  :gravatarUrl,
24
24
  :governmentId,
25
- :ssn,
26
25
  :primaryCurrency,
27
26
  :merchantId,
28
27
  :payout,
@@ -34,7 +33,6 @@ module Trolley
34
33
  :taxFormStatus,
35
34
  :inactiveReasons,
36
35
  :payoutMethod,
37
- :placeOfBirth,
38
36
  :tags,
39
37
  :taxDeliveryType,
40
38
  :riskScore,
@@ -24,7 +24,10 @@ module Trolley
24
24
  :bankRegionCode,
25
25
  :bankPostalCode,
26
26
  :status,
27
- :disabledAt
27
+ :disabledAt,
28
+ :cardDetails,
29
+ :mailing,
30
+ :phoneNumber
28
31
  )
29
32
  end
30
33
  end
@@ -0,0 +1,12 @@
1
+ module Trolley
2
+ class RecipientLog
3
+ attr_accessor(
4
+ :via,
5
+ :ipAddress,
6
+ :userId,
7
+ :type,
8
+ :fields,
9
+ :createdAt
10
+ )
11
+ end
12
+ end
@@ -1,4 +1,5 @@
1
1
  require_relative '../Client'
2
+ require 'ostruct'
2
3
 
3
4
  module Trolley
4
5
  class BalanceGateway
@@ -7,9 +8,25 @@ module Trolley
7
8
  end
8
9
 
9
10
  def find(term = '')
10
- response = @client.get("/v1/balances/#{term}" )
11
+ path = term.to_s.empty? ? '/v1/balances/' : "/v1/balances/#{term}"
12
+ response = @client.get(path)
11
13
  JSON.parse(response, object_class: OpenStruct)
12
14
  end
13
15
 
16
+ def all
17
+ balance_builder(@client.get('/v1/balances'))
18
+ end
19
+
20
+ def paymentrails
21
+ balance_builder(@client.get('/v1/balances/paymentrails'))
22
+ end
23
+
24
+ def paypal
25
+ balance_builder(@client.get('/v1/balances/paypal'))
26
+ end
27
+
28
+ def balance_builder(response)
29
+ JSON.parse(response, object_class: OpenStruct)
30
+ end
14
31
  end
15
32
  end
@@ -11,6 +11,11 @@ module Trolley
11
11
  payment_builder(response)
12
12
  end
13
13
 
14
+ def find_by_id(payment_id)
15
+ response = @client.get("/v1/payments/#{payment_id}")
16
+ payment_builder(response)
17
+ end
18
+
14
19
  def create(batch_id, body)
15
20
  response = @client.post("/v1/batches/#{batch_id}/payments", body)
16
21
  payment_builder(response)
@@ -41,7 +41,7 @@ module Trolley
41
41
  # @note This method retrieves a list of activity logs for a recipient
42
42
  def find_logs(recipient_id)
43
43
  response = @client.get("/v1/recipients/#{recipient_id}/logs")
44
- JSON.parse(response, object_class: OpenStruct)
44
+ logs_list_builder(response)
45
45
  end
46
46
 
47
47
  def find_payments(recipient_id, page = 1, page_size = 10)
@@ -78,5 +78,9 @@ module Trolley
78
78
  def payments_list_builder(response)
79
79
  Utils::PaginatedArray.from_response(response, Payment)
80
80
  end
81
+
82
+ def logs_list_builder(response)
83
+ Utils::PaginatedArray.from_response(response, RecipientLog)
84
+ end
81
85
  end
82
86
  end
@@ -0,0 +1,40 @@
1
+ require_relative '../Client'
2
+ require 'json'
3
+ require 'ostruct'
4
+ require 'uri'
5
+
6
+ module Trolley
7
+ class VerificationGateway
8
+ def initialize(client)
9
+ @client = client
10
+ end
11
+
12
+ def search(filters = {})
13
+ path = '/v1/verifications'
14
+ query_string = URI.encode_www_form(filters)
15
+ path = "#{path}?#{query_string}" unless query_string.empty?
16
+
17
+ verification_list_builder(@client.get(path))
18
+ end
19
+
20
+ alias all search
21
+
22
+ def expire(body)
23
+ verification_list_builder(@client.patch('/v1/verifications/expire', body))
24
+ end
25
+
26
+ def trigger(verification_type, body)
27
+ verification_list_builder(@client.post("/v1/verifications/#{verification_type}/trigger", body))
28
+ end
29
+
30
+ def trigger_watchlist(body)
31
+ verification_list_builder(@client.post('/v1/verifications/watchlist/trigger', body))
32
+ end
33
+
34
+ private
35
+
36
+ def verification_list_builder(response)
37
+ JSON.parse(response, object_class: OpenStruct)
38
+ end
39
+ end
40
+ end
@@ -1,7 +1,7 @@
1
1
  module Trolley
2
2
  module Utils
3
3
  class PaginatedArray < Array
4
- attr_accessor :page, :pages, :records
4
+ attr_accessor :page, :pages, :records, :ok
5
5
 
6
6
  def self.from_response(response, klass)
7
7
  data = JSON.parse(response)
@@ -10,15 +10,20 @@ module Trolley
10
10
  page = data.dig('meta', 'page')
11
11
  pages = data.dig('meta', 'pages')
12
12
  records = data.dig('meta', 'records')
13
+ collection_key = data.keys.find { |key| data[key].is_a?(Array) }
13
14
 
14
- new(enum, page, pages, records)
15
+ new(enum, page, pages, records, ok: data['ok'], collection_key:)
15
16
  end
16
17
 
17
- def initialize(enum, page, pages, records)
18
+ def initialize(enum, page, pages, records, metadata = {})
18
19
  super(enum)
19
20
  @page = page
20
21
  @pages = pages
21
22
  @records = records
23
+ @ok = metadata[:ok]
24
+
25
+ collection_key = metadata[:collection_key]
26
+ define_singleton_method(collection_key) { self } unless collection_key.nil?
22
27
  end
23
28
  end
24
29
  end
@@ -10,6 +10,7 @@ module Trolley
10
10
  'Trolley::OfflinePayment' => { resource: 'offlinePayment', collection: 'offlinePayments' },
11
11
  'Trolley::Payment' => { resource: 'payment', collection: 'payments' },
12
12
  'Trolley::RecipientAccount' => { resource: 'account', collection: 'accounts' },
13
+ 'Trolley::RecipientLog' => { resource: 'recipientLog', collection: 'recipientLogs' },
13
14
  'Trolley::Recipient' => { resource: 'recipient', collection: 'recipients' },
14
15
  'Trolley::BatchSummary' => { resource: 'batchSummary' }
15
16
  }.freeze
@@ -54,7 +55,7 @@ module Trolley
54
55
  instance.send("#{k}=", v)
55
56
  rescue NoMethodError
56
57
  # TODO: The API is showing non-public attributes, once we remove them from the API response we can re-add this warning.
57
- # warn "[PaymentRails] Unknown attribute #{k} for class #{klass_instance.class.name}"
58
+ # warn "[Trolley] Unknown attribute #{k} for class #{klass_instance.class.name}"
58
59
  end
59
60
 
60
61
  instance
data/lib/trolley.rb CHANGED
@@ -9,6 +9,7 @@ require 'trolley/gateways/RecipientAccountGateway'
9
9
  require 'trolley/gateways/OfflinePaymentGateway'
10
10
  require 'trolley/gateways/InvoiceGateway'
11
11
  require 'trolley/gateways/InvoicePaymentGateway'
12
+ require 'trolley/gateways/VerificationGateway'
12
13
 
13
14
  require 'trolley/utils/PaginatedArray'
14
15
  require 'trolley/utils/ResponseMapper'
@@ -19,13 +20,14 @@ require 'trolley/BatchSummary'
19
20
  require 'trolley/Exceptions'
20
21
  require 'trolley/Payment'
21
22
  require 'trolley/Recipient'
23
+ require 'trolley/RecipientLog'
22
24
  require 'trolley/RecipientAccount'
23
25
  require 'trolley/OfflinePayment'
24
26
  require 'trolley/Invoice'
25
27
  require 'trolley/InvoicePayment'
26
28
 
27
29
  module Trolley
28
- VERSION = '1.0.2'.freeze
30
+ VERSION = '1.1.0'.freeze
29
31
 
30
32
  def self.client(key, secret, **optionals)
31
33
  Gateway.new(Configuration.new(key, secret, **optionals))
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.trolley.com/v1/balances/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Pr-Timestamp:
11
+ - '1691540983'
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 09 Aug 2023 00:29:43 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '1274'
31
+ Connection:
32
+ - keep-alive
33
+ Cache-Control:
34
+ - no-store, no-cache
35
+ Content-Security-Policy:
36
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
37
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
38
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
39
+ X-Dns-Prefetch-Control:
40
+ - 'off'
41
+ Expect-Ct:
42
+ - max-age=0
43
+ Strict-Transport-Security:
44
+ - max-age=15552000; includeSubDomains
45
+ X-Download-Options:
46
+ - noopen
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Permitted-Cross-Domain-Policies:
50
+ - none
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Xss-Protection:
54
+ - '0'
55
+ Access-Control-Allow-Origin:
56
+ - "*"
57
+ X-Rate-Limit-Limit:
58
+ - '600'
59
+ X-Rate-Limit-Remaining:
60
+ - '572'
61
+ X-Rate-Limit-Reset:
62
+ - '1691541008'
63
+ Vary:
64
+ - Origin
65
+ Etag:
66
+ - W/"4fa-cIh4HHPQy3USghbJIC8KtJ3/Hns"
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"ok":true,"balances":[{"primary":false,"type":"paymentrails","accountNumber":"BL-39b3ddb685af30da0d33fd813250dd26","display":true,"amount":"761316.01","currency":"GBP","pendingCredit":"0.00","pendingDebit":"0.00","amountPending":"761316.01","amountCleared":"761316.01","provider":"sandbox","providerId":null,"providerAcct":"0000846"},{"primary":false,"type":"paymentrails","accountNumber":"BL-e4b7202c4da3ff46551f52cf44a9421e","display":true,"amount":"135644.55","currency":"EUR","pendingCredit":"0.00","pendingDebit":"0.00","amountPending":"135644.55","amountCleared":"135644.55","provider":"sandbox","providerId":null,"providerAcct":"0000847"},{"primary":false,"type":"paymentrails","accountNumber":"BL-db7d007f42b5704e7f4ab0cff8abe6a3","display":true,"amount":"1396485.40","currency":"USD","pendingCredit":"0.00","pendingDebit":"0.00","amountPending":"1396485.40","amountCleared":"1396485.40","provider":"sandbox","providerId":null,"providerAcct":"0000848"},{"primary":true,"type":"paymentrails","accountNumber":"BL-e936ff546939eed3219cb2fbf757bf3d","display":true,"amount":"883454.00","currency":"CAD","pendingCredit":"0.00","pendingDebit":"0.00","amountPending":"883454.00","amountCleared":"883454.00","provider":"sandbox","providerId":null,"providerAcct":"0000867"}]}'
70
+ recorded_at: Wed, 09 Aug 2023 00:29:44 GMT
71
+ recorded_with: VCR 6.2.0
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.trolley.com/v1/balances/paymentrails
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Pr-Timestamp:
11
+ - '1691540984'
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 09 Aug 2023 00:29:44 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '1274'
31
+ Connection:
32
+ - keep-alive
33
+ Cache-Control:
34
+ - no-store, no-cache
35
+ Content-Security-Policy:
36
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
37
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
38
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
39
+ X-Dns-Prefetch-Control:
40
+ - 'off'
41
+ Expect-Ct:
42
+ - max-age=0
43
+ Strict-Transport-Security:
44
+ - max-age=15552000; includeSubDomains
45
+ X-Download-Options:
46
+ - noopen
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Permitted-Cross-Domain-Policies:
50
+ - none
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Xss-Protection:
54
+ - '0'
55
+ Access-Control-Allow-Origin:
56
+ - "*"
57
+ X-Rate-Limit-Limit:
58
+ - '600'
59
+ X-Rate-Limit-Remaining:
60
+ - '571'
61
+ X-Rate-Limit-Reset:
62
+ - '1691541008'
63
+ Vary:
64
+ - Origin
65
+ Etag:
66
+ - W/"4fa-cIh4HHPQy3USghbJIC8KtJ3/Hns"
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"ok":true,"balances":[{"primary":false,"type":"paymentrails","accountNumber":"BL-39b3ddb685af30da0d33fd813250dd26","display":true,"amount":"761316.01","currency":"GBP","pendingCredit":"0.00","pendingDebit":"0.00","amountPending":"761316.01","amountCleared":"761316.01","provider":"sandbox","providerId":null,"providerAcct":"0000846"},{"primary":false,"type":"paymentrails","accountNumber":"BL-e4b7202c4da3ff46551f52cf44a9421e","display":true,"amount":"135644.55","currency":"EUR","pendingCredit":"0.00","pendingDebit":"0.00","amountPending":"135644.55","amountCleared":"135644.55","provider":"sandbox","providerId":null,"providerAcct":"0000847"},{"primary":false,"type":"paymentrails","accountNumber":"BL-db7d007f42b5704e7f4ab0cff8abe6a3","display":true,"amount":"1396485.40","currency":"USD","pendingCredit":"0.00","pendingDebit":"0.00","amountPending":"1396485.40","amountCleared":"1396485.40","provider":"sandbox","providerId":null,"providerAcct":"0000848"},{"primary":true,"type":"paymentrails","accountNumber":"BL-e936ff546939eed3219cb2fbf757bf3d","display":true,"amount":"883454.00","currency":"CAD","pendingCredit":"0.00","pendingDebit":"0.00","amountPending":"883454.00","amountCleared":"883454.00","provider":"sandbox","providerId":null,"providerAcct":"0000867"}]}'
70
+ recorded_at: Wed, 09 Aug 2023 00:29:44 GMT
71
+ recorded_with: VCR 6.2.0
@@ -0,0 +1,150 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.trolley.com/v1/batches/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"sourceCurrency":"USD","description":"Integration Test Create"}'
9
+ headers:
10
+ X-Pr-Timestamp:
11
+ - '1688740986'
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Fri, 07 Jul 2023 14:43:06 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '370'
31
+ Connection:
32
+ - keep-alive
33
+ Cache-Control:
34
+ - no-store, no-cache
35
+ Content-Security-Policy:
36
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
37
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
38
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
39
+ X-Dns-Prefetch-Control:
40
+ - 'off'
41
+ Expect-Ct:
42
+ - max-age=0
43
+ Strict-Transport-Security:
44
+ - max-age=15552000; includeSubDomains
45
+ X-Download-Options:
46
+ - noopen
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Permitted-Cross-Domain-Policies:
50
+ - none
51
+ Referrer-Policy:
52
+ - no-referrer
53
+ X-Xss-Protection:
54
+ - '0'
55
+ Access-Control-Allow-Origin:
56
+ - "*"
57
+ X-Rate-Limit-Limit:
58
+ - '600'
59
+ X-Rate-Limit-Remaining:
60
+ - '599'
61
+ X-Rate-Limit-Reset:
62
+ - '1688741046'
63
+ Vary:
64
+ - Origin
65
+ Etag:
66
+ - W/"172-3QfoSWEC1AuA1OVQ2HOugSgyRYw"
67
+ body:
68
+ encoding: UTF-8
69
+ string: '{"ok":true,"batch":{"id":"B-3hA3kNRJSiGjFGTqbdou17","status":"open","tags":[],"amount":"0.00","currency":"USD","totalPayments":0,"description":"Integration
70
+ Test Create","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:43:06.649Z","updatedAt":"2023-07-07T14:43:06.649Z","quoteExpiredAt":null,"payments":{"payments":[],"meta":{"page":1,"pages":0,"records":0}}}}'
71
+ recorded_at: Fri, 07 Jul 2023 14:43:06 GMT
72
+ - request:
73
+ method: get
74
+ uri: https://api.trolley.com/v1/batches/
75
+ body:
76
+ encoding: US-ASCII
77
+ string: ''
78
+ headers:
79
+ X-Pr-Timestamp:
80
+ - '1688740986'
81
+ Content-Type:
82
+ - application/json
83
+ Accept-Encoding:
84
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
85
+ Accept:
86
+ - "*/*"
87
+ User-Agent:
88
+ - Ruby
89
+ response:
90
+ status:
91
+ code: 200
92
+ message: OK
93
+ headers:
94
+ Date:
95
+ - Fri, 07 Jul 2023 14:43:07 GMT
96
+ Content-Type:
97
+ - application/json; charset=utf-8
98
+ Content-Length:
99
+ - '3026'
100
+ Connection:
101
+ - keep-alive
102
+ Cache-Control:
103
+ - no-store, no-cache
104
+ Content-Security-Policy:
105
+ - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
106
+ https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
107
+ ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
108
+ X-Dns-Prefetch-Control:
109
+ - 'off'
110
+ Expect-Ct:
111
+ - max-age=0
112
+ Strict-Transport-Security:
113
+ - max-age=15552000; includeSubDomains
114
+ X-Download-Options:
115
+ - noopen
116
+ X-Content-Type-Options:
117
+ - nosniff
118
+ X-Permitted-Cross-Domain-Policies:
119
+ - none
120
+ Referrer-Policy:
121
+ - no-referrer
122
+ X-Xss-Protection:
123
+ - '0'
124
+ Access-Control-Allow-Origin:
125
+ - "*"
126
+ X-Rate-Limit-Limit:
127
+ - '600'
128
+ X-Rate-Limit-Remaining:
129
+ - '598'
130
+ X-Rate-Limit-Reset:
131
+ - '1688741046'
132
+ Vary:
133
+ - Origin
134
+ Etag:
135
+ - W/"bd2-Es/D6IUROb9CDGyfTIgyWUFPTLI"
136
+ body:
137
+ encoding: UTF-8
138
+ string: '{"ok":true,"batches":[{"id":"B-3hA3kNRJSiGjFGTqbdou17","status":"open","tags":[],"amount":"0.00","currency":"USD","totalPayments":0,"description":"Integration
139
+ Test Create","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:43:06.649Z","updatedAt":"2023-07-07T14:43:06.649Z","quoteExpiredAt":null},{"id":"B-BqvhcfA7i9u8UkZoyoNMU1","status":"open","tags":[],"amount":"6686.85","currency":"CAD","totalPayments":1,"description":"Payouts
140
+ on 7 Jul 2023 #371","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:17:29.495Z","updatedAt":"2023-07-07T14:17:30.950Z","quoteExpiredAt":null},{"id":"B-8AkMne6o6WQmarnZWTLgqW","status":"open","tags":[],"amount":"0.00","currency":"CAD","totalPayments":0,"description":"Payouts
141
+ on 7 Jul 2023 #370","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:17:24.476Z","updatedAt":"2023-07-07T14:17:25.881Z","quoteExpiredAt":null},{"id":"B-FrChBr4R8h1UWiHsVgb4nF","status":"open","tags":[],"amount":"2675.94","currency":"CAD","totalPayments":1,"description":"Payouts
142
+ on 7 Jul 2023 #369","sentAt":null,"completedAt":null,"createdAt":"2023-07-07T14:17:19.870Z","updatedAt":"2023-07-07T14:17:20.226Z","quoteExpiredAt":null},{"id":"B-A599DE7QzjYdZWQftGqUfg","status":"awaiting_approval","tags":[],"amount":"27.13","currency":"USD","totalPayments":2,"description":"Integration
143
+ Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-06T05:35:37.870Z","updatedAt":"2023-07-06T05:35:39.746Z","quoteExpiredAt":"2023-07-06T07:35:38.107Z"},{"id":"B-KEKg7rPZDKHzVke59Nhmq3","status":"open","tags":[],"amount":"0.00","currency":"USD","totalPayments":0,"description":"Integration
144
+ Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-06T05:35:33.381Z","updatedAt":"2023-07-06T05:35:35.981Z","quoteExpiredAt":null},{"id":"B-7RnQ8UTHKvrQxhSG1TZBC4","status":"open","tags":[],"amount":"27.13","currency":"USD","totalPayments":2,"description":"Integration
145
+ Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-06T05:35:30.738Z","updatedAt":"2023-07-06T05:35:31.049Z","quoteExpiredAt":"2023-07-06T07:35:30.945Z"},{"id":"B-JAz7DDwozCYd3nEyWVF9cV","status":"open","tags":[],"amount":"0.00","currency":"USD","totalPayments":0,"description":"Integration
146
+ Test Create","sentAt":null,"completedAt":null,"createdAt":"2023-07-06T05:35:28.601Z","updatedAt":"2023-07-06T05:35:28.601Z","quoteExpiredAt":null},{"id":"B-CjT3z9AdncbhXQVgzQ6Pga","status":"awaiting_approval","tags":[],"amount":"27.13","currency":"USD","totalPayments":2,"description":"Integration
147
+ Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-06T05:34:55.311Z","updatedAt":"2023-07-06T05:34:57.547Z","quoteExpiredAt":"2023-07-06T07:34:55.748Z"},{"id":"B-KTrtQgopCuD9iZZP74uXbc","status":"open","tags":[],"amount":"0.00","currency":"USD","totalPayments":0,"description":"Integration
148
+ Test Payments","sentAt":null,"completedAt":null,"createdAt":"2023-07-06T05:34:51.479Z","updatedAt":"2023-07-06T05:34:53.612Z","quoteExpiredAt":null}],"meta":{"page":1,"pages":26,"records":260}}'
149
+ recorded_at: Fri, 07 Jul 2023 14:43:07 GMT
150
+ recorded_with: VCR 6.2.0