lithic 0.1.0.pre.alpha.36 → 0.1.0.pre.alpha.38

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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/internal/transport/base_client.rb +10 -2
  5. data/lib/lithic/models/auth_rules/conditional_3ds_action_parameters.rb +182 -0
  6. data/lib/lithic/models/auth_rules/merchant_lock_parameters.rb +62 -0
  7. data/lib/lithic/models/auth_rules/v2_apply_response.rb +12 -476
  8. data/lib/lithic/models/auth_rules/v2_create_params.rb +5 -245
  9. data/lib/lithic/models/auth_rules/v2_create_response.rb +12 -476
  10. data/lib/lithic/models/auth_rules/v2_draft_params.rb +5 -245
  11. data/lib/lithic/models/auth_rules/v2_draft_response.rb +12 -476
  12. data/lib/lithic/models/auth_rules/v2_list_response.rb +12 -476
  13. data/lib/lithic/models/auth_rules/v2_promote_response.rb +12 -476
  14. data/lib/lithic/models/auth_rules/v2_retrieve_response.rb +12 -480
  15. data/lib/lithic/models/auth_rules/v2_update_response.rb +12 -476
  16. data/lib/lithic/models/transaction.rb +19 -1
  17. data/lib/lithic/resources/auth_rules/v2.rb +2 -2
  18. data/lib/lithic/version.rb +1 -1
  19. data/lib/lithic.rb +2 -0
  20. data/rbi/lithic/models/auth_rules/conditional_3ds_action_parameters.rbi +412 -0
  21. data/rbi/lithic/models/auth_rules/merchant_lock_parameters.rbi +119 -0
  22. data/rbi/lithic/models/auth_rules/v2_apply_response.rbi +8 -1056
  23. data/rbi/lithic/models/auth_rules/v2_create_params.rbi +10 -534
  24. data/rbi/lithic/models/auth_rules/v2_create_response.rbi +8 -1056
  25. data/rbi/lithic/models/auth_rules/v2_draft_params.rbi +8 -532
  26. data/rbi/lithic/models/auth_rules/v2_draft_response.rbi +8 -1056
  27. data/rbi/lithic/models/auth_rules/v2_list_response.rbi +8 -1056
  28. data/rbi/lithic/models/auth_rules/v2_promote_response.rbi +8 -1056
  29. data/rbi/lithic/models/auth_rules/v2_retrieve_response.rbi +8 -1056
  30. data/rbi/lithic/models/auth_rules/v2_update_response.rbi +8 -1056
  31. data/rbi/lithic/models/transaction.rbi +47 -0
  32. data/rbi/lithic/resources/auth_rules/v2.rbi +4 -4
  33. data/sig/lithic/models/auth_rules/conditional_3ds_action_parameters.rbs +133 -0
  34. data/sig/lithic/models/auth_rules/merchant_lock_parameters.rbs +51 -0
  35. data/sig/lithic/models/auth_rules/v2_apply_response.rbs +4 -352
  36. data/sig/lithic/models/auth_rules/v2_create_params.rbs +2 -176
  37. data/sig/lithic/models/auth_rules/v2_create_response.rbs +4 -352
  38. data/sig/lithic/models/auth_rules/v2_draft_params.rbs +2 -176
  39. data/sig/lithic/models/auth_rules/v2_draft_response.rbs +4 -352
  40. data/sig/lithic/models/auth_rules/v2_list_response.rbs +4 -352
  41. data/sig/lithic/models/auth_rules/v2_promote_response.rbs +4 -352
  42. data/sig/lithic/models/auth_rules/v2_retrieve_response.rbs +4 -352
  43. data/sig/lithic/models/auth_rules/v2_update_response.rbs +4 -352
  44. data/sig/lithic/models/transaction.rbs +20 -0
  45. metadata +8 -2
