lithic 0.9.0 → 0.11.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 (83) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +68 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/internal/util.rb +22 -7
  5. data/lib/lithic/models/account_holder_create_params.rb +2 -1
  6. data/lib/lithic/models/account_holder_update_params.rb +2 -1
  7. data/lib/lithic/models/account_holder_updated_webhook_event.rb +2 -1
  8. data/lib/lithic/models/auth_rules/backtest_stats.rb +9 -1
  9. data/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb +41 -0
  10. data/lib/lithic/models/auth_rules/report_stats.rb +46 -81
  11. data/lib/lithic/models/auth_rules/rule_feature.rb +1 -1
  12. data/lib/lithic/models/auth_rules/v2_list_results_response.rb +36 -4
  13. data/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb +4 -531
  14. data/lib/lithic/models/card_authorization_approval_request_webhook_event.rb +112 -30
  15. data/lib/lithic/models/card_bulk_order.rb +8 -3
  16. data/lib/lithic/models/card_bulk_order_create_params.rb +8 -3
  17. data/lib/lithic/models/card_convert_physical_params.rb +5 -3
  18. data/lib/lithic/models/card_create_params.rb +5 -3
  19. data/lib/lithic/models/card_reissue_params.rb +5 -3
  20. data/lib/lithic/models/card_renew_params.rb +5 -3
  21. data/lib/lithic/models/carrier.rb +7 -2
  22. data/lib/lithic/models/financial_account.rb +1 -0
  23. data/lib/lithic/models/financial_account_update_status_params.rb +1 -0
  24. data/lib/lithic/models/financial_accounts/statement.rb +11 -4
  25. data/lib/lithic/models/instance_financial_account_type.rb +1 -0
  26. data/lib/lithic/models/kyb.rb +2 -1
  27. data/lib/lithic/models/parsed_webhook_event.rb +2 -1
  28. data/lib/lithic/models/payment.rb +14 -1
  29. data/lib/lithic/models/payment_create_params.rb +13 -1
  30. data/lib/lithic/models/transaction.rb +93 -4
  31. data/lib/lithic/resources/card_bulk_orders.rb +10 -11
  32. data/lib/lithic/version.rb +1 -1
  33. data/lib/lithic.rb +1 -1
  34. data/rbi/lithic/internal/util.rbi +8 -0
  35. data/rbi/lithic/models/account_holder_create_params.rbi +4 -2
  36. data/rbi/lithic/models/account_holder_update_params.rbi +4 -2
  37. data/rbi/lithic/models/account_holder_updated_webhook_event.rbi +4 -2
  38. data/rbi/lithic/models/auth_rules/backtest_stats.rbi +11 -3
  39. data/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi +86 -0
  40. data/rbi/lithic/models/auth_rules/report_stats.rbi +73 -177
  41. data/rbi/lithic/models/auth_rules/rule_feature.rbi +1 -1
  42. data/rbi/lithic/models/auth_rules/v2_list_results_response.rbi +38 -6
  43. data/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi +3 -1721
  44. data/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi +194 -82
  45. data/rbi/lithic/models/card_bulk_order.rbi +21 -3
  46. data/rbi/lithic/models/card_bulk_order_create_params.rbi +21 -3
  47. data/rbi/lithic/models/card_convert_physical_params.rbi +8 -5
  48. data/rbi/lithic/models/card_create_params.rbi +8 -8
  49. data/rbi/lithic/models/card_reissue_params.rbi +8 -8
  50. data/rbi/lithic/models/card_renew_params.rbi +8 -8
  51. data/rbi/lithic/models/carrier.rbi +6 -2
  52. data/rbi/lithic/models/financial_account.rbi +5 -0
  53. data/rbi/lithic/models/financial_account_update_status_params.rbi +5 -0
  54. data/rbi/lithic/models/financial_accounts/statement.rbi +15 -6
  55. data/rbi/lithic/models/instance_financial_account_type.rbi +5 -0
  56. data/rbi/lithic/models/kyb.rbi +4 -2
  57. data/rbi/lithic/models/parsed_webhook_event.rbi +4 -2
  58. data/rbi/lithic/models/payment.rbi +10 -0
  59. data/rbi/lithic/models/payment_create_params.rbi +13 -3
  60. data/rbi/lithic/models/transaction.rbi +146 -4
  61. data/rbi/lithic/resources/card_bulk_orders.rbi +11 -11
  62. data/rbi/lithic/resources/cards.rbi +8 -4
  63. data/sig/lithic/internal/util.rbs +4 -0
  64. data/sig/lithic/models/auth_rules/backtest_stats.rbs +8 -3
  65. data/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs +14 -0
  66. data/sig/lithic/models/auth_rules/report_stats.rbs +34 -70
  67. data/sig/lithic/models/auth_rules/v2_list_results_response.rbs +29 -9
  68. data/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs +4 -667
  69. data/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs +89 -45
  70. data/sig/lithic/models/card_bulk_order.rbs +5 -1
  71. data/sig/lithic/models/card_bulk_order_create_params.rbs +5 -1
  72. data/sig/lithic/models/card_convert_physical_params.rbs +2 -2
  73. data/sig/lithic/models/card_create_params.rbs +2 -2
  74. data/sig/lithic/models/card_reissue_params.rbs +2 -2
  75. data/sig/lithic/models/card_renew_params.rbs +2 -2
  76. data/sig/lithic/models/financial_account.rbs +2 -0
  77. data/sig/lithic/models/financial_account_update_status_params.rbs +2 -0
  78. data/sig/lithic/models/financial_accounts/statement.rbs +16 -7
  79. data/sig/lithic/models/instance_financial_account_type.rbs +2 -0
  80. data/sig/lithic/models/payment.rbs +5 -0
  81. data/sig/lithic/models/payment_create_params.rbs +8 -3
  82. data/sig/lithic/models/transaction.rbs +75 -4
  83. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdfdaef84ba463bcef004c9ee56dffec28197c5be9c0ef5c0afc4fe5f5ff925e
