lithic 0.1.0.pre.alpha.43 → 0.1.0.pre.alpha.45

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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/errors.rb +25 -11
  5. data/lib/lithic/internal/cursor_page.rb +1 -1
  6. data/lib/lithic/internal/single_page.rb +1 -1
  7. data/lib/lithic/internal/transport/base_client.rb +11 -7
  8. data/lib/lithic/internal/type/base_page.rb +1 -1
  9. data/lib/lithic/internal/type/union.rb +9 -7
  10. data/lib/lithic/internal/util.rb +1 -1
  11. data/lib/lithic/models/account_activity_list_response.rb +2 -0
  12. data/lib/lithic/models/account_activity_retrieve_transaction_response.rb +2 -0
  13. data/lib/lithic/models/transaction_simulate_void_params.rb +2 -1
  14. data/lib/lithic/models.rb +0 -3
  15. data/lib/lithic/resources/transactions.rb +0 -36
  16. data/lib/lithic/version.rb +1 -1
  17. data/lib/lithic.rb +0 -2
  18. data/rbi/lithic/errors.rbi +29 -2
  19. data/rbi/lithic/internal/transport/base_client.rbi +4 -5
  20. data/rbi/lithic/internal/type/base_page.rbi +1 -1
  21. data/rbi/lithic/internal/util.rbi +1 -1
  22. data/rbi/lithic/models/transaction_simulate_void_params.rbi +4 -2
  23. data/rbi/lithic/models.rbi +0 -3
  24. data/rbi/lithic/resources/transactions.rbi +2 -34
  25. data/sig/lithic/errors.rbs +7 -0
  26. data/sig/lithic/models.rbs +0 -2
  27. data/sig/lithic/resources/transactions.rbs +0 -9
  28. metadata +2 -8
  29. data/lib/lithic/models/transaction_simulate_credit_authorization_params.rb +0 -61
  30. data/lib/lithic/models/transaction_simulate_credit_authorization_response.rb +0 -25
  31. data/rbi/lithic/models/transaction_simulate_credit_authorization_params.rbi +0 -92
  32. data/rbi/lithic/models/transaction_simulate_credit_authorization_response.rbi +0 -46
  33. data/sig/lithic/models/transaction_simulate_credit_authorization_params.rbs +0 -50
  34. data/sig/lithic/models/transaction_simulate_credit_authorization_response.rbs +0 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21e9addcee76f9bfe59787212940d0f8b8809897372fd70b2abd9ffc60726d75
4
- data.tar.gz: 1c2101f6ad278cb7b4e50e2b4a0d260306eedfad43c23cf30c489fe1dd1a5490
3
+ metadata.gz: 89b599524fba572a6c9b79caef267ff1ea273ce7e5ce1d17d550ef8e1c443731
4
+ data.tar.gz: 47a8d7158877fcdc1af90ef76d23dce552933ae698bb91243f3bb11acc60e4bc
5
5
  SHA512:
