payabli 2.2.22 → 2.2.25

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +6 -5
  3. data/.fernignore +1 -2
  4. data/.rubocop.yml +1 -1
  5. data/CONTRIBUTING.md +33 -0
  6. data/README.md +5 -5
  7. data/lib/payabli/client.rb +6 -1
  8. data/lib/payabli/cloud/client.rb +3 -0
  9. data/lib/payabli/internal/http/base_request.rb +14 -0
  10. data/lib/payabli/internal/http/raw_client.rb +21 -3
  11. data/lib/payabli/internal/json/request.rb +6 -4
  12. data/lib/payabli/internal/multipart/multipart_request.rb +6 -4
  13. data/lib/payabli/internal/types/boolean.rb +1 -1
  14. data/lib/payabli/internal/types/utils.rb +2 -2
  15. data/lib/payabli/management/client.rb +61 -0
  16. data/lib/payabli/management/types/bank_account_verification_details_response.rb +24 -0
  17. data/lib/payabli/management/types/verify_account_details_request.rb +17 -0
  18. data/lib/payabli/management/types/verify_account_details_response.rb +14 -0
  19. data/lib/payabli/money_in/client.rb +3 -1
  20. data/lib/payabli/money_in/types/transaction_detail_payment_data.rb +1 -1
  21. data/lib/payabli/money_out/client.rb +5 -3
  22. data/lib/payabli/money_out_types/types/authorize_payout_body.rb +1 -0
  23. data/lib/payabli/query/client.rb +100 -0
  24. data/lib/payabli/query/types/list_devices_org_request.rb +16 -0
  25. data/lib/payabli/query/types/list_devices_request.rb +16 -0
  26. data/lib/payabli/query_types/types/device_query_record.rb +34 -0
  27. data/lib/payabli/query_types/types/query_device_response.rb +13 -0
  28. data/lib/payabli/types/auto_capture.rb +23 -0
  29. data/lib/payabli/types/notification_content_event_type.rb +0 -1
  30. data/lib/payabli/types/notification_standard_request_content_event_type.rb +0 -1
  31. data/lib/payabli/types/processing_section.rb +5 -0
  32. data/lib/payabli/types/template_element.rb +1 -0
  33. data/lib/payabli/types/v_card_card_type.rb +23 -0
  34. data/lib/payabli/types/v_card_record.rb +1 -0
  35. data/lib/payabli/types/vendor_data.rb +2 -0
  36. data/lib/payabli/types/vendor_query_record.rb +7 -0
  37. data/lib/payabli/vendor/client.rb +39 -1
  38. data/lib/payabli/vendor/types/vendor_enrich_request.rb +18 -0
  39. data/lib/payabli/vendor/types/vendor_enrich_response.rb +17 -0
  40. data/lib/payabli/vendor/types/vendor_enrich_response_data.rb +16 -0
  41. data/lib/payabli/vendor/types/vendor_enrichment_data.rb +13 -0
  42. data/lib/payabli/vendor/types/vendor_enrichment_invoice_scan.rb +26 -0
  43. data/lib/payabli/vendor/types/vendor_enrichment_web_search.rb +26 -0
  44. data/lib/payabli/version.rb +1 -1
  45. data/lib/payabli.rb +16 -0
  46. data/reference.md +686 -75
  47. data/wiremock/wiremock-mappings.json +8569 -1
  48. metadata +25 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e05bcb36e71a98a3140b47a9a98956dd4fab002cd4f6b61a95bc6bb5c4aecf36
4
- data.tar.gz: e8ca856e9e15e5631c42aca5e5976c1d3e1b58a17fc2a09633a115f779dffc4b
3
+ metadata.gz: f528aa1e62272f5b170b018c20faae13e95f7c23b3f8e2fdac7d75b1eed954e2
4
+ data.tar.gz: 8d784bc73af21914511f69f54b6c5c2d672ef9b9664c051bc07f2f993f2e5ebb
5
5
  SHA512:
6
- metadata.gz: 9f4f7bdefed0e39418fb036d4f06919e172656362070e39a29ef3048d41c8b11b660e092b07b7b24522996c5132aa018a7f50c2b2751fbef8f3bec06fd66cd53
7
- data.tar.gz: cadf269b6814966eb3409d27df82aa63b3d3caad64ffe5fa5ecce64ae452fa8b971a7318ae761d2ae285dfbc692bf99635bec45c3318e1c98f6844464b0b7407
6
+ metadata.gz: 521caf9ebad7a41e95b560d29f381a767326aad352eaadfe3144f9da000f9d3bc8776305d451ce28bc48e562e217abfc94c3765c9d734eb28f29888f194e82a3
7
+ data.tar.gz: fd066b504829b92a04931496b717946d61a87894923f44f502f099cc360c97b7b8a4f1fea3caf2b5e5753dbf79b11f71df6b8c308587651b515fe272f73ba319
data/.fern/metadata.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
- "cliVersion": "4.60.0",
2
+ "cliVersion": "4.94.0",
3
3
  "generatorName": "fernapi/fern-ruby-sdk",
4
- "generatorVersion": "1.1.2",
4
+ "generatorVersion": "1.1.13",
5
5
  "generatorConfig": {
6
- "enableWireTests": true
6
+ "enableWireTests": true,
7
+ "rubocopVariableNumberStyle": "snake_case"
7
8
  },
8
- "originGitCommit": "6415b5451c2da0d2c1cef85dc4081265a866360c",
9
- "sdkVersion": "2.2.22"
9
+ "originGitCommit": "a59c2b2d6ccbf2e800fba96cc3ea9476df69b7b0",
10
+ "sdkVersion": "2.2.25"
10
11
  }
data/.fernignore CHANGED
@@ -1,4 +1,3 @@
1
1
  # Specify files that shouldn't be modified by Fern
2
- test/unit/custom_test.rb
3
- .github/workflows/ci.yml
4
2
  LICENSE.md
3
+ CONTRIBUTING.md
data/.rubocop.yml CHANGED
@@ -45,7 +45,7 @@ Layout/LineLength:
45
45
  Enabled: false
46
46
 
47
47
  Naming/VariableNumber:
48
- EnforcedStyle: normalcase
48
+ EnforcedStyle: snake_case
49
49
 
50
50
  Style/Documentation:
51
51
  Enabled: false
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,33 @@
1
+ # Contributing
2
+
3
+ Thank you for your interest in contributing to the Payabli SDKs!
4
+ We welcome contributions from the community and appreciate your help in improving our SDKs.
5
+
6
+ ## Feature requests
7
+
8
+ If you would like to request a new feature, please create a new GitHub issue on this repository.
9
+ See the [Issues](../../issues) page and click **New issue** to get started.
10
+
11
+ Please provide the following information in your feature request:
12
+ - A clear description of the feature
13
+ - The use case for the feature
14
+ - Code examples that demonstrate how the feature would be used (if applicable)
15
+
16
+ ## Bug reports
17
+
18
+ If you have found a bug in the SDK, please create a new GitHub issue on this repository.
19
+ See the [Issues](../../issues) page and click **New issue** to get started.
20
+
21
+ Please provide the following information in your bug report:
22
+ - A clear description of the bug
23
+ - Steps to reproduce the bug
24
+ - Expected behavior
25
+ - Actual behavior
26
+ - Code examples that demonstrate the bug (if applicable)
27
+
28
+ ## Pull requests
29
+
30
+ Pull requests are welcome; however, Payabli implements all code changes.
31
+ We'll review your pull request and close it.
32
+ If we have any questions about your pull request, we'll ask you in the comments of the pull request.
33
+
data/README.md CHANGED
@@ -73,7 +73,7 @@ require "payabli"
73
73
 
74
74
  client = Payabli::Client.new(api_key: "<value>")
75
75
 