@@ -0,0 +1,412 @@
1
+ # typed: strong
2
+
3
+ module Lithic
4
+ module Models
5
+ module AuthRules
6
+ class Conditional3DSActionParameters < Lithic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Lithic::AuthRules::Conditional3DSActionParameters,
11
+ Lithic::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The action to take if the conditions are met.
16
+ sig do
17
+ returns(
18
+ Lithic::AuthRules::Conditional3DSActionParameters::Action::OrSymbol
19
+ )
20
+ end
21
+ attr_accessor :action
22
+
23
+ sig do
24
+ returns(
25
+ T::Array[
26
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition
27
+ ]
28
+ )
29
+ end
30
+ attr_accessor :conditions
31
+
32
+ sig do
33
+ params(
34
+ action:
35
+ Lithic::AuthRules::Conditional3DSActionParameters::Action::OrSymbol,
36
+ conditions:
37
+ T::Array[
38
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::OrHash
39
+ ]
40
+ ).returns(T.attached_class)
41
+ end
42
+ def self.new(
43
+ # The action to take if the conditions are met.
44
+ action:,
45
+ conditions:
46
+ )
47
+ end
48
+
49
+ sig do
50
+ override.returns(
51
+ {
52
+ action:
53
+ Lithic::AuthRules::Conditional3DSActionParameters::Action::OrSymbol,
54
+ conditions:
55
+ T::Array[
56
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition
57
+ ]
58
+ }
59
+ )
60
+ end
61
+ def to_hash
62
+ end
63
+
64
+ # The action to take if the conditions are met.
65
+ module Action
66
+ extend Lithic::Internal::Type::Enum
67
+
68
+ TaggedSymbol =
69
+ T.type_alias do
70
+ T.all(
71
+ Symbol,
72
+ Lithic::AuthRules::Conditional3DSActionParameters::Action
73
+ )
74
+ end
75
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
76
+
77
+ DECLINE =
78
+ T.let(
79
+ :DECLINE,
80
+ Lithic::AuthRules::Conditional3DSActionParameters::Action::TaggedSymbol
81
+ )
82
+ CHALLENGE =
83
+ T.let(
84
+ :CHALLENGE,
85
+ Lithic::AuthRules::Conditional3DSActionParameters::Action::TaggedSymbol
86
+ )
87
+
88
+ sig do
89
+ override.returns(
90
+ T::Array[
91
+ Lithic::AuthRules::Conditional3DSActionParameters::Action::TaggedSymbol
92
+ ]
93
+ )
94
+ end
95
+ def self.values
96
+ end
97
+ end
98
+
99
+ class Condition < Lithic::Internal::Type::BaseModel
100
+ OrHash =
101
+ T.type_alias do
102
+ T.any(
103
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition,
104
+ Lithic::Internal::AnyHash
105
+ )
106
+ end
107
+
108
+ # The attribute to target.
109
+ #
110
+ # The following attributes may be targeted:
111
+ #
112
+ # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a
113
+ # business by the types of goods or services it provides.
114
+ # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all
115
+ # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for
116
+ # Netherlands Antilles.
117
+ # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of
118
+ # the transaction.
119
+ # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor
120
+ # (merchant).
121
+ # - `DESCRIPTOR`: Short description of card acceptor.
122
+ # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
123
+ # fee field in the settlement/cardholder billing currency. This is the amount
124
+ # the issuer should authorize against unless the issuer is paying the acquirer
125
+ # fee on behalf of the cardholder.
126
+ # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
127
+ # given authentication. Scores are on a range of 0-999, with 0 representing the
128
+ # lowest risk and 999 representing the highest risk. For Visa transactions,
129
+ # where the raw score has a range of 0-99, Lithic will normalize the score by
130
+ # multiplying the raw score by 10x.
131
+ # - `MESSAGE_CATEGORY`: The category of the authentication being processed.
132
+ sig do
133
+ returns(
134
+ T.nilable(
135
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::OrSymbol
136
+ )
137
+ )
138
+ end
139
+ attr_reader :attribute
140
+
141
+ sig do
142
+ params(
143
+ attribute:
144
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::OrSymbol
145
+ ).void
146
+ end
147
+ attr_writer :attribute
148
+
149
+ # The operation to apply to the attribute
150
+ sig do
151
+ returns(
152
+ T.nilable(
153
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::OrSymbol
154
+ )
155
+ )
156
+ end
157
+ attr_reader :operation
158
+
159
+ sig do
160
+ params(
161
+ operation:
162
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::OrSymbol
163
+ ).void
164
+ end
165
+ attr_writer :operation
166
+
167
+ # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
168
+ sig do
169
+ returns(
170
+ T.nilable(
171
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Value::Variants
172
+ )
173
+ )
174
+ end
175
+ attr_reader :value
176
+
177
+ sig do
178
+ params(
179
+ value:
180
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Value::Variants
181
+ ).void
182
+ end
183
+ attr_writer :value
184
+
185
+ sig do
186
+ params(
187
+ attribute:
188
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::OrSymbol,
189
+ operation:
190
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::OrSymbol,
191
+ value:
192
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Value::Variants
193
+ ).returns(T.attached_class)
194
+ end
195
+ def self.new(
196
+ # The attribute to target.
197
+ #
198
+ # The following attributes may be targeted:
199
+ #
200
+ # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a
201
+ # business by the types of goods or services it provides.
202
+ # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all
203
+ # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for
204
+ # Netherlands Antilles.
205
+ # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of
206
+ # the transaction.
207
+ # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor
208
+ # (merchant).
209
+ # - `DESCRIPTOR`: Short description of card acceptor.
210
+ # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
211
+ # fee field in the settlement/cardholder billing currency. This is the amount
212
+ # the issuer should authorize against unless the issuer is paying the acquirer
213
+ # fee on behalf of the cardholder.
214
+ # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
215
+ # given authentication. Scores are on a range of 0-999, with 0 representing the
216
+ # lowest risk and 999 representing the highest risk. For Visa transactions,
217
+ # where the raw score has a range of 0-99, Lithic will normalize the score by
218
+ # multiplying the raw score by 10x.
219
+ # - `MESSAGE_CATEGORY`: The category of the authentication being processed.
220
+ attribute: nil,
221
+ # The operation to apply to the attribute
222
+ operation: nil,
223
+ # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
224
+ value: nil
225
+ )
226
+ end
227
+
228
+ sig do
229
+ override.returns(
230
+ {
231
+ attribute:
232
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::OrSymbol,
233
+ operation:
234
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::OrSymbol,
235
+ value:
236
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Value::Variants
237
+ }
238
+ )
239
+ end
240
+ def to_hash
241
+ end
242
+
243
+ # The attribute to target.
244
+ #
245
+ # The following attributes may be targeted:
246
+ #
247
+ # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a
248
+ # business by the types of goods or services it provides.
249
+ # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all
250
+ # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for
251
+ # Netherlands Antilles.
252
+ # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of
253
+ # the transaction.
254
+ # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor
255
+ # (merchant).
256
+ # - `DESCRIPTOR`: Short description of card acceptor.
257
+ # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
258
+ # fee field in the settlement/cardholder billing currency. This is the amount
259
+ # the issuer should authorize against unless the issuer is paying the acquirer
260
+ # fee on behalf of the cardholder.
261
+ # - `RISK_SCORE`: Network-provided score assessing risk level associated with a
262
+ # given authentication. Scores are on a range of 0-999, with 0 representing the
263
+ # lowest risk and 999 representing the highest risk. For Visa transactions,
264
+ # where the raw score has a range of 0-99, Lithic will normalize the score by
265
+ # multiplying the raw score by 10x.
266
+ # - `MESSAGE_CATEGORY`: The category of the authentication being processed.
267
+ module Attribute
268
+ extend Lithic::Internal::Type::Enum
269
+
270
+ TaggedSymbol =
271
+ T.type_alias do
272
+ T.all(
273
+ Symbol,
274
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute
275
+ )
276
+ end
277
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
278
+
279
+ MCC =
280
+ T.let(
281
+ :MCC,
282
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol
283
+ )
284
+ COUNTRY =
285
+ T.let(
286
+ :COUNTRY,
287
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol
288
+ )
289
+ CURRENCY =
290
+ T.let(
291
+ :CURRENCY,
292
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol
293
+ )
294
+ MERCHANT_ID =
295
+ T.let(
296
+ :MERCHANT_ID,
297
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol
298
+ )
299
+ DESCRIPTOR =
300
+ T.let(
301
+ :DESCRIPTOR,
302
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol
303
+ )
304
+ TRANSACTION_AMOUNT =
305
+ T.let(
306
+ :TRANSACTION_AMOUNT,
307
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol
308
+ )
309
+ RISK_SCORE =
310
+ T.let(
311
+ :RISK_SCORE,
312
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol
313
+ )
314
+ MESSAGE_CATEGORY =
315
+ T.let(
316
+ :MESSAGE_CATEGORY,
317
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol
318
+ )
319
+
320
+ sig do
321
+ override.returns(
322
+ T::Array[
323
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol
324
+ ]
325
+ )
326
+ end
327
+ def self.values
328
+ end
329
+ end
330
+
331
+ # The operation to apply to the attribute
332
+ module Operation
333
+ extend Lithic::Internal::Type::Enum
334
+
335
+ TaggedSymbol =
336
+ T.type_alias do
337
+ T.all(
338
+ Symbol,
339
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation
340
+ )
341
+ end
342
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
343
+
344
+ IS_ONE_OF =
345
+ T.let(
346
+ :IS_ONE_OF,
347
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::TaggedSymbol
348
+ )
349
+ IS_NOT_ONE_OF =
350
+ T.let(
351
+ :IS_NOT_ONE_OF,
352
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::TaggedSymbol
353
+ )
354
+ MATCHES =
355
+ T.let(
356
+ :MATCHES,
357
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::TaggedSymbol
358
+ )
359
+ DOES_NOT_MATCH =
360
+ T.let(
361
+ :DOES_NOT_MATCH,
362
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::TaggedSymbol
363
+ )
364
+ IS_GREATER_THAN =
365
+ T.let(
366
+ :IS_GREATER_THAN,
367
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::TaggedSymbol
368
+ )
369
+ IS_LESS_THAN =
370
+ T.let(
371
+ :IS_LESS_THAN,
372
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::TaggedSymbol
373
+ )
374
+
375
+ sig do
376
+ override.returns(
377
+ T::Array[
378
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Operation::TaggedSymbol
379
+ ]
380
+ )
381
+ end
382
+ def self.values
383
+ end
384
+ end
385
+
386
+ # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
387
+ module Value
388
+ extend Lithic::Internal::Type::Union
389
+
390
+ Variants = T.type_alias { T.any(String, Integer, T::Array[String]) }
391
+
392
+ sig do
393
+ override.returns(
394
+ T::Array[
395
+ Lithic::AuthRules::Conditional3DSActionParameters::Condition::Value::Variants
396
+ ]
397
+ )
398
+ end
399
+ def self.variants
400
+ end
401
+
402
+ StringArray =
403
+ T.let(
404
+ Lithic::Internal::Type::ArrayOf[String],
405
+ Lithic::Internal::Type::Converter
406
+ )
407
+ end
408
+ end
409
+ end
410
+ end
411
+ end
412
+ end
@@ -0,0 +1,119 @@
1
+ # typed: strong
2
+
3
+ module Lithic
4
+ module Models
5
+ module AuthRules
6
+ class MerchantLockParameters < Lithic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Lithic::AuthRules::MerchantLockParameters,
11
+ Lithic::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # A list of merchant locks defining specific merchants or groups of merchants
16
+ # (based on descriptors or IDs) that the lock applies to.
17
+ sig do
18
+ returns(T::Array[Lithic::AuthRules::MerchantLockParameters::Merchant])
19
+ end
20
+ attr_accessor :merchants
21
+
22
+ sig do
23
+ params(
24
+ merchants:
25
+ T::Array[
26
+ Lithic::AuthRules::MerchantLockParameters::Merchant::OrHash
27
+ ]
28
+ ).returns(T.attached_class)
29
+ end
30
+ def self.new(
31
+ # A list of merchant locks defining specific merchants or groups of merchants
32
+ # (based on descriptors or IDs) that the lock applies to.
33
+ merchants:
34
+ )
35
+ end
36
+
37
+ sig do
38
+ override.returns(
39
+ {
40
+ merchants:
41
+ T::Array[Lithic::AuthRules::MerchantLockParameters::Merchant]
42
+ }
43
+ )
44
+ end
45
+ def to_hash
46
+ end
47
+
48
+ class Merchant < Lithic::Internal::Type::BaseModel
49
+ OrHash =
50
+ T.type_alias do
51
+ T.any(
52
+ Lithic::AuthRules::MerchantLockParameters::Merchant,
53
+ Lithic::Internal::AnyHash
54
+ )
55
+ end
56
+
57
+ # A comment or explanation about the merchant, used internally for rule management
58
+ # purposes.
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :comment
61
+
62
+ sig { params(comment: String).void }
63
+ attr_writer :comment
64
+
65
+ # Short description of the merchant, often used to provide more human-readable
66
+ # context about the transaction merchant. This is typically the name or label
67
+ # shown on transaction summaries.
68
+ sig { returns(T.nilable(String)) }
69
+ attr_reader :descriptor
70
+
71
+ sig { params(descriptor: String).void }
72
+ attr_writer :descriptor
73
+
74
+ # Unique alphanumeric identifier for the payment card acceptor (merchant). This
75
+ # attribute specifies the merchant entity that will be locked or referenced for
76
+ # authorization rules.
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :merchant_id
79
+
80
+ sig { params(merchant_id: String).void }
81
+ attr_writer :merchant_id
82
+
83
+ # Represents a specific merchant lock based on their ID or descriptor. Each
84
+ # merchant object allows transaction rules to work at a granular level and
85
+ # requires at least one of merchant_id or descriptor.
86
+ sig do
87
+ params(
88
+ comment: String,
89
+ descriptor: String,
90
+ merchant_id: String
91
+ ).returns(T.attached_class)
92
+ end
93
+ def self.new(
94
+ # A comment or explanation about the merchant, used internally for rule management
95
+ # purposes.
96
+ comment: nil,
97
+ # Short description of the merchant, often used to provide more human-readable
98
+ # context about the transaction merchant. This is typically the name or label
99
+ # shown on transaction summaries.
100
+ descriptor: nil,
101
+ # Unique alphanumeric identifier for the payment card acceptor (merchant). This
102
+ # attribute specifies the merchant entity that will be locked or referenced for
103
+ # authorization rules.
104
+ merchant_id: nil
105
+ )
106
+ end
107
+
108
+ sig do
109
+ override.returns(
110
+ { comment: String, descriptor: String, merchant_id: String }
111
+ )
112
+ end
113
+ def to_hash
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end