6
- metadata.gz: 10238fe4062921326719e7b6a3d509c5c982e4f2a54bd5f682b82a2ea3ba64733a368c12d415e77b95a3b23e15d75ad76d48ca14551f669b7cccb80ac7fb23b0
7
- data.tar.gz: 118a5b70a06ec13d8748bed261c13a5d85e727255336284bcc9b938af33f18c928db83c37ff130818dbc5a5b833edcd25acc882f36ee7d36d4f64f06d66e05d0
6
+ metadata.gz: 6d017406bc463df8065989ecf9289cd041f86072db7c0e0c0546da7ef6d44e6dcb345b4f192e5511cdba9f9a84c18c0bfad9832f1e391695cd7b15ac1a008a20
7
+ data.tar.gz: 15fa6fd95c8793bb2e351d7e1ab12c99b4a9d7c1aca1ffb8b9be865076670c89929a143e4b13628e623281a852cdb7b6ce334bf1bc4cdf99ff2cba8644433613
data/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.45 (2025-09-26)
4
+
5
+ Full Changelog: [v0.1.0-alpha.44...v0.1.0-alpha.45](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.44...v0.1.0-alpha.45)
6
+
7
+ ### Features
8
+
9
+ * expose response headers for both streams and errors ([a0a6aba](https://github.com/lithic-com/lithic-ruby/commit/a0a6aba5882df60a0019557a7e7d38aba3fb7176))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **internal:** use null byte as file separator in the fast formatting script ([7260d7a](https://github.com/lithic-com/lithic-ruby/commit/7260d7a16edee1733a39556e554ed6f1901595de))
15
+
16
+
17
+ ### Performance Improvements
18
+
19
+ * faster code formatting ([0367f27](https://github.com/lithic-com/lithic-ruby/commit/0367f2706e7903d3552ee18b7a75f62ece9fc927))
20
+
21
+
22
+ ### Chores
23
+
24
+ * do not install brew dependencies in ./scripts/bootstrap by default ([23ebf5c](https://github.com/lithic-com/lithic-ruby/commit/23ebf5c02a0c168955ed2ebf1e7ef38d2d4eeda4))
25
+ * **docs:** small updates to doc strings on a few endpoints ([b7c4832](https://github.com/lithic-com/lithic-ruby/commit/b7c4832186d3ecddb47728496bf966e00e3c15eb))
26
+ * improve example values ([5c934d6](https://github.com/lithic-com/lithic-ruby/commit/5c934d6d52eccc89a72dfe7d5a850280b44ded75))
27
+
28
+ ## 0.1.0-alpha.44 (2025-09-11)
29
+
30
+ Full Changelog: [v0.1.0-alpha.43...v0.1.0-alpha.44](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.43...v0.1.0-alpha.44)
31
+
32
+ ### Features
33
+
34
+ * **api:** correct deprecation ([5f3c64b](https://github.com/lithic-com/lithic-ruby/commit/5f3c64b290779e9eeeae4bc6207adb702d10bcfb))
35
+
3
36
  ## 0.1.0-alpha.43 (2025-09-11)
4
37
 
5
38
  Full Changelog: [v0.1.0-alpha.42...v0.1.0-alpha.43](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.42...v0.1.0-alpha.43)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "lithic", "~> 0.1.0.pre.alpha.43"
18
+ gem "lithic", "~> 0.1.0.pre.alpha.45"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
data/lib/lithic/errors.rb CHANGED
@@ -40,6 +40,9 @@ module Lithic
40
40
  # @return [Integer, nil]
41
41
  attr_accessor :status
42
42
 
43
+ # @return [Hash{String=>String}, nil]
44
+ attr_accessor :headers
45
+
43
46
  # @return [Object, nil]
44
47
  attr_accessor :body
45
48
 
@@ -47,13 +50,15 @@ module Lithic
47
50
  #
48
51
  # @param url [URI::Generic]
49
52
  # @param status [Integer, nil]
53
+ # @param headers [Hash{String=>String}, nil]
50
54
  # @param body [Object, nil]
51
55
  # @param request [nil]
52
56
  # @param response [nil]
53
57
  # @param message [String, nil]
54
- def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil)
58
+ def initialize(url:, status: nil, headers: nil, body: nil, request: nil, response: nil, message: nil)
55
59
  @url = url
56
60
  @status = status
61
+ @headers = headers
57
62
  @body = body
58
63
  @request = request
59
64
  @response = response
@@ -74,6 +79,7 @@ module Lithic
74
79
  #
75
80
  # @param url [URI::Generic]
76
81
  # @param status [nil]
82
+ # @param headers [Hash{String=>String}, nil]
77
83
  # @param body [nil]
78
84
  # @param request [nil]
79
85
  # @param response [nil]
@@ -81,6 +87,7 @@ module Lithic
81
87
  def initialize(
82
88
  url:,
83
89
  status: nil,
90
+ headers: nil,
84
91
  body: nil,
85
92
  request: nil,
86
93
  response: nil,
@@ -95,6 +102,7 @@ module Lithic
95
102
  #
96
103
  # @param url [URI::Generic]
97
104
  # @param status [nil]
105
+ # @param headers [Hash{String=>String}, nil]
98
106
  # @param body [nil]
99
107
  # @param request [nil]
100
108
  # @param response [nil]
@@ -102,6 +110,7 @@ module Lithic
102
110
  def initialize(
103
111
  url:,
104
112
  status: nil,
113
+ headers: nil,
105
114
  body: nil,
106
115
  request: nil,
107
116
  response: nil,
@@ -116,21 +125,24 @@ module Lithic
116
125
  #
117
126
  # @param url [URI::Generic]
118
127
  # @param status [Integer]
128
+ # @param headers [Hash{String=>String}, nil]
119
129
  # @param body [Object, nil]
120
130
  # @param request [nil]
121
131
  # @param response [nil]
122
132
  # @param message [String, nil]
123
133
  #
124
134
  # @return [self]
125
- def self.for(url:, status:, body:, request:, response:, message: nil)
126
- kwargs = {
127
- url: url,
128
- status: status,
129
- body: body,
130
- request: request,
131
- response: response,
132
- message: message
133
- }
135
+ def self.for(url:, status:, headers:, body:, request:, response:, message: nil)
136
+ kwargs =
137
+ {
138
+ url: url,
139
+ status: status,
140
+ headers: headers,
141
+ body: body,
142
+ request: request,
143
+ response: response,
144
+ message: message
145
+ }
134
146
 
135
147
  case status
136
148
  in 400
@@ -162,15 +174,17 @@ module Lithic
162
174
  #
163
175
  # @param url [URI::Generic]
164
176
  # @param status [Integer]
177
+ # @param headers [Hash{String=>String}, nil]
165
178
  # @param body [Object, nil]
166
179
  # @param request [nil]
167
180
  # @param response [nil]
168
181
  # @param message [String, nil]
169
- def initialize(url:, status:, body:, request:, response:, message: nil)
182
+ def initialize(url:, status:, headers:, body:, request:, response:, message: nil)
170
183
  message ||= {url: url.to_s, status: status, body: body}
171
184
  super(
172
185
  url: url,
173
186
  status: status,
187
+ headers: headers,
174
188
  body: body,
175
189
  request: request,
176
190
  response: response,
@@ -60,7 +60,7 @@ module Lithic
60
60
  #
61
61
  # @param client [Lithic::Internal::Transport::BaseClient]
62
62
  # @param req [Hash{Symbol=>Object}]
63
- # @param headers [Hash{String=>String}, Net::HTTPHeader]
63
+ # @param headers [Hash{String=>String}]
64
64
  # @param page_data [Hash{Symbol=>Object}]
65
65
  def initialize(client:, req:, headers:, page_data:)
66
66
  super
@@ -54,7 +54,7 @@ module Lithic
54
54
  #
55
55
  # @param client [Lithic::Internal::Transport::BaseClient]
56
56
  # @param req [Hash{Symbol=>Object}]
57
- # @param headers [Hash{String=>String}, Net::HTTPHeader]
57
+ # @param headers [Hash{String=>String}]
58
58
  # @param page_data [Array<Object>]
59
59
  def initialize(client:, req:, headers:, page_data:)
60
60
  super
@@ -47,7 +47,7 @@ module Lithic
47
47
  # @api private
48
48
  #
49
49
  # @param status [Integer]
50
- # @param headers [Hash{String=>String}, Net::HTTPHeader]
50
+ # @param headers [Hash{String=>String}]
51
51
  #
52
52
  # @return [Boolean]
53
53
  def should_retry?(status, headers:)
@@ -85,7 +85,7 @@ module Lithic
85
85
  #
86
86
  # @param status [Integer]
87
87
  #
88
- # @param response_headers [Hash{String=>String}, Net::HTTPHeader]
88
+ # @param response_headers [Hash{String=>String}]
89
89
  #
90
90
  # @return [Hash{Symbol=>Object}]
91
91
  def follow_redirect(request, status:, response_headers:)
@@ -378,6 +378,7 @@ module Lithic
378
378
  rescue Lithic::Errors::APIConnectionError => e
379
379
  status = e
380
380
  end
381
+ headers = Lithic::Internal::Util.normalized_headers(response&.each_header&.to_h)
381
382
 
382
383
  case status
383
384
  in ..299
@@ -390,7 +391,7 @@ module Lithic
390
391
  in 300..399
391
392
  self.class.reap_connection!(status, stream: stream)
392
393
 
393
- request = self.class.follow_redirect(request, status: status, response_headers: response)
394
+ request = self.class.follow_redirect(request, status: status, response_headers: headers)
394
395
  send_request(
395
396
  request,
396
397
  redirect_count: redirect_count + 1,
@@ -399,9 +400,9 @@ module Lithic
399
400
  )
400
401
  in Lithic::Errors::APIConnectionError if retry_count >= max_retries
401
402
  raise status
402
- in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: response)
403
+ in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: headers)
403
404
  decoded = Kernel.then do
404
- Lithic::Internal::Util.decode_content(response, stream: stream, suppress_error: true)
405
+ Lithic::Internal::Util.decode_content(headers, stream: stream, suppress_error: true)
405
406
  ensure
406
407
  self.class.reap_connection!(status, stream: stream)
407
408
  end
@@ -409,6 +410,7 @@ module Lithic
409
410
  raise Lithic::Errors::APIStatusError.for(
410
411
  url: url,
411
412
  status: status,
413
+ headers: headers,
412
414
  body: decoded,
413
415
  request: nil,
414
416
  response: response
@@ -485,19 +487,21 @@ module Lithic
485
487
  send_retry_header: send_retry_header
486
488
  )
487
489
 
488
- decoded = Lithic::Internal::Util.decode_content(response, stream: stream)
490
+ headers = Lithic::Internal::Util.normalized_headers(response.each_header.to_h)
491
+ decoded = Lithic::Internal::Util.decode_content(headers, stream: stream)
489
492
  case req
490
493
  in {stream: Class => st}
491
494
  st.new(
492
495
  model: model,
493
496
  url: url,
494
497
  status: status,
498
+ headers: headers,
495
499
  response: response,
496
500
  unwrap: unwrap,
497
501
  stream: decoded
498
502
  )
499
503
  in {page: Class => page}
500
- page.new(client: self, req: req, headers: response, page_data: decoded)
504
+ page.new(client: self, req: req, headers: headers, page_data: decoded)
501
505
  else
502
506
  unwrapped = Lithic::Internal::Util.dig(decoded, unwrap)
503
507
  Lithic::Internal::Type::Converter.coerce(model, unwrapped)
@@ -39,7 +39,7 @@ module Lithic
39
39
  #
40
40
  # @param client [Lithic::Internal::Transport::BaseClient]
41
41
  # @param req [Hash{Symbol=>Object}]
42
- # @param headers [Hash{String=>String}, Net::HTTPHeader]
42
+ # @param headers [Hash{String=>String}]
43
43
  # @param page_data [Object]
44
44
  def initialize(client:, req:, headers:, page_data:)
45
45
  @client = client
@@ -6,14 +6,16 @@ module Lithic
6
6
  # @api private
7
7
  #
8
8
  # @example
9
- # # `account_holder_update_response` is a `Lithic::Models::AccountHolderUpdateResponse`
10
- # case account_holder_update_response
11
- # when Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse
12
- # puts(account_holder_update_response.token)
13
- # when Lithic::Models::AccountHolderUpdateResponse::PatchResponse
14
- # puts(account_holder_update_response.address)
9
+ # # `account_activity_list_response` is a `Lithic::Models::AccountActivityListResponse`
10
+ # case account_activity_list_response
11
+ # when Lithic::Models::AccountActivityListResponse::FinancialTransaction
12
+ # puts(account_activity_list_response.token)
13
+ # when Lithic::Models::AccountActivityListResponse::BookTransferTransaction
14
+ # puts(account_activity_list_response.category)
15
+ # when Lithic::Models::AccountActivityListResponse::CardTransaction
16
+ # # ...
15
17
  # else
16
- # puts(account_holder_update_response)
18
+ # puts(account_activity_list_response)
17
19
  # end
18
20
  module Union
19
21
  include Lithic::Internal::Type::Converter
@@ -647,7 +647,7 @@ module Lithic
647
647
  #
648
648
  # Assumes each chunk in stream has `Encoding::BINARY`.
649
649
  #
650
- # @param headers [Hash{String=>String}, Net::HTTPHeader]
650
+ # @param headers [Hash{String=>String}]
651
651
  # @param stream [Enumerable<String>]
652
652
  # @param suppress_error [Boolean]
653
653
  #
@@ -8,6 +8,8 @@ module Lithic
8
8
  module AccountActivityListResponse
9
9
  extend Lithic::Internal::Type::Union
10
10
 
11
+ discriminator :family
12
+
11
13
  # Financial transaction with inheritance from unified base transaction
12
14
  variant -> { Lithic::Models::AccountActivityListResponse::FinancialTransaction }
13
15
 
@@ -8,6 +8,8 @@ module Lithic
8
8
  module AccountActivityRetrieveTransactionResponse
9
9
  extend Lithic::Internal::Type::Union
10
10
 
11
+ discriminator :family
12
+
11
13
  # Financial transaction with inheritance from unified base transaction
12
14
  variant -> { Lithic::Models::AccountActivityRetrieveTransactionResponse::FinancialTransaction }
13
15
 
@@ -15,7 +15,8 @@ module Lithic
15
15
 
16
16
  # @!attribute amount
17
17
  # Amount (in cents) to void. Typically this will match the amount in the original
18
- # authorization, but can be less.
18
+ # authorization, but can be less. Applies to authorization reversals only. An
19
+ # authorization expiry will always apply to the full pending amount.
19
20
  #
20
21
  # @return [Integer, nil]
21
22
  optional :amount, Integer
data/lib/lithic/models.rb CHANGED
@@ -378,9 +378,6 @@ module Lithic
378
378
  TransactionSimulateCreditAuthorizationAdviceParams =
379
379
  Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams
380
380
 
381
- TransactionSimulateCreditAuthorizationParams =
382
- Lithic::Models::TransactionSimulateCreditAuthorizationParams
383
-
384
381
  TransactionSimulateReturnParams = Lithic::Models::TransactionSimulateReturnParams
385
382
 
386
383
  TransactionSimulateReturnReversalParams = Lithic::Models::TransactionSimulateReturnReversalParams
@@ -204,42 +204,6 @@ module Lithic
204
204
  )
205
205
  end
206
206
 
207
- # @deprecated use `simulate_credit_authorization_advice` instead
208
- #
209
- # Some parameter documentations has been truncated, see
210
- # {Lithic::Models::TransactionSimulateCreditAuthorizationParams} for more details.
211
- #
212
- # Simulates a credit authorization advice from the card network. This message
213
- # indicates that the network approved a credit authorization on your behalf.
214
- #
215
- # @overload simulate_credit_authorization(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {})
216
- #
217
- # @param amount [Integer] Amount (in cents). Any value entered will be converted into a negative amount in
218
- #
219
- # @param descriptor [String] Merchant descriptor.
220
- #
221
- # @param pan [String] Sixteen digit card number.
222
- #
223
- # @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number
224
- #
225
- # @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor.
226
- #
227
- # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
228
- #
229
- # @return [Lithic::Models::TransactionSimulateCreditAuthorizationResponse]
230
- #
231
- # @see Lithic::Models::TransactionSimulateCreditAuthorizationParams
232
- def simulate_credit_authorization(params)
233
- parsed, options = Lithic::TransactionSimulateCreditAuthorizationParams.dump_request(params)
234
- @client.request(
235
- method: :post,
236
- path: "v1/simulate/credit_authorization_advice",
237
- body: parsed,
238
- model: Lithic::Models::TransactionSimulateCreditAuthorizationResponse,
239
- options: options
240
- )
241
- end
242
-
243
207
  # Some parameter documentations has been truncated, see
244
208
  # {Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams} for more
245
209
  # details.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lithic
4
- VERSION = "0.1.0.pre.alpha.43"
4
+ VERSION = "0.1.0.pre.alpha.45"
5
5
  end
data/lib/lithic.rb CHANGED
@@ -341,8 +341,6 @@ require_relative "lithic/models/transaction_simulate_clearing_params"
341
341
  require_relative "lithic/models/transaction_simulate_clearing_response"
342
342
  require_relative "lithic/models/transaction_simulate_credit_authorization_advice_params"
343
343
  require_relative "lithic/models/transaction_simulate_credit_authorization_advice_response"
344
- require_relative "lithic/models/transaction_simulate_credit_authorization_params"
345
- require_relative "lithic/models/transaction_simulate_credit_authorization_response"
346
344
  require_relative "lithic/models/transaction_simulate_return_params"
347
345
  require_relative "lithic/models/transaction_simulate_return_response"
348
346
  require_relative "lithic/models/transaction_simulate_return_reversal_params"
@@ -33,6 +33,9 @@ module Lithic
33
33
  sig { returns(T.nilable(Integer)) }
34
34
  attr_accessor :status
35
35
 
36
+ sig { returns(T.nilable(T::Hash[String, String])) }
37
+ attr_accessor :headers
38
+
36
39
  sig { returns(T.nilable(T.anything)) }
37
40
  attr_accessor :body
38
41
 
@@ -41,6 +44,7 @@ module Lithic
41
44
  params(
42
45
  url: URI::Generic,
43
46
  status: T.nilable(Integer),
47
+ headers: T.nilable(T::Hash[String, String]),
44
48
  body: T.nilable(Object),
45
49
  request: NilClass,
46
50
  response: NilClass,
@@ -50,6 +54,7 @@ module Lithic
50
54
  def self.new(
51
55
  url:,
52
56
  status: nil,
57
+ headers: nil,
53
58
  body: nil,
54
59
  request: nil,
55
60
  response: nil,
@@ -70,6 +75,7 @@ module Lithic
70
75
  params(
71
76
  url: URI::Generic,
72
77
  status: NilClass,
78
+ headers: T.nilable(T::Hash[String, String]),
73
79
  body: NilClass,
74
80
  request: NilClass,
75
81
  response: NilClass,
@@ -79,6 +85,7 @@ module Lithic
79
85
  def self.new(
80
86
  url:,
81
87
  status: nil,
88
+ headers: nil,
82
89
  body: nil,
83
90
  request: nil,
84
91
  response: nil,
@@ -93,6 +100,7 @@ module Lithic
93
100
  params(
94
101
  url: URI::Generic,
95
102
  status: NilClass,
103
+ headers: T.nilable(T::Hash[String, String]),
96
104
  body: NilClass,
97
105
  request: NilClass,
98
106
  response: NilClass,
@@ -102,6 +110,7 @@ module Lithic
102
110
  def self.new(
103
111
  url:,
104
112
  status: nil,
113
+ headers: nil,
105
114
  body: nil,
106
115
  request: nil,
107
116
  response: nil,
@@ -116,13 +125,22 @@ module Lithic
116
125
  params(
117
126
  url: URI::Generic,
118
127
  status: Integer,
128
+ headers: T.nilable(T::Hash[String, String]),
119
129
  body: T.nilable(Object),
120
130
  request: NilClass,
121
131
  response: NilClass,
122
132
  message: T.nilable(String)
123
133
  ).returns(T.attached_class)
124
134
  end
125
- def self.for(url:, status:, body:, request:, response:, message: nil)
135
+ def self.for(
136
+ url:,
137
+ status:,
138
+ headers:,
139
+ body:,
140
+ request:,
141
+ response:,
142
+ message: nil
143
+ )
126
144
  end
127
145
 
128
146
  sig { returns(Integer) }
@@ -133,13 +151,22 @@ module Lithic
133
151
  params(
134
152
  url: URI::Generic,
135
153
  status: Integer,
154
+ headers: T.nilable(T::Hash[String, String]),
136
155
  body: T.nilable(Object),
137
156
  request: NilClass,
138
157
  response: NilClass,
139
158
  message: T.nilable(String)
140
159
  ).returns(T.attached_class)
141
160
  end
142
- def self.new(url:, status:, body:, request:, response:, message: nil)
161
+ def self.new(
162
+ url:,
163
+ status:,
164
+ headers:,
165
+ body:,
166
+ request:,
167
+ response:,
168
+ message: nil
169
+ )
143
170
  end
144
171
  end
145
172
 
@@ -84,10 +84,9 @@ module Lithic
84
84
 
85
85
  # @api private
86
86
  sig do
87
- params(
88
- status: Integer,
89
- headers: T.any(T::Hash[String, String], Net::HTTPHeader)
90
- ).returns(T::Boolean)
87
+ params(status: Integer, headers: T::Hash[String, String]).returns(
88
+ T::Boolean
89
+ )
91
90
  end
92
91
  def should_retry?(status, headers:)
93
92
  end
@@ -97,7 +96,7 @@ module Lithic
97
96
  params(
98
97
  request: Lithic::Internal::Transport::BaseClient::RequestInput,
99
98
  status: Integer,
100
- response_headers: T.any(T::Hash[String, String], Net::HTTPHeader)
99
+ response_headers: T::Hash[String, String]
101
100
  ).returns(Lithic::Internal::Transport::BaseClient::RequestInput)
102
101
  end
103
102
  def follow_redirect(request, status:, response_headers:)
@@ -30,7 +30,7 @@ module Lithic
30
30
  params(
31
31
  client: Lithic::Internal::Transport::BaseClient,
32
32
  req: Lithic::Internal::Transport::BaseClient::RequestComponents,
33
- headers: T.any(T::Hash[String, String], Net::HTTPHeader),
33
+ headers: T::Hash[String, String],
34
34
  page_data: T.anything
35
35
  ).void
36
36
  end
@@ -361,7 +361,7 @@ module Lithic
361
361
  # Assumes each chunk in stream has `Encoding::BINARY`.
362
362
  sig do
363
363
  params(
364
- headers: T.any(T::Hash[String, String], Net::HTTPHeader),
364
+ headers: T::Hash[String, String],
365
365
  stream: T::Enumerable[String],
366
366
  suppress_error: T::Boolean
367
367
  ).returns(T.anything)
@@ -19,7 +19,8 @@ module Lithic
19
19
  attr_accessor :token
20
20
 
21
21
  # Amount (in cents) to void. Typically this will match the amount in the original
22
- # authorization, but can be less.
22
+ # authorization, but can be less. Applies to authorization reversals only. An
23
+ # authorization expiry will always apply to the full pending amount.
23
24
  sig { returns(T.nilable(Integer)) }
24
25
  attr_reader :amount
25
26
 
@@ -55,7 +56,8 @@ module Lithic
55
56
  # The transaction token returned from the /v1/simulate/authorize response.
56
57
  token:,
57
58
  # Amount (in cents) to void. Typically this will match the amount in the original
58
- # authorization, but can be less.
59
+ # authorization, but can be less. Applies to authorization reversals only. An
60
+ # authorization expiry will always apply to the full pending amount.
59
61
  amount: nil,
60
62
  # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`.
61
63
  #
@@ -370,9 +370,6 @@ module Lithic
370
370
  TransactionSimulateCreditAuthorizationAdviceParams =
371
371
  Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams
372
372
 
373
- TransactionSimulateCreditAuthorizationParams =
374
- Lithic::Models::TransactionSimulateCreditAuthorizationParams
375
-
376
373
  TransactionSimulateReturnParams =
377
374
  Lithic::Models::TransactionSimulateReturnParams
378
375
 
@@ -208,39 +208,6 @@ module Lithic
208
208
  )
209
209
  end
210
210
 
211
- # Simulates a credit authorization advice from the card network. This message
212
- # indicates that the network approved a credit authorization on your behalf.
213
- sig do
214
- params(
215
- amount: Integer,
216
- descriptor: String,
217
- pan: String,
218
- mcc: String,
219
- merchant_acceptor_id: String,
220
- request_options: Lithic::RequestOptions::OrHash
221
- ).returns(
222
- Lithic::Models::TransactionSimulateCreditAuthorizationResponse
223
- )
224
- end
225
- def simulate_credit_authorization(
226
- # Amount (in cents). Any value entered will be converted into a negative amount in
227
- # the simulated transaction. For example, entering 100 in this field will appear
228
- # as a -100 amount in the transaction.
229
- amount:,
230
- # Merchant descriptor.
231
- descriptor:,
232
- # Sixteen digit card number.
233
- pan:,
234
- # Merchant category code for the transaction to be simulated. A four-digit number
235
- # listed in ISO 18245. Supported merchant category codes can be found
236
- # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
237
- mcc: nil,
238
- # Unique identifier to identify the payment card acceptor.
239
- merchant_acceptor_id: nil,
240
- request_options: {}
241
- )
242
- end
243
-
244
211
  # Simulates a credit authorization advice from the card network. This message
245
212
  # indicates that the network approved a credit authorization on your behalf.
246
213
  sig do
@@ -328,7 +295,8 @@ module Lithic
328
295
  # The transaction token returned from the /v1/simulate/authorize response.
329
296
  token:,
330
297
  # Amount (in cents) to void. Typically this will match the amount in the original
331
- # authorization, but can be less.
298
+ # authorization, but can be less. Applies to authorization reversals only. An
299
+ # authorization expiry will always apply to the full pending amount.
332
300
  amount: nil,
333
301
  # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`.
334
302
  #
@@ -21,11 +21,14 @@ module Lithic
21
21
 
22
22
  attr_accessor status: Integer?
23
23
 
24
+ attr_accessor headers: ::Hash[String, String]?
25
+
24
26
  attr_accessor body: top?
25
27
 
26
28
  def initialize: (
27
29
  url: URI::Generic,
28
30
  ?status: Integer?,
31
+ ?headers: ::Hash[String, String]?,
29
32
  ?body: Object?,
30
33
  ?request: nil,
31
34
  ?response: nil,
@@ -37,6 +40,7 @@ module Lithic
37
40
  def initialize: (
38
41
  url: URI::Generic,
39
42
  ?status: nil,
43
+ ?headers: ::Hash[String, String]?,
40
44
  ?body: nil,
41
45
  ?request: nil,
42
46
  ?response: nil,
@@ -48,6 +52,7 @@ module Lithic
48
52
  def initialize: (
49
53
  url: URI::Generic,
50
54
  ?status: nil,
55
+ ?headers: ::Hash[String, String]?,
51
56
  ?body: nil,
52
57
  ?request: nil,
53
58
  ?response: nil,
@@ -59,6 +64,7 @@ module Lithic
59
64
  def self.for: (
60
65
  url: URI::Generic,
61
66
  status: Integer,
67
+ headers: ::Hash[String, String]?,
62
68
  body: Object?,
63
69
  request: nil,
64
70
  response: nil,
@@ -68,6 +74,7 @@ module Lithic
68
74
  def initialize: (
69
75
  url: URI::Generic,
70
76
  status: Integer,
77
+ headers: ::Hash[String, String]?,
71
78
  body: Object?,
72
79
  request: nil,
73
80
  response: nil,
@@ -335,8 +335,6 @@ module Lithic
335
335
 
336
336
  class TransactionSimulateCreditAuthorizationAdviceParams = Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams
337
337
 
338
- class TransactionSimulateCreditAuthorizationParams = Lithic::Models::TransactionSimulateCreditAuthorizationParams
339
-
340
338
  class TransactionSimulateReturnParams = Lithic::Models::TransactionSimulateReturnParams
341
339
 
342
340
  class TransactionSimulateReturnReversalParams = Lithic::Models::TransactionSimulateReturnReversalParams
@@ -54,15 +54,6 @@ module Lithic
54
54
  ?request_options: Lithic::request_opts
55
55
  ) -> Lithic::Models::TransactionSimulateClearingResponse
56
56
 
57
- def simulate_credit_authorization: (
58
- amount: Integer,
59
- descriptor: String,
60
- pan: String,
61
- ?mcc: String,
62
- ?merchant_acceptor_id: String,
63
- ?request_options: Lithic::request_opts
64
- ) -> Lithic::Models::TransactionSimulateCreditAuthorizationResponse
65
-
66
57
  def simulate_credit_authorization_advice: (
67
58
  amount: Integer,
68
59
  descriptor: String,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lithic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.alpha.43
4
+ version: 0.1.0.pre.alpha.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lithic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-11 00:00:00.000000000 Z
11
+ date: 2025-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -342,8 +342,6 @@ files:
342
342
  - lib/lithic/models/transaction_simulate_clearing_response.rb
343
343
  - lib/lithic/models/transaction_simulate_credit_authorization_advice_params.rb
344
344
  - lib/lithic/models/transaction_simulate_credit_authorization_advice_response.rb
345
- - lib/lithic/models/transaction_simulate_credit_authorization_params.rb
346
- - lib/lithic/models/transaction_simulate_credit_authorization_response.rb
347
345
  - lib/lithic/models/transaction_simulate_return_params.rb
348
346
  - lib/lithic/models/transaction_simulate_return_response.rb
349
347
  - lib/lithic/models/transaction_simulate_return_reversal_params.rb
@@ -720,8 +718,6 @@ files:
720
718
  - rbi/lithic/models/transaction_simulate_clearing_response.rbi
721
719
  - rbi/lithic/models/transaction_simulate_credit_authorization_advice_params.rbi
722
720
  - rbi/lithic/models/transaction_simulate_credit_authorization_advice_response.rbi
723
- - rbi/lithic/models/transaction_simulate_credit_authorization_params.rbi
724
- - rbi/lithic/models/transaction_simulate_credit_authorization_response.rbi
725
721
  - rbi/lithic/models/transaction_simulate_return_params.rbi
726
722
  - rbi/lithic/models/transaction_simulate_return_response.rbi
727
723
  - rbi/lithic/models/transaction_simulate_return_reversal_params.rbi
@@ -1097,8 +1093,6 @@ files:
1097
1093
  - sig/lithic/models/transaction_simulate_clearing_response.rbs
1098
1094
  - sig/lithic/models/transaction_simulate_credit_authorization_advice_params.rbs
1099
1095
  - sig/lithic/models/transaction_simulate_credit_authorization_advice_response.rbs
1100
- - sig/lithic/models/transaction_simulate_credit_authorization_params.rbs
1101
- - sig/lithic/models/transaction_simulate_credit_authorization_response.rbs
1102
1096
  - sig/lithic/models/transaction_simulate_return_params.rbs
1103
1097
  - sig/lithic/models/transaction_simulate_return_response.rbs
1104
1098
  - sig/lithic/models/transaction_simulate_return_reversal_params.rbs
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lithic
4
- module Models
5
- # @see Lithic::Resources::Transactions#simulate_credit_authorization
6
- class TransactionSimulateCreditAuthorizationParams < Lithic::Internal::Type::BaseModel
7
- extend Lithic::Internal::Type::RequestParameters::Converter
8
- include Lithic::Internal::Type::RequestParameters
9
-
10
- # @!attribute amount
11
- # Amount (in cents). Any value entered will be converted into a negative amount in
12
- # the simulated transaction. For example, entering 100 in this field will appear
13
- # as a -100 amount in the transaction.
14
- #
15
- # @return [Integer]
16
- required :amount, Integer
17
-
18
- # @!attribute descriptor
19
- # Merchant descriptor.
20
- #
21
- # @return [String]
22
- required :descriptor, String
23
-
24
- # @!attribute pan
25
- # Sixteen digit card number.
26
- #
27
- # @return [String]
28
- required :pan, String
29
-
30
- # @!attribute mcc
31
- # Merchant category code for the transaction to be simulated. A four-digit number
32
- # listed in ISO 18245. Supported merchant category codes can be found
33
- # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
34
- #
35
- # @return [String, nil]
36
- optional :mcc, String
37
-
38
- # @!attribute merchant_acceptor_id
39
- # Unique identifier to identify the payment card acceptor.
40
- #
41
- # @return [String, nil]
42
- optional :merchant_acceptor_id, String
43
-
44
- # @!method initialize(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {})
45
- # Some parameter documentations has been truncated, see
46
- # {Lithic::Models::TransactionSimulateCreditAuthorizationParams} for more details.
47
- #
48
- # @param amount [Integer] Amount (in cents). Any value entered will be converted into a negative amount in
49
- #
50
- # @param descriptor [String] Merchant descriptor.
51
- #
52
- # @param pan [String] Sixteen digit card number.
53
- #
54
- # @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number
55
- #
56
- # @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor.
57
- #
58
- # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}]
59
- end
60
- end
61
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lithic
4
- module Models
5
- # @see Lithic::Resources::Transactions#simulate_credit_authorization
6
- class TransactionSimulateCreditAuthorizationResponse < Lithic::Internal::Type::BaseModel
7
- # @!attribute token
8
- # A unique token to reference this transaction.
9
- #
10
- # @return [String, nil]
11
- optional :token, String
12
-
13
- # @!attribute debugging_request_id
14
- # Debugging request ID to share with Lithic Support team.
15
- #
16
- # @return [String, nil]
17
- optional :debugging_request_id, String
18
-
19
- # @!method initialize(token: nil, debugging_request_id: nil)
20
- # @param token [String] A unique token to reference this transaction.
21
- #
22
- # @param debugging_request_id [String] Debugging request ID to share with Lithic Support team.
23
- end
24
- end
25
- end
@@ -1,92 +0,0 @@
1
- # typed: strong
2
-
3
- module Lithic
4
- module Models
5
- class TransactionSimulateCreditAuthorizationParams < Lithic::Internal::Type::BaseModel
6
- extend Lithic::Internal::Type::RequestParameters::Converter
7
- include Lithic::Internal::Type::RequestParameters
8
-
9
- OrHash =
10
- T.type_alias do
11
- T.any(
12
- Lithic::TransactionSimulateCreditAuthorizationParams,
13
- Lithic::Internal::AnyHash
14
- )
15
- end
16
-
17
- # Amount (in cents). Any value entered will be converted into a negative amount in
18
- # the simulated transaction. For example, entering 100 in this field will appear
19
- # as a -100 amount in the transaction.
20
- sig { returns(Integer) }
21
- attr_accessor :amount
22
-
23
- # Merchant descriptor.
24
- sig { returns(String) }
25
- attr_accessor :descriptor
26
-
27
- # Sixteen digit card number.
28
- sig { returns(String) }
29
- attr_accessor :pan
30
-
31
- # Merchant category code for the transaction to be simulated. A four-digit number
32
- # listed in ISO 18245. Supported merchant category codes can be found
33
- # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
34
- sig { returns(T.nilable(String)) }
35
- attr_reader :mcc
36
-
37
- sig { params(mcc: String).void }
38
- attr_writer :mcc
39
-
40
- # Unique identifier to identify the payment card acceptor.
41
- sig { returns(T.nilable(String)) }
42
- attr_reader :merchant_acceptor_id
43
-
44
- sig { params(merchant_acceptor_id: String).void }
45
- attr_writer :merchant_acceptor_id
46
-
47
- sig do
48
- params(
49
- amount: Integer,
50
- descriptor: String,
51
- pan: String,
52
- mcc: String,
53
- merchant_acceptor_id: String,
54
- request_options: Lithic::RequestOptions::OrHash
55
- ).returns(T.attached_class)
56
- end
57
- def self.new(
58
- # Amount (in cents). Any value entered will be converted into a negative amount in
59
- # the simulated transaction. For example, entering 100 in this field will appear
60
- # as a -100 amount in the transaction.
61
- amount:,
62
- # Merchant descriptor.
63
- descriptor:,
64
- # Sixteen digit card number.
65
- pan:,
66
- # Merchant category code for the transaction to be simulated. A four-digit number
67
- # listed in ISO 18245. Supported merchant category codes can be found
68
- # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
69
- mcc: nil,
70
- # Unique identifier to identify the payment card acceptor.
71
- merchant_acceptor_id: nil,
72
- request_options: {}
73
- )
74
- end
75
-
76
- sig do
77
- override.returns(
78
- {
79
- amount: Integer,
80
- descriptor: String,
81
- pan: String,
82
- mcc: String,
83
- merchant_acceptor_id: String,
84
- request_options: Lithic::RequestOptions
85
- }
86
- )
87
- end
88
- def to_hash
89
- end
90
- end
91
- end
92
- end
@@ -1,46 +0,0 @@
1
- # typed: strong
2
-
3
- module Lithic
4
- module Models
5
- class TransactionSimulateCreditAuthorizationResponse < Lithic::Internal::Type::BaseModel
6
- OrHash =
7
- T.type_alias do
8
- T.any(
9
- Lithic::Models::TransactionSimulateCreditAuthorizationResponse,
10
- Lithic::Internal::AnyHash
11
- )
12
- end
13
-
14
- # A unique token to reference this transaction.
15
- sig { returns(T.nilable(String)) }
16
- attr_reader :token
17
-
18
- sig { params(token: String).void }
19
- attr_writer :token
20
-
21
- # Debugging request ID to share with Lithic Support team.
22
- sig { returns(T.nilable(String)) }
23
- attr_reader :debugging_request_id
24
-
25
- sig { params(debugging_request_id: String).void }
26
- attr_writer :debugging_request_id
27
-
28
- sig do
29
- params(token: String, debugging_request_id: String).returns(
30
- T.attached_class
31
- )
32
- end
33
- def self.new(
34
- # A unique token to reference this transaction.
35
- token: nil,
36
- # Debugging request ID to share with Lithic Support team.
37
- debugging_request_id: nil
38
- )
39
- end
40
-
41
- sig { override.returns({ token: String, debugging_request_id: String }) }
42
- def to_hash
43
- end
44
- end
45
- end
46
- end
@@ -1,50 +0,0 @@
1
- module Lithic
2
- module Models
3
- type transaction_simulate_credit_authorization_params =
4
- {
5
- amount: Integer,
6
- descriptor: String,
7
- pan: String,
8
- mcc: String,
9
- merchant_acceptor_id: String
10
- }
11
- & Lithic::Internal::Type::request_parameters
12
-
13
- class TransactionSimulateCreditAuthorizationParams < Lithic::Internal::Type::BaseModel
14
- extend Lithic::Internal::Type::RequestParameters::Converter
15
- include Lithic::Internal::Type::RequestParameters
16
-
17
- attr_accessor amount: Integer
18
-
19
- attr_accessor descriptor: String
20
-
21
- attr_accessor pan: String
22
-
23
- attr_reader mcc: String?
24
-
25
- def mcc=: (String) -> String
26
-
27
- attr_reader merchant_acceptor_id: String?
28
-
29
- def merchant_acceptor_id=: (String) -> String
30
-
31
- def initialize: (
32
- amount: Integer,
33
- descriptor: String,
34
- pan: String,
35
- ?mcc: String,
36
- ?merchant_acceptor_id: String,
37
- ?request_options: Lithic::request_opts
38
- ) -> void
39
-
40
- def to_hash: -> {
41
- amount: Integer,
42
- descriptor: String,
43
- pan: String,
44
- mcc: String,
45
- merchant_acceptor_id: String,
46
- request_options: Lithic::RequestOptions
47
- }
48
- end
49
- end
50
- end
@@ -1,20 +0,0 @@
1
- module Lithic
2
- module Models
3
- type transaction_simulate_credit_authorization_response =
4
- { token: String, debugging_request_id: String }
5
-
6
- class TransactionSimulateCreditAuthorizationResponse < Lithic::Internal::Type::BaseModel
7
- attr_reader token: String?
8
-
9
- def token=: (String) -> String
10
-
11
- attr_reader debugging_request_id: String?
12
-
13
- def debugging_request_id=: (String) -> String
14
-
15
- def initialize: (?token: String, ?debugging_request_id: String) -> void
16
-
17
- def to_hash: -> { token: String, debugging_request_id: String }
18
- end
19
- end
20
- end