76
- client.money_in.getpaid(
76
+ client.money_in.getpaidv_2(
77
77
  customer_data: {
78
78
  customer_id: 4440
79
79
  },
@@ -128,7 +128,7 @@ client = Payabli::Client.new(
128
128
  )
129
129
 
130
130
  begin
131
- result = client.money_in.getpaid
131
+ result = client.money_in.getpaidv_2
132
132
  rescue Payabli::Errors::TimeoutError
133
133
  puts "API didn't respond before our timeout elapsed"
134
134
  rescue Payabli::Errors::ServiceUnavailableError
@@ -173,7 +173,7 @@ The SDK defaults to a 60 second timeout. Use the `timeout` option to configure t
173
173
  ```ruby
174
174
  require "payabli"
175
175
 
176
- response = client.money_in.getpaid(
176
+ response = client.money_in.getpaidv_2(
177
177
  ...,
178
178
  timeout: 30 # 30 second timeout
179
179
  )
@@ -186,7 +186,7 @@ If you would like to send additional headers as part of the request, use the `ad
186
186
  ```ruby
187
187
  require "payabli"
188
188
 
189
- response = client.money_in.getpaid(
189
+ response = client.money_in.getpaidv_2(
190
190
  ...,
191
191
  request_options: {
192
192
  additional_headers: {
@@ -203,7 +203,7 @@ If you would like to send additional query parameters as part of the request, us
203
203
  ```ruby
204
204
  require "payabli"
205
205
 
206
- response = client.money_in.getpaid(
206
+ response = client.money_in.getpaidv_2(
207
207
  ...,
208
208
  request_options: {
209
209
  additional_query_parameters: {
@@ -10,7 +10,7 @@ module Payabli
10
10
  @raw_client = Payabli::Internal::Http::RawClient.new(
11
11
  base_url: base_url || Payabli::Environment::SANDBOX,
12
12
  headers: {
13
- "User-Agent" => "payabli/2.2.22",
13
+ "User-Agent" => "payabli/2.2.25",
14
14
  "X-Fern-Language" => "Ruby",
15
15
  requestToken: api_key.to_s
16
16
  }
@@ -77,6 +77,11 @@ module Payabli
77
77
  @line_item ||= Payabli::LineItem::Client.new(client: @raw_client)
78
78
  end
79
79
 
80
+ # @return [Payabli::Management::Client]
81
+ def management
82
+ @management ||= Payabli::Management::Client.new(client: @raw_client)
83
+ end
84
+
80
85
  # @return [Payabli::MoneyIn::Client]
81
86
  def money_in
82
87
  @money_in ||= Payabli::MoneyIn::Client.new(client: @raw_client)
@@ -90,6 +90,9 @@ module Payabli
90
90
  end
91
91
  end
92
92
 
93
+ # Use [List devices by paypoint](/developers/api-reference/cloud/get-list-of-devices-for-a-paypoint) instead,
94
+ # which supports filters, sorting, and pagination.
95
+ #
93
96
  # Get a list of cloud devices registered to an entrypoint.
94
97
  #
95
98
  # @param request_options [Hash]
@@ -31,6 +31,20 @@ module Payabli
31
31
  # Child classes should implement:
32
32
  # - encode_headers: Returns the encoded HTTP request headers.
33
33
  # - encode_body: Returns the encoded HTTP request body.
34
+
35
+ private
36
+
37
+ # Merges additional_headers from request_options into sdk_headers, filtering out
38
+ # any keys that collide with SDK-set or client-protected headers (case-insensitive).
39
+ # @param sdk_headers [Hash] Headers set by the SDK for this request type.
40
+ # @param protected_keys [Array<String>] Additional header keys that must not be overridden.
41
+ # @return [Hash] The merged headers.
42
+ def merge_additional_headers(sdk_headers, protected_keys: [])
43
+ additional_headers = @request_options&.dig(:additional_headers) || @request_options&.dig("additional_headers") || {}
44
+ all_protected = (sdk_headers.keys + protected_keys).to_set { |k| k.to_s.downcase }
45
+ filtered = additional_headers.reject { |key, _| all_protected.include?(key.to_s.downcase) }
46
+ sdk_headers.merge(filtered)
47
+ end
34
48
  end
35
49
  end
36
50
  end
@@ -43,7 +43,7 @@ module Payabli
43
43
  http_request = build_http_request(
44
44
  url:,
45
45
  method: request.method,
46
- headers: request.encode_headers,
46
+ headers: request.encode_headers(protected_keys: @default_headers.keys),
47
47
  body: request.encode_body
48
48
  )
49
49
 
@@ -120,6 +120,8 @@ module Payabli
120
120
  [delay + jitter, 0].max
121
121
  end
122
122
 
123
+ LOCALHOST_HOSTS = %w[localhost 127.0.0.1 [::1]].freeze
124
+
123
125
  # @param request [Payabli::Internal::Http::BaseRequest] The HTTP request.
124
126
  # @return [URI::Generic] The URL.
125
127
  def build_url(request)
@@ -129,14 +131,29 @@ module Payabli
129
131
  if request.path.start_with?("http://", "https://")
130
132
  url = request.path
131
133
  url = "#{url}?#{encode_query(encoded_query)}" if encoded_query&.any?
132
- return URI.parse(url)
134
+ parsed = URI.parse(url)
135
+ validate_https!(parsed)
136
+ return parsed
133
137
  end
134
138
 
135
139
  path = request.path.start_with?("/") ? request.path[1..] : request.path
136
140
  base = request.base_url || @base_url
137
141
  url = "#{base.chomp("/")}/#{path}"
138
142
  url = "#{url}?#{encode_query(encoded_query)}" if encoded_query&.any?
139
- URI.parse(url)
143
+ parsed = URI.parse(url)
144
+ validate_https!(parsed)
145
+ parsed
146
+ end
147
+
148
+ # Raises if the URL uses http:// for a non-localhost host, which would
149
+ # send authentication credentials in plaintext.
150
+ # @param url [URI::Generic] The parsed URL.
151
+ def validate_https!(url)
152
+ return if url.scheme != "http"
153
+ return if LOCALHOST_HOSTS.include?(url.host)
154
+
155
+ raise ArgumentError, "Refusing to send request to non-HTTPS URL: #{url}. " \
156
+ "HTTP is only allowed for localhost. Use HTTPS or pass a localhost URL."
140
157
  end
141
158
 
142
159
  # @param url [URI::Generic] The url to the resource.
@@ -180,6 +197,7 @@ module Payabli
180
197
 
181
198
  http = Net::HTTP.new(url.host, port)
182
199
  http.use_ssl = is_https
200
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER if is_https
183
201
  # NOTE: We handle retries at the application level with HTTP status code awareness,
184
202
  # so we set max_retries to 0 to disable Net::HTTP's built-in network-level retries.
185
203
  http.max_retries = 0
@@ -21,12 +21,14 @@ module Payabli
21
21
  end
22
22
 
23
23
  # @return [Hash] The encoded HTTP request headers.
24
- def encode_headers
25
- additional_headers = @request_options&.dig(:additional_headers) || @request_options&.dig("additional_headers") || {}
26
- {
24
+ # @param protected_keys [Array<String>] Header keys set by the SDK client (e.g. auth, metadata)
25
+ # that must not be overridden by additional_headers from request_options.
26
+ def encode_headers(protected_keys: [])
27
+ sdk_headers = {
27
28
  "Content-Type" => "application/json",
28
29
  "Accept" => "application/json"
29
- }.merge(@headers).merge(additional_headers)
30
+ }.merge(@headers)
31
+ merge_additional_headers(sdk_headers, protected_keys:)
30
32
  end
31
33
 
32
34
  # @return [String, nil] The encoded HTTP request body.
@@ -21,11 +21,13 @@ module Payabli
21
21
  end
22
22
 
23
23
  # @return [Hash] The encoded HTTP request headers.
24
- def encode_headers
25
- additional_headers = @request_options&.dig(:additional_headers) || @request_options&.dig("additional_headers") || {}
26
- {
24
+ # @param protected_keys [Array<String>] Header keys set by the SDK client (e.g. auth, metadata)
25
+ # that must not be overridden by additional_headers from request_options.
26
+ def encode_headers(protected_keys: [])
27
+ sdk_headers = {
27
28
  "Content-Type" => @body.content_type
28
- }.merge(@headers).merge(additional_headers)
29
+ }.merge(@headers)
30
+ merge_additional_headers(sdk_headers, protected_keys:)
29
31
  end
30
32
 
31
33
  # @return [String, nil] The encoded HTTP request body.
@@ -17,7 +17,7 @@ module Payabli
17
17
  def self.coerce(value, strict: strict?)
18
18
  case value
19
19
  when TrueClass, FalseClass
20
- value
20
+ return value
21
21
  when Integer
22
22
  return value == 1
23
23
  when String
@@ -81,10 +81,10 @@ module Payabli
81
81
  }
82
82
  return type.coerce(value, strict: strict)
83
83
  else
84
- value
84
+ value # rubocop:disable Lint/Void
85
85
  end
86
86
  else
87
- value
87
+ value # rubocop:disable Lint/Void
88
88
  end
89
89
 
90
90
  raise Errors::TypeError, "cannot coerce value of type `#{value.class}` to `#{target}`" if strict
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Management
5
+ class Client
6
+ # @param client [Payabli::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
9
+ def initialize(client:)
10
+ @client = client
11
+ end
12
+
13
+ # Verifies a bank account and returns detailed verification results from the verification network, including bank
14
+ # name, account status, and response codes. Unlike a pass/fail verification, this endpoint returns granular data
15
+ # to support decision-making and troubleshooting.
16
+ #
17
+ # When bank authentication is enabled for the paypoint's organization, the endpoint performs an identity
18
+ # verification check on the account holder. Otherwise, it performs an account existence check. When bank
19
+ # authentication is enabled, the `accountHolderType` and `holderName` fields are required.
20
+ #
21
+ # Requires `inboundpayments_create` or `outboundpayments_create` permission.
22
+ #
23
+ # @param request_options [Hash]
24
+ # @param params [Payabli::Management::Types::VerifyAccountDetailsRequest]
25
+ # @option request_options [String] :base_url
26
+ # @option request_options [Hash{String => Object}] :additional_headers
27
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
28
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
29
+ # @option request_options [Integer] :timeout_in_seconds
30
+ # @option params [String] :entry
31
+ #
32
+ # @return [Payabli::Management::Types::VerifyAccountDetailsResponse]
33
+ def verify_account_details(request_options: {}, **params)
34
+ params = Payabli::Internal::Types::Utils.normalize_keys(params)
35
+ request_data = Payabli::Management::Types::VerifyAccountDetailsRequest.new(params).to_h
36
+ non_body_param_names = ["entry"]
37
+ body = request_data.except(*non_body_param_names)
38
+
39
+ request = Payabli::Internal::JSON::Request.new(
40
+ base_url: request_options[:base_url],
41
+ method: "POST",
42
+ path: "Management/verifyAccountDetails/#{URI.encode_uri_component(params[:entry].to_s)}",
43
+ body: body,
44
+ request_options: request_options
45
+ )
46
+ begin
47
+ response = @client.send(request)
48
+ rescue Net::HTTPRequestTimeout
49
+ raise Payabli::Errors::TimeoutError
50
+ end
51
+ code = response.code.to_i
52
+ if code.between?(200, 299)
53
+ Payabli::Management::Types::VerifyAccountDetailsResponse.load(response.body)
54
+ else
55
+ error_class = Payabli::Errors::ResponseError.subclass_for_code(code)
56
+ raise error_class.new(response.body, code: code)
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Management
5
+ module Types
6
+ # Detailed bank account verification results from the verification network.
7
+ class BankAccountVerificationDetailsResponse < Internal::Types::Model
8
+ field :aba, -> { String }, optional: true, nullable: false
9
+ field :account_number, -> { String }, optional: true, nullable: false, api_name: "accountNumber"
10
+ field :is_valid, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isValid"
11
+ field :error_message, -> { String }, optional: true, nullable: false, api_name: "errorMessage"
12
+ field :verification_response, -> { String }, optional: true, nullable: false, api_name: "verificationResponse"
13
+ field :response_code, -> { String }, optional: true, nullable: false, api_name: "responseCode"
14
+ field :response_value, -> { String }, optional: true, nullable: false, api_name: "responseValue"
15
+ field :response_description, -> { String }, optional: true, nullable: false, api_name: "responseDescription"
16
+ field :bank_name, -> { String }, optional: true, nullable: false, api_name: "bankName"
17
+ field :reported_account_type, -> { String }, optional: true, nullable: false, api_name: "reportedAccountType"
18
+ field :account_added_date, -> { String }, optional: true, nullable: false, api_name: "accountAddedDate"
19
+ field :account_last_updated_date, -> { String }, optional: true, nullable: false, api_name: "accountLastUpdatedDate"
20
+ field :account_closed_date, -> { String }, optional: true, nullable: false, api_name: "accountClosedDate"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Management
5
+ module Types
6
+ class VerifyAccountDetailsRequest < Internal::Types::Model
7
+ field :entry, -> { String }, optional: false, nullable: false
8
+ field :routing_number, -> { String }, optional: false, nullable: false, api_name: "routingNumber"
9
+ field :account_number, -> { String }, optional: false, nullable: false, api_name: "accountNumber"
10
+ field :account_type, -> { String }, optional: true, nullable: false, api_name: "accountType"
11
+ field :country, -> { String }, optional: true, nullable: false
12
+ field :account_holder_type, -> { String }, optional: true, nullable: false, api_name: "accountHolderType"
13
+ field :holder_name, -> { String }, optional: true, nullable: false, api_name: "holderName"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Management
5
+ module Types
6
+ # Response wrapper for the bank account verification details endpoint.
7
+ class VerifyAccountDetailsResponse < Internal::Types::Model
8
+ field :is_success, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isSuccess"
9
+ field :response_text, -> { String }, optional: false, nullable: false, api_name: "responseText"
10
+ field :response_data, -> { Payabli::Management::Types::BankAccountVerificationDetailsResponse }, optional: true, nullable: false, api_name: "responseData"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -299,7 +299,9 @@ module Payabli
299
299
 
300
300
  # A reversal either refunds or voids a transaction independent of the transaction's settlement status. Send a
301
301
  # reversal request for a transaction, and Payabli automatically determines whether it's a refund or void. You
302
- # don't need to know whether the transaction is settled or not.
302
+ # don't need to know whether the transaction is settled or not. This endpoint only works on transactions made with
303
+ # the v1 API. For v2 transactions, check the transaction's settlement status and call v2 void or v2 refund based
304
+ # on the result.
303
305
  #
304
306
  # @param request_options [Hash]
305
307
  # @param params [Hash]
@@ -13,7 +13,7 @@ module Payabli
13
13
  field :initiator, -> { String }, optional: false, nullable: true
14
14
  field :stored_method_usage_type, -> { String }, optional: false, nullable: true, api_name: "storedMethodUsageType"
15
15
  field :sequence, -> { String }, optional: false, nullable: true
16
- field :order_description, -> { String }, optional: false, nullable: false, api_name: "orderDescription"
16
+ field :order_description, -> { String }, optional: false, nullable: true, api_name: "orderDescription"
17
17
  field :account_id, -> { String }, optional: false, nullable: true, api_name: "accountId"
18
18
  field :signature_data, -> { String }, optional: false, nullable: true, api_name: "signatureData"
19
19
  field :bin_data, -> { Payabli::Types::BinData }, optional: false, nullable: true, api_name: "binData"
@@ -10,8 +10,9 @@ module Payabli
10
10
  @client = client
11
11
  end
12
12
 
13
- # Authorizes transaction for payout. Authorized transactions aren't flagged for settlement until captured. Use
14
- # `referenceId` returned in the response to capture the transaction.
13
+ # Authorizes transaction for payout. If you don't pass the `autoCapture` field with a value of `true`, authorized
14
+ # transactions aren't flagged for settlement until captured. Use `referenceId` returned in the response to
15
+ # capture the transaction.
15
16
  #
16
17
  # @param request_options [Hash]
17
18
  # @param params [Payabli::MoneyOutTypes::Types::AuthorizePayoutBody]
@@ -203,7 +204,8 @@ module Payabli
203
204
  end
204
205
  end
205
206
 
206
- # Captures a single authorized payout transaction by ID.
207
+ # Captures a single authorized payout transaction by ID. If the transaction was authorized with `autoCapture` set
208
+ # to `true`, you don't need to call this endpoint to capture the transaction for processing.
207
209
  #
208
210
  # @param request_options [Hash]
209
211
  # @param params [Hash]
@@ -15,6 +15,7 @@ module Payabli
15
15
  field :account_id, -> { String }, optional: true, nullable: false, api_name: "accountId"
16
16
  field :subdomain, -> { String }, optional: true, nullable: false
17
17
  field :subscription_id, -> { Integer }, optional: true, nullable: false, api_name: "subscriptionId"
18
+ field :auto_capture, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "autoCapture"
18
19
  end
19
20
  end
20
21
  end
@@ -512,6 +512,106 @@ module Payabli
512
512
  end
513
513
  end
514
514
 
515
+ # Returns a list of cloud devices for a single paypoint. Use filters to limit results. Include the `exportFormat`
516
+ # query parameter to return the results as a file instead of a JSON response.
517
+ #
518
+ # @param request_options [Hash]
519
+ # @param params [Hash]
520
+ # @option request_options [String] :base_url
521
+ # @option request_options [Hash{String => Object}] :additional_headers
522
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
523
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
524
+ # @option request_options [Integer] :timeout_in_seconds
525
+ # @option params [Payabli::Types::Entry] :entry
526
+ # @option params [Payabli::Types::ExportFormat, nil] :export_format
527
+ # @option params [Integer, nil] :from_record
528
+ # @option params [Integer, nil] :limit_record
529
+ # @option params [Hash[String, String, nil], nil] :parameters
530
+ # @option params [String, nil] :sort_by
531
+ #
532
+ # @return [Payabli::QueryTypes::Types::QueryDeviceResponse]
533
+ def list_devices(request_options: {}, **params)
534
+ params = Payabli::Internal::Types::Utils.normalize_keys(params)
535
+ query_param_names = %i[export_format from_record limit_record parameters sort_by]
536
+ query_params = {}
537
+ query_params["exportFormat"] = params[:export_format] if params.key?(:export_format)
538
+ query_params["fromRecord"] = params[:from_record] if params.key?(:from_record)
539
+ query_params["limitRecord"] = params[:limit_record] if params.key?(:limit_record)
540
+ query_params["parameters"] = params[:parameters] if params.key?(:parameters)
541
+ query_params["sortBy"] = params[:sort_by] if params.key?(:sort_by)
542
+ params = params.except(*query_param_names)
543
+
544
+ request = Payabli::Internal::JSON::Request.new(
545
+ base_url: request_options[:base_url],
546
+ method: "GET",
547
+ path: "Query/devices/#{URI.encode_uri_component(params[:entry].to_s)}",
548
+ query: query_params,
549
+ request_options: request_options
550
+ )
551
+ begin
552
+ response = @client.send(request)
553
+ rescue Net::HTTPRequestTimeout
554
+ raise Payabli::Errors::TimeoutError
555
+ end
556
+ code = response.code.to_i
557
+ if code.between?(200, 299)
558
+ Payabli::QueryTypes::Types::QueryDeviceResponse.load(response.body)
559
+ else
560
+ error_class = Payabli::Errors::ResponseError.subclass_for_code(code)
561
+ raise error_class.new(response.body, code: code)
562
+ end
563
+ end
564
+
565
+ # Returns a list of cloud devices for a single organization. Use filters to limit results. Include the
566
+ # `exportFormat` query parameter to return the results as a file instead of a JSON response.
567
+ #
568
+ # @param request_options [Hash]
569
+ # @param params [Hash]
570
+ # @option request_options [String] :base_url
571
+ # @option request_options [Hash{String => Object}] :additional_headers
572
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
573
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
574
+ # @option request_options [Integer] :timeout_in_seconds
575
+ # @option params [Integer] :org_id
576
+ # @option params [Payabli::Types::ExportFormat, nil] :export_format
577
+ # @option params [Integer, nil] :from_record
578
+ # @option params [Integer, nil] :limit_record
579
+ # @option params [Hash[String, String, nil], nil] :parameters
580
+ # @option params [String, nil] :sort_by
581
+ #
582
+ # @return [Payabli::QueryTypes::Types::QueryDeviceResponse]
583
+ def list_devices_org(request_options: {}, **params)
584
+ params = Payabli::Internal::Types::Utils.normalize_keys(params)
585
+ query_param_names = %i[export_format from_record limit_record parameters sort_by]
586
+ query_params = {}
587
+ query_params["exportFormat"] = params[:export_format] if params.key?(:export_format)
588
+ query_params["fromRecord"] = params[:from_record] if params.key?(:from_record)
589
+ query_params["limitRecord"] = params[:limit_record] if params.key?(:limit_record)
590
+ query_params["parameters"] = params[:parameters] if params.key?(:parameters)
591
+ query_params["sortBy"] = params[:sort_by] if params.key?(:sort_by)
592
+ params = params.except(*query_param_names)
593
+
594
+ request = Payabli::Internal::JSON::Request.new(
595
+ base_url: request_options[:base_url],
596
+ method: "GET",
597
+ path: "Query/devices/org/#{URI.encode_uri_component(params[:org_id].to_s)}",
598
+ query: query_params,
599
+ request_options: request_options
600
+ )
601
+ begin
602
+ response = @client.send(request)
603
+ rescue Net::HTTPRequestTimeout
604
+ raise Payabli::Errors::TimeoutError
605
+ end
606
+ code = response.code.to_i
607
+ if code.between?(200, 299)
608
+ Payabli::QueryTypes::Types::QueryDeviceResponse.load(response.body)
609
+ else
610
+ error_class = Payabli::Errors::ResponseError.subclass_for_code(code)
611
+ raise error_class.new(response.body, code: code)
612
+ end
613
+ end
614
+
515
615
  # Returns a list of all reports generated in the last 60 days for a single entrypoint. Use filters to limit
516
616
  # results.
517
617
  #
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Query
5
+ module Types
6
+ class ListDevicesOrgRequest < Internal::Types::Model
7
+ field :org_id, -> { Integer }, optional: false, nullable: false, api_name: "orgId"
8
+ field :export_format, -> { Payabli::Types::ExportFormat }, optional: true, nullable: false, api_name: "exportFormat"
9
+ field :from_record, -> { Integer }, optional: true, nullable: false, api_name: "fromRecord"
10
+ field :limit_record, -> { Integer }, optional: true, nullable: false, api_name: "limitRecord"
11
+ field :parameters, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
12
+ field :sort_by, -> { String }, optional: true, nullable: false, api_name: "sortBy"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Query
5
+ module Types
6
+ class ListDevicesRequest < Internal::Types::Model
7
+ field :entry, -> { String }, optional: false, nullable: false
8
+ field :export_format, -> { Payabli::Types::ExportFormat }, optional: true, nullable: false, api_name: "exportFormat"
9
+ field :from_record, -> { Integer }, optional: true, nullable: false, api_name: "fromRecord"
10
+ field :limit_record, -> { Integer }, optional: true, nullable: false, api_name: "limitRecord"
11
+ field :parameters, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
12
+ field :sort_by, -> { String }, optional: true, nullable: false, api_name: "sortBy"
13
+ end
14
+ end
15
+ end
16
+ end