4
- data.tar.gz: 987874852c6ee027d534ad085f842967c553a4d0bdd8ff7a9bec156d04f7cf0e
3
+ metadata.gz: 553b9c0f364c3ceda24f43c9070054640c640d3a64098de3b0ba14482cd5e3fa
4
+ data.tar.gz: 60d02df14fc6c2b57f8cbe950626641d8d97615c4739834e2ed0e6568e9a2160
5
5
  SHA512:
6
- metadata.gz: 377bec29bb9c975d6b9c005f94a7236c526a05df1bd9a39e2910b0d2408d0d95ff32f2356360a8af624c033350df8dbf35d9713f5d89ae08647017670262e16b
7
- data.tar.gz: 77ccfee6e72f7f0142ea103476a66adf2c5b3d74af6ff50ead53c9c2b4ebefe09a93966b42e0df1305266d5878d7f91eb73737a64d369f95559969d03cf0f9b7
6
+ metadata.gz: 49da4437a7eb8c6e4641e0317172d04d04894bf7d105ab6cfa09b9c841f87889610a5a70788477cf6395721fa377b621b451590428db5cb63ebcb21373535cf2
7
+ data.tar.gz: d727b8abf57c1facda792f2c410f64b1fbe055541c44c7d8002027e103704e1165042e185a1b01a1af55cda82ccbfaa16e3af844fea082ec9aed4001d4d24cf7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,73 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.0 (2026-04-13)
4
+
5
+ Full Changelog: [v0.10.0...v0.11.0](https://github.com/lithic-com/lithic-ruby/compare/v0.10.0...v0.11.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** add card decline count attributes to auth_rules conditional authorization ([d8d98d9](https://github.com/lithic-com/lithic-ruby/commit/d8d98d927f33b011b1a28c37df6b971ab7c895a0))
10
+ * **api:** add DELINQUENT substatus to financial account update status ([6a49f69](https://github.com/lithic-com/lithic-ruby/commit/6a49f690f00b7c261e22201aaac8521db124e4dc))
11
+ * **api:** add interchange/chargeback/provisional_credit_account to financial account type enums ([3d54444](https://github.com/lithic-com/lithic-ruby/commit/3d544442bb1ecfc4c69c806fb72cf8a1b0564c8d))
12
+ * **api:** add override_company_name field to payment create parameters ([7e916b6](https://github.com/lithic-com/lithic-ruby/commit/7e916b6bb6e41494aab381d5a30bb83f9ea6ca23))
13
+ * **api:** add statement_totals field to financial accounts statement ([1fa7586](https://github.com/lithic-com/lithic-ruby/commit/1fa758668e1caf7beefca72abe384c99d112ae85))
14
+ * **api:** add transaction_token field to auth_rules examples ([4729281](https://github.com/lithic-com/lithic-ruby/commit/47292818b9afc96e2ac358235012b4deb8987016))
15
+ * **api:** add transaction_token field to auth_rules v2 results response ([acca757](https://github.com/lithic-com/lithic-ruby/commit/acca757780ead14f428e035409c3b7cb815d9d83))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * align path encoding with RFC 3986 section 3.3 ([5624e72](https://github.com/lithic-com/lithic-ruby/commit/5624e7234a615d0de2ecc92e007be91a54a90c98))
21
+ * **internal:** correct multipart form field name encoding ([abfc1fd](https://github.com/lithic-com/lithic-ruby/commit/abfc1fdd7c78682932979e362448f95bca347d43))
22
+ * multipart encoding for file arrays ([5a0bdeb](https://github.com/lithic-com/lithic-ruby/commit/5a0bdeb87640bd6340039f86a366886894e9991a))
23
+ * **types:** [breaking] remove deprecated fields from auth_rules report_stats ([f3089b7](https://github.com/lithic-com/lithic-ruby/commit/f3089b7a510244d7c566bc69cc68d4564b899bec))
24
+ * **types:** make credit_product_token optional in financial_accounts statement ([a0fa401](https://github.com/lithic-com/lithic-ruby/commit/a0fa40166b98f3d7e91878d5ea948027c72ea440))
25
+ * **types:** remove INTERCHANGE/CHARGEBACK from FinancialAccount/InstanceFinancialAccountType ([6077d32](https://github.com/lithic-com/lithic-ruby/commit/6077d32ca7a8bc77204000d9c2e0cf7f28569c4b))
26
+ * **types:** require Card fields, remove hostname in authorization approval webhook ([fb4f7d9](https://github.com/lithic-com/lithic-ruby/commit/fb4f7d98735f400ca090a07b7fe59373e8eb9ef1))
27
+ * variable name typo ([0156ca5](https://github.com/lithic-com/lithic-ruby/commit/0156ca5e46b58cdfb25fdbcd293d16778e762c2a))
28
+
29
+
30
+ ### Chores
31
+
32
+ * **ci:** skip lint on metadata-only changes ([810ca31](https://github.com/lithic-com/lithic-ruby/commit/810ca31d3deeb0fd04c5843496dc601187076633))
33
+ * **ci:** support opting out of skipping builds on metadata-only commits ([40b20fb](https://github.com/lithic-com/lithic-ruby/commit/40b20fb0c3c2c31e2870ee2df86d4a55fac67a04))
34
+
35
+
36
+ ### Documentation
37
+
38
+ * **api:** update nature_of_business and qr_code_url field descriptions ([b11902d](https://github.com/lithic-com/lithic-ruby/commit/b11902d30b4b337e7ffc05358df51c18e6ea6648))
39
+ * improve examples ([a7a4a69](https://github.com/lithic-com/lithic-ruby/commit/a7a4a69c9c6930cb8fb3b6bfe4b10e32d1a49213))
40
+ * update examples ([985e1f5](https://github.com/lithic-com/lithic-ruby/commit/985e1f5f0e12517dce490224aaf82021875c8101))
41
+
42
+ ## 0.10.0 (2026-03-23)
43
+
44
+ Full Changelog: [v0.9.0...v0.10.0](https://github.com/lithic-com/lithic-ruby/compare/v0.9.0...v0.10.0)
45
+
46
+ ### Features
47
+
48
+ * **api:** Add CARD_AGE and ACCOUNT_AGE attributes to authorization rules ([b5bc545](https://github.com/lithic-com/lithic-ruby/commit/b5bc54552df7e04862780f15b0dc96d2732ad038))
49
+ * **api:** add override_company_name parameter to external payment create ([73612ab](https://github.com/lithic-com/lithic-ruby/commit/73612ab7a4e46f5572f7d12839acddb7beeb4b75))
50
+ * **api:** Add service and merchant location fields ([d0111e3](https://github.com/lithic-com/lithic-ruby/commit/d0111e33b4f6ca04b75f07440f3fc11e0406bbcd))
51
+
52
+
53
+ ### Chores
54
+
55
+ * **internal:** replace steady mock server with prism ([180a5d5](https://github.com/lithic-com/lithic-ruby/commit/180a5d5b2986fd1c32ea81bb3b036eb609c35e9a))
56
+ * **internal:** update gitignore ([eac11a4](https://github.com/lithic-com/lithic-ruby/commit/eac11a49332ba63990479fb14e171fcb09edab93))
57
+ * **tests:** bump steady to v0.19.4 ([ecee69a](https://github.com/lithic-com/lithic-ruby/commit/ecee69aa012a80f970784d78a9298db6155dd991))
58
+ * **tests:** bump steady to v0.19.5 ([8a046d1](https://github.com/lithic-com/lithic-ruby/commit/8a046d1ed8d6b7409244efb552809b28937ebed8))
59
+ * **tests:** bump steady to v0.19.6 ([5b45679](https://github.com/lithic-com/lithic-ruby/commit/5b45679d7f42fb122e2c7254a8568189cc8ae2c7))
60
+
61
+
62
+ ### Documentation
63
+
64
+ * Update field descriptions for character limits and allowlist requirements ([e999dc1](https://github.com/lithic-com/lithic-ruby/commit/e999dc1091255c9688545bb50e39ec62fcdad9fc))
65
+
66
+
67
+ ### Refactors
68
+
69
+ * **tests:** switch from prism to steady ([74cea9d](https://github.com/lithic-com/lithic-ruby/commit/74cea9d46211777e8e1de61ef24f52b0412564cd))
70
+
3
71
  ## 0.9.0 (2026-03-17)
4
72
 
5
73
  Full Changelog: [v0.8.0...v0.9.0](https://github.com/lithic-com/lithic-ruby/compare/v0.8.0...v0.9.0)
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "lithic", "~> 0.9.0"
27
+ gem "lithic", "~> 0.11.0"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -157,7 +157,7 @@ module Lithic
157
157
  in Hash | nil => coerced
158
158
  coerced
159
159
  else
160
- message = "Expected a #{Hash} or #{Lithic::Internal::Type::BaseModel}, got #{data.inspect}"
160
+ message = "Expected a #{Hash} or #{Lithic::Internal::Type::BaseModel}, got #{input.inspect}"
161
161
  raise ArgumentError.new(message)
162
162
  end
163
163
  end
@@ -237,6 +237,11 @@ module Lithic
237
237
  end
238
238
  end
239
239
 
240
+ # @type [Regexp]
241
+ #
242
+ # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
243
+ RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
244
+
240
245
  class << self
241
246
  # @api private
242
247
  #
@@ -247,6 +252,15 @@ module Lithic
247
252
  "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
248
253
  end
249
254
 
255
+ # @api private
256
+ #
257
+ # @param path [String, Integer]
258
+ #
259
+ # @return [String]
260
+ def encode_path(path)
261
+ path.to_s.gsub(Lithic::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
262
+ end
263
+
250
264
  # @api private
251
265
  #
252
266
  # @param path [String, Array<String>]
@@ -259,7 +273,7 @@ module Lithic
259
273
  in []
260
274
  ""
261
275
  in [String => p, *interpolations]
262
- encoded = interpolations.map { ERB::Util.url_encode(_1) }
276
+ encoded = interpolations.map { encode_path(_1) }
263
277
  format(p, *encoded)
264
278
  end
265
279
  end
@@ -571,16 +585,15 @@ module Lithic
571
585
  y << "Content-Disposition: form-data"
572
586
 
573
587
  unless key.nil?
574
- name = ERB::Util.url_encode(key.to_s)
575
- y << "; name=\"#{name}\""
588
+ y << "; name=\"#{key}\""
576
589
  end
577
590
 
578
591
  case val
579
592
  in Lithic::FilePart unless val.filename.nil?
580
- filename = ERB::Util.url_encode(val.filename)
593
+ filename = encode_path(val.filename)
581
594
  y << "; filename=\"#{filename}\""
582
595
  in Pathname | IO
583
- filename = ERB::Util.url_encode(::File.basename(val.to_path))
596
+ filename = encode_path(::File.basename(val.to_path))
584
597
  y << "; filename=\"#{filename}\""
585
598
  else
586
599
  end
@@ -597,6 +610,7 @@ module Lithic
597
610
  #
598
611
  # @return [Array(String, Enumerable<String>)]
599
612
  private def encode_multipart_streaming(body)
613
+ # rubocop:disable Style/CaseEquality
600
614
  # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
601
615
  boundary = SecureRandom.urlsafe_base64(46)
602
616
 
@@ -606,7 +620,7 @@ module Lithic
606
620
  in Hash
607
621
  body.each do |key, val|
608
622
  case val
609
- in Array if val.all? { primitive?(_1) }
623
+ in Array if val.all? { primitive?(_1) || Lithic::Internal::Type::FileInput === _1 }
610
624
  val.each do |v|
611
625
  write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
612
626
  end
@@ -622,6 +636,7 @@ module Lithic
622
636
 
623
637
  fused_io = fused_enum(strio) { closing.each(&:call) }
624
638
  [boundary, fused_io]
639
+ # rubocop:enable Style/CaseEquality
625
640
  end
626
641
 
627
642
  # @api private
@@ -75,7 +75,8 @@ module Lithic
75
75
 
76
76
  # @!attribute nature_of_business
77
77
  # Short description of the company's line of business (i.e., what does the company
78
- # do?).
78
+ # do?). Values longer than 255 characters will be truncated before KYB
79
+ # verification
79
80
  #
80
81
  # @return [String, nil]
81
82
  optional :nature_of_business, String
@@ -87,7 +87,8 @@ module Lithic
87
87
 
88
88
  # @!attribute nature_of_business
89
89
  # Short description of the company's line of business (i.e., what does the company
90
- # do?).
90
+ # do?). Values longer than 255 characters will be truncated before KYB
91
+ # verification
91
92
  #
92
93
  # @return [String, nil]
93
94
  optional :nature_of_business, String
@@ -50,7 +50,8 @@ module Lithic
50
50
 
51
51
  # @!attribute nature_of_business
52
52
  # Short description of the company's line of business (i.e., what does the company
53
- # do?).
53
+ # do?). Values longer than 255 characters will be truncated before KYB
54
+ # verification
54
55
  #
55
56
  # @return [String, nil]
56
57
  optional :nature_of_business, String
@@ -77,12 +77,20 @@ module Lithic
77
77
  # @return [Time, nil]
78
78
  optional :timestamp, Time
79
79
 
80
- # @!method initialize(decision: nil, event_token: nil, timestamp: nil)
80
+ # @!attribute transaction_token
81
+ # The token of the transaction associated with the event
82
+ #
83
+ # @return [String, nil]
84
+ optional :transaction_token, String, nil?: true
85
+
86
+ # @!method initialize(decision: nil, event_token: nil, timestamp: nil, transaction_token: nil)
81
87
  # @param decision [Symbol, Lithic::Models::AuthRules::BacktestStats::Example::Decision] The decision made by the rule for this event.
82
88
  #
83
89
  # @param event_token [String] The event token.
84
90
  #
85
91
  # @param timestamp [Time] The timestamp of the event.
92
+ #
93
+ # @param transaction_token [String, nil] The token of the transaction associated with the event
86
94
 
87
95
  # The decision made by the rule for this event.
88
96
  #
@@ -75,6 +75,12 @@ module Lithic
75
75
  # trailing hour up and until the authorization.
76
76
  # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
77
77
  # trailing 24 hours up and until the authorization.
78
+ # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in
79
+ # the trailing 15 minutes before the authorization.
80
+ # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in
81
+ # the trailing hour up and until the authorization.
82
+ # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in
83
+ # the trailing 24 hours up and until the authorization.
78
84
  # - `CARD_STATE`: The current state of the card associated with the transaction.
79
85
  # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
80
86
  # `PENDING_FULFILLMENT`.
@@ -90,6 +96,17 @@ module Lithic
90
96
  # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address
91
97
  # data with the cardholder KYC data if it exists. Valid values are `MATCH`,
92
98
  # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
99
+ # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the
100
+ # cardholder received the service, e.g. "NY". When a service location is present
101
+ # in the network data, the service location state is used. Otherwise, falls back
102
+ # to the card acceptor state.
103
+ # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received
104
+ # the service, e.g. "10001". When a service location is present in the network
105
+ # data, the service location postal code is used. Otherwise, falls back to the
106
+ # card acceptor postal code.
107
+ # - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
108
+ # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
109
+ # of the authorization.
93
110
  #
94
111
  # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute]
95
112
  required :attribute,
@@ -157,6 +174,12 @@ module Lithic
157
174
  # trailing hour up and until the authorization.
158
175
  # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
159
176
  # trailing 24 hours up and until the authorization.
177
+ # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in
178
+ # the trailing 15 minutes before the authorization.
179
+ # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in
180
+ # the trailing hour up and until the authorization.
181
+ # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in
182
+ # the trailing 24 hours up and until the authorization.
160
183
  # - `CARD_STATE`: The current state of the card associated with the transaction.
161
184
  # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
162
185
  # `PENDING_FULFILLMENT`.
@@ -172,6 +195,17 @@ module Lithic
172
195
  # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address
173
196
  # data with the cardholder KYC data if it exists. Valid values are `MATCH`,
174
197
  # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
198
+ # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the
199
+ # cardholder received the service, e.g. "NY". When a service location is present
200
+ # in the network data, the service location state is used. Otherwise, falls back
201
+ # to the card acceptor state.
202
+ # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received
203
+ # the service, e.g. "10001". When a service location is present in the network
204
+ # data, the service location postal code is used. Otherwise, falls back to the
205
+ # card acceptor postal code.
206
+ # - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
207
+ # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
208
+ # of the authorization.
175
209
  #
176
210
  # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#attribute
177
211
  module Attribute
@@ -190,12 +224,19 @@ module Lithic
190
224
  CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M
191
225
  CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H
192
226
  CARD_TRANSACTION_COUNT_24_H = :CARD_TRANSACTION_COUNT_24H
227
+ CARD_DECLINE_COUNT_15_M = :CARD_DECLINE_COUNT_15M
228
+ CARD_DECLINE_COUNT_1_H = :CARD_DECLINE_COUNT_1H
229
+ CARD_DECLINE_COUNT_24_H = :CARD_DECLINE_COUNT_24H
193
230
  CARD_STATE = :CARD_STATE
194
231
  PIN_ENTERED = :PIN_ENTERED
195
232
  PIN_STATUS = :PIN_STATUS
196
233
  WALLET_TYPE = :WALLET_TYPE
197
234
  TRANSACTION_INITIATOR = :TRANSACTION_INITIATOR
198
235
  ADDRESS_MATCH = :ADDRESS_MATCH
236
+ SERVICE_LOCATION_STATE = :SERVICE_LOCATION_STATE
237
+ SERVICE_LOCATION_POSTAL_CODE = :SERVICE_LOCATION_POSTAL_CODE
238
+ CARD_AGE = :CARD_AGE
239
+ ACCOUNT_AGE = :ACCOUNT_AGE
199
240
 
200
241
  # @!method self.values
201
242
  # @return [Array<Symbol>]
@@ -6,110 +6,77 @@ module Lithic
6
6
  class ReportStats < Lithic::Internal::Type::BaseModel
7
7
  # @!attribute action_counts
8
8
  # A mapping of action types to the number of times that action was returned by
9
- # this rule during the relevant period. Actions are the possible outcomes of a
9
+ # this version during the relevant period. Actions are the possible outcomes of a
10
10
  # rule evaluation, such as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule
11
11
  # didn't trigger any action, it's counted under NO_ACTION key.
12
12
  #
13
- # @return [Hash{Symbol=>Integer}, nil]
14
- optional :action_counts, Lithic::Internal::Type::HashOf[Integer]
13
+ # @return [Hash{Symbol=>Integer}]
14
+ required :action_counts, Lithic::Internal::Type::HashOf[Integer]
15
15
 
16
- # @!attribute approved
17
- # @deprecated
18
- #
19
- # The total number of historical transactions approved by this rule during the
20
- # relevant period, or the number of transactions that would have been approved if
21
- # the rule was evaluated in shadow mode.
22
- #
23
- # @return [Integer, nil]
24
- optional :approved, Integer
25
-
26
- # @!attribute challenged
27
- # @deprecated
28
- #
29
- # The total number of historical transactions challenged by this rule during the
30
- # relevant period, or the number of transactions that would have been challenged
31
- # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
32
- # Rules.
16
+ # @!attribute examples
17
+ # Example events and their outcomes for this version.
33
18
  #
34
- # @return [Integer, nil]
35
- optional :challenged, Integer
19
+ # @return [Array<Lithic::Models::AuthRules::ReportStats::Example>]
20
+ required :examples, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ReportStats::Example] }
36
21
 
37
- # @!attribute declined
38
- # @deprecated
39
- #
40
- # The total number of historical transactions declined by this rule during the
41
- # relevant period, or the number of transactions that would have been declined if
42
- # the rule was evaluated in shadow mode.
22
+ # @!attribute state
23
+ # The evaluation mode of this version during the reported period.
43
24
  #
44
- # @return [Integer, nil]
45
- optional :declined, Integer
25
+ # @return [Symbol, Lithic::Models::AuthRules::ReportStats::State]
26
+ required :state, enum: -> { Lithic::AuthRules::ReportStats::State }
46
27
 
47
- # @!attribute examples
48
- # Example events and their outcomes.
28
+ # @!attribute version
29
+ # The rule version number.
49
30
  #
50
- # @return [Array<Lithic::Models::AuthRules::ReportStats::Example>, nil]
51
- optional :examples, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ReportStats::Example] }
31
+ # @return [Integer]
32
+ required :version, Integer
52
33
 
53
- # @!method initialize(action_counts: nil, approved: nil, challenged: nil, declined: nil, examples: nil)
34
+ # @!method initialize(action_counts:, examples:, state:, version:)
54
35
  # Some parameter documentations has been truncated, see
55
36
  # {Lithic::Models::AuthRules::ReportStats} for more details.
56
37
  #
57
38
  # @param action_counts [Hash{Symbol=>Integer}] A mapping of action types to the number of times that action was returned by thi
58
39
  #
59
- # @param approved [Integer] The total number of historical transactions approved by this rule during the rel
60
- #
61
- # @param challenged [Integer] The total number of historical transactions challenged by this rule during the r
40
+ # @param examples [Array<Lithic::Models::AuthRules::ReportStats::Example>] Example events and their outcomes for this version.
62
41
  #
63
- # @param declined [Integer] The total number of historical transactions declined by this rule during the rel
42
+ # @param state [Symbol, Lithic::Models::AuthRules::ReportStats::State] The evaluation mode of this version during the reported period.
64
43
  #
65
- # @param examples [Array<Lithic::Models::AuthRules::ReportStats::Example>] Example events and their outcomes.
44
+ # @param version [Integer] The rule version number.
66
45
 
67
46
  class Example < Lithic::Internal::Type::BaseModel
68
47
  # @!attribute actions
69
- # The actions taken by the rule for this event.
48
+ # The actions taken by this version for this event.
70
49
  #
71
- # @return [Array<Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction, Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction>, nil]
72
- optional :actions,
50
+ # @return [Array<Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction, Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction>]
51
+ required :actions,
73
52
  -> { Lithic::Internal::Type::ArrayOf[union: Lithic::AuthRules::ReportStats::Example::Action] }
74
53
 
75
- # @!attribute approved
76
- # @deprecated
77
- #
78
- # Whether the rule would have approved the request.
79
- #
80
- # @return [Boolean, nil]
81
- optional :approved, Lithic::Internal::Type::Boolean
82
-
83
- # @!attribute decision
84
- # @deprecated
85
- #
86
- # The decision made by the rule for this event.
87
- #
88
- # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Decision, nil]
89
- optional :decision, enum: -> { Lithic::AuthRules::ReportStats::Example::Decision }
90
-
91
54
  # @!attribute event_token
92
55
  # The event token.
93
56
  #
94
- # @return [String, nil]
95
- optional :event_token, String
57
+ # @return [String]
58
+ required :event_token, String
96
59
 
97
60
  # @!attribute timestamp
98
61
  # The timestamp of the event.
99
62
  #
100
- # @return [Time, nil]
101
- optional :timestamp, Time
63
+ # @return [Time]
64
+ required :timestamp, Time
102
65
 
103
- # @!method initialize(actions: nil, approved: nil, decision: nil, event_token: nil, timestamp: nil)
104
- # @param actions [Array<Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction, Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction>] The actions taken by the rule for this event.
66
+ # @!attribute transaction_token
67
+ # The token of the transaction associated with the event
105
68
  #
106
- # @param approved [Boolean] Whether the rule would have approved the request.
107
- #
108
- # @param decision [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Decision] The decision made by the rule for this event.
69
+ # @return [String, nil]
70
+ optional :transaction_token, String, nil?: true
71
+
72
+ # @!method initialize(actions:, event_token:, timestamp:, transaction_token: nil)
73
+ # @param actions [Array<Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction, Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction>] The actions taken by this version for this event.
109
74
  #
110
75
  # @param event_token [String] The event token.
111
76
  #
112
77
  # @param timestamp [Time] The timestamp of the event.
78
+ #
79
+ # @param transaction_token [String, nil] The token of the transaction associated with the event
113
80
 
114
81
  module Action
115
82
  extend Lithic::Internal::Type::Union
@@ -529,22 +496,20 @@ module Lithic
529
496
  # @!method self.variants
530
497
  # @return [Array(Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction, Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction)]
531
498
  end
499
+ end
532
500
 
533
- # @deprecated
534
- #
535
- # The decision made by the rule for this event.
536
- #
537
- # @see Lithic::Models::AuthRules::ReportStats::Example#decision
538
- module Decision
539
- extend Lithic::Internal::Type::Enum
501
+ # The evaluation mode of this version during the reported period.
502
+ #
503
+ # @see Lithic::Models::AuthRules::ReportStats#state
504
+ module State
505
+ extend Lithic::Internal::Type::Enum
540
506
 
541
- APPROVED = :APPROVED
542
- DECLINED = :DECLINED
543
- CHALLENGED = :CHALLENGED
507
+ ACTIVE = :ACTIVE
508
+ SHADOW = :SHADOW
509
+ INACTIVE = :INACTIVE
544
510
 
545
- # @!method self.values
546
- # @return [Array<Symbol>]
547
- end
511
+ # @!method self.values
512
+ # @return [Array<Symbol>]
548
513
  end
549
514
  end
550
515
  end
@@ -18,7 +18,7 @@ module Lithic
18
18
  # - `CARD`: The card associated with the event. Available for AUTHORIZATION and
19
19
  # THREE_DS_AUTHENTICATION event stream rules.
20
20
  # - `ACCOUNT_HOLDER`: The account holder associated with the card. Available for
21
- # THREE_DS_AUTHENTICATION event stream rules.
21
+ # AUTHORIZATION and THREE_DS_AUTHENTICATION event stream rules.
22
22
  # - `IP_METADATA`: IP address metadata for the request. Available for
23
23
  # THREE_DS_AUTHENTICATION event stream rules.
24
24
  # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires
@@ -67,7 +67,13 @@ module Lithic
67
67
  # @return [Integer]
68
68
  required :rule_version, Integer
69
69
 
70
- # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, event_stream: :AUTHORIZATION)
70
+ # @!attribute transaction_token
71
+ # The token of the transaction that triggered the rule evaluation
72
+ #
73
+ # @return [String, nil]
74
+ required :transaction_token, String, nil?: true
75
+
76
+ # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :AUTHORIZATION)
71
77
  # @param token [String] Globally unique identifier for the evaluation
72
78
  #
73
79
  # @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization>] Actions returned by the rule evaluation
@@ -82,6 +88,8 @@ module Lithic
82
88
  #
83
89
  # @param rule_version [Integer] Version of the rule that was evaluated
84
90
  #
91
+ # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
92
+ #
85
93
  # @param event_stream [Symbol, :AUTHORIZATION] The event stream during which the rule was evaluated
86
94
 
87
95
  module Action
@@ -295,7 +303,13 @@ module Lithic
295
303
  # @return [Integer]
296
304
  required :rule_version, Integer
297
305
 
298
- # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, event_stream: :THREE_DS_AUTHENTICATION)
306
+ # @!attribute transaction_token
307
+ # The token of the transaction that triggered the rule evaluation
308
+ #
309
+ # @return [String, nil]
310
+ required :transaction_token, String, nil?: true
311
+
312
+ # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :THREE_DS_AUTHENTICATION)
299
313
  # @param token [String] Globally unique identifier for the evaluation
300
314
  #
301
315
  # @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action>] Actions returned by the rule evaluation
@@ -310,6 +324,8 @@ module Lithic
310
324
  #
311
325
  # @param rule_version [Integer] Version of the rule that was evaluated
312
326
  #
327
+ # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
328
+ #
313
329
  # @param event_stream [Symbol, :THREE_DS_AUTHENTICATION] The event stream during which the rule was evaluated
314
330
 
315
331
  class Action < Lithic::Internal::Type::BaseModel
@@ -406,7 +422,13 @@ module Lithic
406
422
  # @return [Integer]
407
423
  required :rule_version, Integer
408
424
 
409
- # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, event_stream: :TOKENIZATION)
425
+ # @!attribute transaction_token
426
+ # The token of the transaction that triggered the rule evaluation
427
+ #
428
+ # @return [String, nil]
429
+ required :transaction_token, String, nil?: true
430
+
431
+ # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :TOKENIZATION)
410
432
  # @param token [String] Globally unique identifier for the evaluation
411
433
  #
412
434
  # @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction>] Actions returned by the rule evaluation
@@ -421,6 +443,8 @@ module Lithic
421
443
  #
422
444
  # @param rule_version [Integer] Version of the rule that was evaluated
423
445
  #
446
+ # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
447
+ #
424
448
  # @param event_stream [Symbol, :TOKENIZATION] The event stream during which the rule was evaluated
425
449
 
426
450
  module Action
@@ -631,7 +655,13 @@ module Lithic
631
655
  # @return [Integer]
632
656
  required :rule_version, Integer
633
657
 
634
- # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_stream:, event_token:, mode:, rule_version:)
658
+ # @!attribute transaction_token
659
+ # The token of the transaction that triggered the rule evaluation
660
+ #
661
+ # @return [String, nil]
662
+ required :transaction_token, String, nil?: true
663
+
664
+ # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_stream:, event_token:, mode:, rule_version:, transaction_token:)
635
665
  # @param token [String] Globally unique identifier for the evaluation
636
666
  #
637
667
  # @param actions [Array<Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction>] Actions returned by the rule evaluation
@@ -647,6 +677,8 @@ module Lithic
647
677
  # @param mode [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode] The state of the Auth Rule
648
678
  #
649
679
  # @param rule_version [Integer] Version of the rule that was evaluated
680
+ #
681
+ # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation
650
682
 
651
683
  module Action
652
684
  extend Lithic::Internal::Type::Union