lithic 0.2.0 → 0.3.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 (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/client.rb +5 -10
  5. data/lib/lithic/internal/transport/pooled_net_requester.rb +12 -10
  6. data/lib/lithic/internal/util.rb +7 -2
  7. data/lib/lithic/models/auth_rules/conditional_tokenization_action_parameters.rb +5 -0
  8. data/lib/lithic/models/book_transfer_retry_params.rb +26 -0
  9. data/lib/lithic/models/{asa_request_webhook_event.rb → card_authorization_approval_request_webhook_event.rb} +151 -129
  10. data/lib/lithic/models/external_payment_create_params.rb +15 -1
  11. data/lib/lithic/models/financial_account.rb +33 -25
  12. data/lib/lithic/models/financial_account_update_status_params.rb +9 -1
  13. data/lib/lithic/models/financial_accounts/loan_tape.rb +52 -3
  14. data/lib/lithic/models/management_operation_create_params.rb +6 -1
  15. data/lib/lithic/models/parsed_webhook_event.rb +3 -4
  16. data/lib/lithic/models/payment.rb +10 -1
  17. data/lib/lithic/models/three_ds_authentication_approval_request_webhook_event.rb +17 -0
  18. data/lib/lithic/models/transaction.rb +2 -0
  19. data/lib/lithic/models/transfer_limit_list_params.rb +22 -0
  20. data/lib/lithic/models/transfer_limits_response.rb +274 -0
  21. data/lib/lithic/models.rb +12 -6
  22. data/lib/lithic/resources/book_transfers.rb +27 -0
  23. data/lib/lithic/resources/cards.rb +1 -5
  24. data/lib/lithic/resources/external_payments.rb +13 -1
  25. data/lib/lithic/resources/financial_accounts.rb +3 -1
  26. data/lib/lithic/resources/management_operations.rb +4 -1
  27. data/lib/lithic/resources/transfer_limits.rb +37 -0
  28. data/lib/lithic/resources/webhooks.rb +3 -2
  29. data/lib/lithic/version.rb +1 -1
  30. data/lib/lithic.rb +6 -7
  31. data/rbi/lithic/client.rbi +3 -3
  32. data/rbi/lithic/models/auth_rules/conditional_tokenization_action_parameters.rbi +11 -0
  33. data/rbi/lithic/models/book_transfer_retry_params.rbi +42 -0
  34. data/rbi/lithic/models/{asa_request_webhook_event.rbi → card_authorization_approval_request_webhook_event.rbi} +394 -256
  35. data/rbi/lithic/models/external_payment_create_params.rbi +4 -0
  36. data/rbi/lithic/models/financial_account.rbi +62 -54
  37. data/rbi/lithic/models/financial_account_update_status_params.rbi +11 -0
  38. data/rbi/lithic/models/financial_accounts/loan_tape.rbi +93 -4
  39. data/rbi/lithic/models/management_operation_create_params.rbi +4 -0
  40. data/rbi/lithic/models/parsed_webhook_event.rbi +2 -2
  41. data/rbi/lithic/models/payment.rbi +13 -3
  42. data/rbi/lithic/models/three_ds_authentication_approval_request_webhook_event.rbi +27 -0
  43. data/rbi/lithic/models/transaction.rbi +10 -0
  44. data/rbi/lithic/models/transfer_limit_list_params.rbi +43 -0
  45. data/rbi/lithic/models/transfer_limits_response.rbi +604 -0
  46. data/rbi/lithic/models.rbi +12 -6
  47. data/rbi/lithic/resources/book_transfers.rbi +18 -0
  48. data/rbi/lithic/resources/cards.rbi +1 -4
  49. data/rbi/lithic/resources/external_payments.rbi +2 -0
  50. data/rbi/lithic/resources/financial_accounts.rbi +3 -0
  51. data/rbi/lithic/resources/management_operations.rbi +2 -0
  52. data/rbi/lithic/resources/transfer_limits.rbi +28 -0
  53. data/rbi/lithic/resources/webhooks.rbi +2 -124
  54. data/sig/lithic/client.rbs +2 -2
  55. data/sig/lithic/models/auth_rules/conditional_tokenization_action_parameters.rbs +2 -0
  56. data/sig/lithic/models/book_transfer_retry_params.rbs +23 -0
  57. data/sig/lithic/models/{asa_request_webhook_event.rbs → card_authorization_approval_request_webhook_event.rbs} +161 -156
  58. data/sig/lithic/models/financial_account.rbs +32 -27
  59. data/sig/lithic/models/financial_account_update_status_params.rbs +8 -1
  60. data/sig/lithic/models/financial_accounts/loan_tape.rbs +46 -4
  61. data/sig/lithic/models/parsed_webhook_event.rbs +2 -2
  62. data/sig/lithic/models/payment.rbs +10 -3
  63. data/sig/lithic/models/three_ds_authentication_approval_request_webhook_event.rbs +22 -0
  64. data/sig/lithic/models/transaction.rbs +4 -0
  65. data/sig/lithic/models/transfer_limit_list_params.rbs +22 -0
  66. data/sig/lithic/models/transfer_limits_response.rbs +232 -0
  67. data/sig/lithic/models.rbs +10 -6
  68. data/sig/lithic/resources/book_transfers.rbs +6 -0
  69. data/sig/lithic/resources/cards.rbs +0 -2
  70. data/sig/lithic/resources/financial_accounts.rbs +1 -0
  71. data/sig/lithic/resources/transfer_limits.rbs +12 -0
  72. data/sig/lithic/resources/webhooks.rbs +2 -116
  73. metadata +20 -23
  74. data/lib/lithic/models/aggregate_balance.rb +0 -113
  75. data/lib/lithic/models/aggregate_balance_list_params.rb +0 -35
  76. data/lib/lithic/models/cards/aggregate_balance_list_params.rb +0 -32
  77. data/lib/lithic/models/cards/aggregate_balance_list_response.rb +0 -92
  78. data/lib/lithic/resources/aggregate_balances.rb +0 -38
  79. data/lib/lithic/resources/cards/aggregate_balances.rb +0 -41
  80. data/rbi/lithic/models/aggregate_balance.rbi +0 -164
  81. data/rbi/lithic/models/aggregate_balance_list_params.rbi +0 -104
  82. data/rbi/lithic/models/cards/aggregate_balance_list_params.rbi +0 -62
  83. data/rbi/lithic/models/cards/aggregate_balance_list_response.rbi +0 -115
  84. data/rbi/lithic/resources/aggregate_balances.rbi +0 -28
  85. data/rbi/lithic/resources/cards/aggregate_balances.rbi +0 -35
  86. data/sig/lithic/models/aggregate_balance.rbs +0 -78
  87. data/sig/lithic/models/aggregate_balance_list_params.rbs +0 -43
  88. data/sig/lithic/models/cards/aggregate_balance_list_params.rbs +0 -34
  89. data/sig/lithic/models/cards/aggregate_balance_list_response.rbs +0 -62
  90. data/sig/lithic/resources/aggregate_balances.rbs +0 -12
  91. data/sig/lithic/resources/cards/aggregate_balances.rbs +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8946d1c458ae277f59faee42210befe43f7ad248f2af24d1a96700ace4bffd5
4
- data.tar.gz: 7ec367fffbd069f955681d5b3e59328ae0714493739c8d7f6f0291ebfa13315f
3
+ metadata.gz: 607c23f73075c6665363abeb7aae1925309dc8e5bc76cd6f492889036f4f77cc
4
+ data.tar.gz: f0cf9f33257ee6a8eb3c846c4ddb666bd03fb48ef94ad3fb3e19578455cf4425
5
5
  SHA512:
6
- metadata.gz: f0ca88aa8c35a14f40e5387407acdf493491c40f5b100bef248632c2d55e5bf2c31bcf9a659f074319b4314a7560819da891a6d8ec58ce50fac2f1726d6997be
7
- data.tar.gz: 9a0d64b55815fd2ad4a7e414ba4864e3612f3107e17e2d93609978023d8904df2c7450bb40f8f86efad97e1e7c7b1741a7e6f0c25c03868726cbab89e23f2d6a
6
+ metadata.gz: ff94b4056b75ccf4e4edbe51d89ecf27efa049b4796a60896256546b85a21e9a82675acd5087e44812067137a83af10d702493d3c10cc73f151ff078ae85ff40
7
+ data.tar.gz: e83448bd2e8a575b45a2480ff492fe986abbb7e6175834333a305201c5e4ad8c5963f3a5186979b697131f60ab3b3069ba05a744285656b5503e79732dd7c51d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 (2026-01-08)
4
+
5
+ Full Changelog: [v0.2.0...v0.3.0](https://github.com/lithic-com/lithic-ruby/compare/v0.2.0...v0.3.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** Add card state attribute to tokenization rules ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
10
+ * **api:** Add event_type to ASA request and 3DS decisioning request ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
11
+ * **api:** add external_id to payment_event ([0bad1d9](https://github.com/lithic-com/lithic-ruby/commit/0bad1d9ef7b439a1be19b68af67abb6e66e5c53f))
12
+ * **api:** add get /v1/transfer_limits endpoint ([0bad1d9](https://github.com/lithic-com/lithic-ruby/commit/0bad1d9ef7b439a1be19b68af67abb6e66e5c53f))
13
+ * **api:** add post /v1/book_transfers/{book_transfer_token}/retry endpoint ([0bad1d9](https://github.com/lithic-com/lithic-ruby/commit/0bad1d9ef7b439a1be19b68af67abb6e66e5c53f))
14
+ * **api:** Add user defined status to ledger accounts ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
15
+ * **api:** add WIRE_DRAWDOWN_REQUEST transfer type ([832895f](https://github.com/lithic-com/lithic-ruby/commit/832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14))
16
+ * **api:** Expose Payment Allocation Details ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
17
+ * **api:** remove unnecessary X-Lithic-Pagination header ([832895f](https://github.com/lithic-com/lithic-ruby/commit/832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14))
18
+ * **api:** remove v1/aggregate_balances and related models ([c66d75e](https://github.com/lithic-com/lithic-ruby/commit/c66d75ed7b10521d5f73efeafb9dbcd6ff7a7f0c))
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * calling `break` out of streams should be instantaneous ([86db080](https://github.com/lithic-com/lithic-ruby/commit/86db080240382ba1cd73af9a01c89379cfb8e330))
24
+ * issue where json.parse errors when receiving HTTP 204 with nobody ([9c9d63b](https://github.com/lithic-com/lithic-ruby/commit/9c9d63b07badd9fdd107314ac0bd5c8c23ddd0c3))
25
+
26
+
27
+ ### Chores
28
+
29
+ * formatting ([e736094](https://github.com/lithic-com/lithic-ruby/commit/e736094a8bcf11007a6ea2666cfc6a646aca6972))
30
+ * **internal:** codegen related update ([6bacc68](https://github.com/lithic-com/lithic-ruby/commit/6bacc684b578951ece05155697ec0b68c2d8d4e0))
31
+ * Simplify custom code ([67dc77a](https://github.com/lithic-com/lithic-ruby/commit/67dc77a78348d9d910cca58ffba483992b738f30))
32
+ * Simplify custom code - same for rbs file ([3438ceb](https://github.com/lithic-com/lithic-ruby/commit/3438cebfd4899c87d06a2bc42d4a76af709ea21f))
33
+ * update code formatting ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
34
+
35
+
36
+ ### Documentation
37
+
38
+ * **api:** clarify description of token / retry_token when it serves as idempotency key ([832895f](https://github.com/lithic-com/lithic-ruby/commit/832895fdf5d4e72f9fc1ce62e9acfb6bcbdfdc14))
39
+ * Update language for Google Web Push Provisioning docs ([24f042b](https://github.com/lithic-com/lithic-ruby/commit/24f042b70a1b3b6f30639fe6d04dbc7d566ea187))
40
+
3
41
  ## 0.2.0 (2025-12-10)
4
42
 
5
43
  Full Changelog: [v0.1.0...v0.2.0](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0...v0.2.0)
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.2.0"
18
+ gem "lithic", "~> 0.3.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
data/lib/lithic/client.rb CHANGED
@@ -50,9 +50,6 @@ module Lithic
50
50
  # @return [Lithic::Resources::Balances]
51
51
  attr_reader :balances
52
52
 
53
- # @return [Lithic::Resources::AggregateBalances]
54
- attr_reader :aggregate_balances
55
-
56
53
  # @return [Lithic::Resources::Disputes]
57
54
  attr_reader :disputes
58
55
 
@@ -119,6 +116,9 @@ module Lithic
119
116
  # @return [Lithic::Resources::AccountActivity]
120
117
  attr_reader :account_activity
121
118
 
119
+ # @return [Lithic::Resources::TransferLimits]
120
+ attr_reader :transfer_limits
121
+
122
122
  # @return [Lithic::Resources::Webhooks]
123
123
  attr_reader :webhooks
124
124
 
@@ -181,10 +181,6 @@ module Lithic
181
181
  raise ArgumentError.new("api_key is required, and can be set via environ: \"LITHIC_API_KEY\"")
182
182
  end
183
183
 
184
- headers = {
185
- "x-lithic-pagination" => "cursor"
186
- }
187
-
188
184
  @api_key = api_key.to_s
189
185
 
190
186
  super(
@@ -192,8 +188,7 @@ module Lithic
192
188
  timeout: timeout,
193
189
  max_retries: max_retries,
194
190
  initial_retry_delay: initial_retry_delay,
195
- max_retry_delay: max_retry_delay,
196
- headers: headers
191
+ max_retry_delay: max_retry_delay
197
192
  )
198
193
 
199
194
  @accounts = Lithic::Resources::Accounts.new(client: self)
@@ -205,7 +200,6 @@ module Lithic
205
200
  @cards = Lithic::Resources::Cards.new(client: self)
206
201
  @card_bulk_orders = Lithic::Resources::CardBulkOrders.new(client: self)
207
202
  @balances = Lithic::Resources::Balances.new(client: self)
208
- @aggregate_balances = Lithic::Resources::AggregateBalances.new(client: self)
209
203
  @disputes = Lithic::Resources::Disputes.new(client: self)
210
204
  @disputes_v2 = Lithic::Resources::DisputesV2.new(client: self)
211
205
  @events = Lithic::Resources::Events.new(client: self)
@@ -228,6 +222,7 @@ module Lithic
228
222
  @fraud = Lithic::Resources::Fraud.new(client: self)
229
223
  @network_programs = Lithic::Resources::NetworkPrograms.new(client: self)
230
224
  @account_activity = Lithic::Resources::AccountActivity.new(client: self)
225
+ @transfer_limits = Lithic::Resources::TransferLimits.new(client: self)
231
226
  @webhooks = Lithic::Resources::Webhooks.new(client: self)
232
227
  end
233
228
  end
@@ -153,17 +153,19 @@ module Lithic
153
153
  end
154
154
 
155
155
  self.class.calibrate_socket_timeout(conn, deadline)
156
- conn.request(req) do |rsp|
157
- y << [req, rsp]
158
- break if finished
159
-
160
- rsp.read_body do |bytes|
161
- y << bytes.force_encoding(Encoding::BINARY)
162
- break if finished
163
-
164
- self.class.calibrate_socket_timeout(conn, deadline)
156
+ ::Kernel.catch(:jump) do
157
+ conn.request(req) do |rsp|
158
+ y << [req, rsp]
159
+ ::Kernel.throw(:jump) if finished
160
+
161
+ rsp.read_body do |bytes|
162
+ y << bytes.force_encoding(Encoding::BINARY)
163
+ ::Kernel.throw(:jump) if finished
164
+
165
+ self.class.calibrate_socket_timeout(conn, deadline)
166
+ end
167
+ eof = true
165
168
  end
166
- eof = true
167
169
  end
168
170
  end
169
171
  ensure
@@ -657,7 +657,8 @@ module Lithic
657
657
  def decode_content(headers, stream:, suppress_error: false)
658
658
  case (content_type = headers["content-type"])
659
659
  in Lithic::Internal::Util::JSON_CONTENT
660
- json = stream.to_a.join
660
+ return nil if (json = stream.to_a.join).empty?
661
+
661
662
  begin
662
663
  JSON.parse(json, symbolize_names: true)
663
664
  rescue JSON::ParserError => e
@@ -667,7 +668,11 @@ module Lithic
667
668
  in Lithic::Internal::Util::JSONL_CONTENT
668
669
  lines = decode_lines(stream)
669
670
  chain_fused(lines) do |y|
670
- lines.each { y << JSON.parse(_1, symbolize_names: true) }
671
+ lines.each do
672
+ next if _1.empty?
673
+
674
+ y << JSON.parse(_1, symbolize_names: true)
675
+ end
671
676
  end
672
677
  in %r{^text/event-stream}
673
678
  lines = decode_lines(stream)
@@ -185,6 +185,8 @@ module Lithic
185
185
  # `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS`.
186
186
  # - `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token.
187
187
  # - `WALLET_TOKEN_STATUS`: The current status of the wallet token.
188
+ # - `CARD_STATE`: The state of the card being tokenized. Valid values are
189
+ # `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`.
188
190
  #
189
191
  # @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute]
190
192
  required :attribute,
@@ -245,6 +247,8 @@ module Lithic
245
247
  # `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS`.
246
248
  # - `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token.
247
249
  # - `WALLET_TOKEN_STATUS`: The current status of the wallet token.
250
+ # - `CARD_STATE`: The state of the card being tokenized. Valid values are
251
+ # `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`.
248
252
  #
249
253
  # @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition#attribute
250
254
  module Attribute
@@ -260,6 +264,7 @@ module Lithic
260
264
  WALLET_RECOMMENDATION_REASONS = :WALLET_RECOMMENDATION_REASONS
261
265
  TOKEN_REQUESTOR_ID = :TOKEN_REQUESTOR_ID
262
266
  WALLET_TOKEN_STATUS = :WALLET_TOKEN_STATUS
267
+ CARD_STATE = :CARD_STATE
263
268
 
264
269
  # @!method self.values
265
270
  # @return [Array<Symbol>]
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lithic
4
+ module Models
5
+ # @see Lithic::Resources::BookTransfers#retry_
6
+ class BookTransferRetryParams < Lithic::Internal::Type::BaseModel
7
+ extend Lithic::Internal::Type::RequestParameters::Converter
8
+ include Lithic::Internal::Type::RequestParameters
9
+
10
+ # @!attribute retry_token
11
+ # Customer-provided token that will serve as an idempotency token. This token will
12
+ # become the transaction token.
13
+ #
14
+ # @return [String]
15
+ required :retry_token, String
16
+
17
+ # @!method initialize(retry_token:, request_options: {})
18
+ # Some parameter documentations has been truncated, see
19
+ # {Lithic::Models::BookTransferRetryParams} for more details.
20
+ #
21
+ # @param retry_token [String] Customer-provided token that will serve as an idempotency token. This token will
22
+ #
23
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}]
24
+ end
25
+ end
26
+ end