lithic 0.1.0.pre.alpha.33 → 0.1.0.pre.alpha.35

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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/client.rb +4 -0
  5. data/lib/lithic/models/auth_rules/rule_stats.rb +112 -0
  6. data/lib/lithic/models/auth_rules/v2/backtest_results.rb +6 -238
  7. data/lib/lithic/models/auth_rules/v2_retrieve_report_params.rb +32 -0
  8. data/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb +71 -0
  9. data/lib/lithic/models/card_convert_physical_params.rb +10 -6
  10. data/lib/lithic/models/card_create_params.rb +10 -6
  11. data/lib/lithic/models/card_reissue_params.rb +10 -6
  12. data/lib/lithic/models/card_renew_params.rb +10 -6
  13. data/lib/lithic/models/external_bank_account_create_params.rb +1 -1
  14. data/lib/lithic/models/financial_accounts/statements/statement_line_items.rb +1 -0
  15. data/lib/lithic/models/financial_transaction.rb +1 -0
  16. data/lib/lithic/models/fraud/transaction_report_params.rb +130 -0
  17. data/lib/lithic/models/fraud/transaction_report_response.rb +160 -0
  18. data/lib/lithic/models/fraud/transaction_retrieve_params.rb +16 -0
  19. data/lib/lithic/models/fraud/transaction_retrieve_response.rb +160 -0
  20. data/lib/lithic/models/non_pci_card.rb +16 -21
  21. data/lib/lithic/models/payment.rb +7 -1
  22. data/lib/lithic/models/payment_create_params.rb +7 -1
  23. data/lib/lithic/models/three_ds/authentication_retrieve_response.rb +111 -79
  24. data/lib/lithic/models/three_ds/authentication_simulate_params.rb +8 -2
  25. data/lib/lithic/models/three_ds/authentication_simulate_response.rb +2 -6
  26. data/lib/lithic/models/three_ds/challenge_response.rb +7 -7
  27. data/lib/lithic/models/three_ds/challenge_result.rb +1 -1
  28. data/lib/lithic/models/transfer.rb +1 -0
  29. data/lib/lithic/models.rb +2 -0
  30. data/lib/lithic/resources/auth_rules/v2/backtests.rb +8 -7
  31. data/lib/lithic/resources/auth_rules/v2.rb +45 -4
  32. data/lib/lithic/resources/fraud/transactions.rb +69 -0
  33. data/lib/lithic/resources/fraud.rb +18 -0
  34. data/lib/lithic/resources/three_ds/authentication.rb +6 -6
  35. data/lib/lithic/resources/three_ds/decisioning.rb +8 -3
  36. data/lib/lithic/version.rb +1 -1
  37. data/lib/lithic.rb +9 -0
  38. data/rbi/lithic/client.rbi +3 -0
  39. data/rbi/lithic/models/auth_rules/rule_stats.rbi +229 -0
  40. data/rbi/lithic/models/auth_rules/v2/backtest_results.rbi +8 -523
  41. data/rbi/lithic/models/auth_rules/v2_retrieve_report_params.rbi +56 -0
  42. data/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi +149 -0
  43. data/rbi/lithic/models/card_convert_physical_params.rbi +15 -9
  44. data/rbi/lithic/models/card_create_params.rbi +15 -9
  45. data/rbi/lithic/models/card_reissue_params.rbi +15 -9
  46. data/rbi/lithic/models/card_renew_params.rbi +15 -9
  47. data/rbi/lithic/models/external_bank_account_create_params.rbi +2 -2
  48. data/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi +5 -0
  49. data/rbi/lithic/models/financial_transaction.rbi +5 -0
  50. data/rbi/lithic/models/fraud/transaction_report_params.rbi +263 -0
  51. data/rbi/lithic/models/fraud/transaction_report_response.rbi +309 -0
  52. data/rbi/lithic/models/fraud/transaction_retrieve_params.rbi +32 -0
  53. data/rbi/lithic/models/fraud/transaction_retrieve_response.rbi +309 -0
  54. data/rbi/lithic/models/non_pci_card.rbi +27 -38
  55. data/rbi/lithic/models/payment.rbi +9 -3
  56. data/rbi/lithic/models/payment_create_params.rbi +8 -3
  57. data/rbi/lithic/models/three_ds/authentication_retrieve_response.rbi +171 -108
  58. data/rbi/lithic/models/three_ds/authentication_simulate_params.rbi +6 -0
  59. data/rbi/lithic/models/three_ds/authentication_simulate_response.rbi +2 -4
  60. data/rbi/lithic/models/three_ds/challenge_response.rbi +7 -10
  61. data/rbi/lithic/models/three_ds/challenge_result.rbi +1 -1
  62. data/rbi/lithic/models/transfer.rbi +2 -0
  63. data/rbi/lithic/models.rbi +2 -0
  64. data/rbi/lithic/resources/auth_rules/v2/backtests.rbi +8 -7
  65. data/rbi/lithic/resources/auth_rules/v2.rbi +37 -4
  66. data/rbi/lithic/resources/cards.rbi +20 -12
  67. data/rbi/lithic/resources/fraud/transactions.rbi +86 -0
  68. data/rbi/lithic/resources/fraud.rbi +15 -0
  69. data/rbi/lithic/resources/three_ds/authentication.rbi +6 -4
  70. data/rbi/lithic/resources/three_ds/decisioning.rbi +9 -6
  71. data/sig/lithic/client.rbs +2 -0
  72. data/sig/lithic/models/auth_rules/rule_stats.rbs +108 -0
  73. data/sig/lithic/models/auth_rules/v2/backtest_results.rbs +8 -214
  74. data/sig/lithic/models/auth_rules/v2_retrieve_report_params.rbs +30 -0
  75. data/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs +64 -0
  76. data/sig/lithic/models/external_bank_account_create_params.rbs +2 -2
  77. data/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs +2 -0
  78. data/sig/lithic/models/financial_transaction.rbs +2 -0
  79. data/sig/lithic/models/fraud/transaction_report_params.rbs +75 -0
  80. data/sig/lithic/models/fraud/transaction_report_response.rbs +90 -0
  81. data/sig/lithic/models/fraud/transaction_retrieve_params.rbs +17 -0
  82. data/sig/lithic/models/fraud/transaction_retrieve_response.rbs +90 -0
  83. data/sig/lithic/models/non_pci_card.rbs +4 -19
  84. data/sig/lithic/models/payment.rbs +8 -3
  85. data/sig/lithic/models/payment_create_params.rbs +8 -3
  86. data/sig/lithic/models/three_ds/authentication_retrieve_response.rbs +19 -20
  87. data/sig/lithic/models/transfer.rbs +2 -0
  88. data/sig/lithic/models.rbs +2 -0
  89. data/sig/lithic/resources/auth_rules/v2.rbs +7 -0
  90. data/sig/lithic/resources/fraud/transactions.rbs +22 -0
  91. data/sig/lithic/resources/fraud.rbs +9 -0
  92. metadata +29 -2
@@ -9,6 +9,7 @@ module Lithic
9
9
  include Lithic::Internal::Type::RequestParameters
10
10
 
11
11
  # @!attribute merchant
12
+ # Merchant information for the simulated transaction
12
13
  #
13
14
  # @return [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant]
14
15
  required :merchant, -> { Lithic::ThreeDS::AuthenticationSimulateParams::Merchant }
@@ -20,6 +21,7 @@ module Lithic
20
21
  required :pan, String
21
22
 
22
23
  # @!attribute transaction
24
+ # Transaction details for the simulation
23
25
  #
24
26
  # @return [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction]
25
27
  required :transaction, -> { Lithic::ThreeDS::AuthenticationSimulateParams::Transaction }
@@ -38,11 +40,11 @@ module Lithic
38
40
  # Some parameter documentations has been truncated, see
39
41
  # {Lithic::Models::ThreeDS::AuthenticationSimulateParams} for more details.
40
42
  #
41
- # @param merchant [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant]
43
+ # @param merchant [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant] Merchant information for the simulated transaction
42
44
  #
43
45
  # @param pan [String] Sixteen digit card number.
44
46
  #
45
- # @param transaction [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction]
47
+ # @param transaction [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction] Transaction details for the simulation
46
48
  #
47
49
  # @param card_expiry_check [Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck] When set will use the following values as part of the Simulated Authentication.
48
50
  #
@@ -83,6 +85,8 @@ module Lithic
83
85
  # {Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant} for more
84
86
  # details.
85
87
  #
88
+ # Merchant information for the simulated transaction
89
+ #
86
90
  # @param id [String] Unique identifier to identify the payment card acceptor. Corresponds to `merchan
87
91
  #
88
92
  # @param country [String] Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format (
@@ -106,6 +110,8 @@ module Lithic
106
110
  required :currency, String
107
111
 
108
112
  # @!method initialize(amount:, currency:)
113
+ # Transaction details for the simulation
114
+ #
109
115
  # @param amount [Integer] Amount (in cents) to authenticate.
110
116
  #
111
117
  # @param currency [String] 3-character alphabetic ISO 4217 currency code.
@@ -6,17 +6,13 @@ module Lithic
6
6
  # @see Lithic::Resources::ThreeDS::Authentication#simulate
7
7
  class AuthenticationSimulateResponse < Lithic::Internal::Type::BaseModel
8
8
  # @!attribute token
9
- # A unique token to reference this transaction with later calls to void or clear
10
- # the authorization.
9
+ # Globally unique identifier for the 3DS authentication.
11
10
  #
12
11
  # @return [String, nil]
13
12
  optional :token, String
14
13
 
15
14
  # @!method initialize(token: nil)
16
- # Some parameter documentations has been truncated, see
17
- # {Lithic::Models::ThreeDS::AuthenticationSimulateResponse} for more details.
18
- #
19
- # @param token [String] A unique token to reference this transaction with later calls to void or clear t
15
+ # @param token [String] Globally unique identifier for the 3DS authentication.
20
16
  end
21
17
  end
22
18
  end
@@ -5,16 +5,14 @@ module Lithic
5
5
  module ThreeDS
6
6
  class ChallengeResponse < Lithic::Internal::Type::BaseModel
7
7
  # @!attribute token
8
- # Globally unique identifier for the 3DS authentication. This token is sent as
9
- # part of the initial 3DS Decisioning Request and as part of the 3DS Challenge
10
- # Event in the [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication)
11
- # object
8
+ # Globally unique identifier for 3DS Authentication that resulted in
9
+ # PENDING_CHALLENGE authentication result.
12
10
  #
13
11
  # @return [String]
14
12
  required :token, String
15
13
 
16
14
  # @!attribute challenge_response
17
- # Whether the Cardholder has Approved or Declined the issued Challenge
15
+ # Whether the Cardholder has approved or declined the issued Challenge
18
16
  #
19
17
  # @return [Symbol, Lithic::Models::ThreeDS::ChallengeResult]
20
18
  required :challenge_response, enum: -> { Lithic::ThreeDS::ChallengeResult }
@@ -23,9 +21,11 @@ module Lithic
23
21
  # Some parameter documentations has been truncated, see
24
22
  # {Lithic::Models::ThreeDS::ChallengeResponse} for more details.
25
23
  #
26
- # @param token [String] Globally unique identifier for the 3DS authentication. This token is sent as par
24
+ # Response from Card Program to a 3DS Authentication challenge
27
25
  #
28
- # @param challenge_response [Symbol, Lithic::Models::ThreeDS::ChallengeResult] Whether the Cardholder has Approved or Declined the issued Challenge
26
+ # @param token [String] Globally unique identifier for 3DS Authentication that resulted in PENDING_CHALL
27
+ #
28
+ # @param challenge_response [Symbol, Lithic::Models::ThreeDS::ChallengeResult] Whether the Cardholder has approved or declined the issued Challenge
29
29
  end
30
30
  end
31
31
  end
@@ -3,7 +3,7 @@
3
3
  module Lithic
4
4
  module Models
5
5
  module ThreeDS
6
- # Whether the Cardholder has Approved or Declined the issued Challenge
6
+ # Whether the Cardholder has approved or declined the issued Challenge
7
7
  module ChallengeResult
8
8
  extend Lithic::Internal::Type::Enum
9
9
 
@@ -228,6 +228,7 @@ module Lithic
228
228
  CASH_BACK = :CASH_BACK
229
229
  CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL
230
230
  CLEARING = :CLEARING
231
+ COLLECTION = :COLLECTION
231
232
  CORRECTION_CREDIT = :CORRECTION_CREDIT
232
233
  CORRECTION_DEBIT = :CORRECTION_DEBIT
233
234
  CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION
data/lib/lithic/models.rb CHANGED
@@ -242,6 +242,8 @@ module Lithic
242
242
 
243
243
  FinancialTransaction = Lithic::Models::FinancialTransaction
244
244
 
245
+ Fraud = Lithic::Models::Fraud
246
+
245
247
  FundingEventListParams = Lithic::Models::FundingEventListParams
246
248
 
247
249
  FundingEventRetrieveDetailsParams = Lithic::Models::FundingEventRetrieveDetailsParams
@@ -22,13 +22,14 @@ module Lithic
22
22
  # `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}`
23
23
  # endpoint.
24
24
  #
25
- # Lithic currently supports backtesting for `CONDITIONAL_BLOCK` rules. Backtesting
26
- # for `VELOCITY_LIMIT` rules is generally not supported. In specific cases (i.e.
27
- # where Lithic has pre-calculated the requested velocity metrics for historical
28
- # transactions), a backtest may be feasible. However, such cases are uncommon and
29
- # customers should not anticipate support for velocity backtests under most
30
- # configurations. If a historical transaction does not feature the required inputs
31
- # to evaluate the rule, then it will not be included in the final backtest report.
25
+ # Lithic currently supports backtesting for `CONDITIONAL_BLOCK` /
26
+ # `CONDITIONAL_3DS_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is
27
+ # generally not supported. In specific cases (i.e. where Lithic has pre-calculated
28
+ # the requested velocity metrics for historical transactions), a backtest may be
29
+ # feasible. However, such cases are uncommon and customers should not anticipate
30
+ # support for velocity backtests under most configurations. If a historical
31
+ # transaction does not feature the required inputs to evaluate the rule, then it
32
+ # will not be included in the final backtest report.
32
33
  #
33
34
  # @overload create(auth_rule_token, end_: nil, start: nil, request_options: {})
34
35
  #
@@ -246,10 +246,13 @@ module Lithic
246
246
  )
247
247
  end
248
248
 
249
- # Requests a performance report of an Auth rule to be asynchronously generated.
250
- # Reports can only be run on rules in draft or active mode and will included
251
- # approved and declined statistics as well as examples. The generated report will
252
- # be delivered asynchronously through a webhook with `event_type` =
249
+ # @deprecated
250
+ #
251
+ # This endpoint is deprecated and will be removed in the future. Requests a
252
+ # performance report of an Auth rule to be asynchronously generated. Reports can
253
+ # only be run on rules in draft or active mode and will included approved and
254
+ # declined statistics as well as examples. The generated report will be delivered
255
+ # asynchronously through a webhook with `event_type` =
253
256
  # `auth_rules.performance_report.created`. See the docs on setting up
254
257
  # [webhook subscriptions](https://docs.lithic.com/docs/events-api).
255
258
  #
@@ -315,6 +318,44 @@ module Lithic
315
318
  )
316
319
  end
317
320
 
321
+ # Retrieves a performance report for an Auth rule containing daily statistics and
322
+ # evaluation outcomes.
323
+ #
324
+ # **Time Range Limitations:**
325
+ #
326
+ # - Reports are supported for the past 3 months only
327
+ # - Maximum interval length is 1 month
328
+ # - Report data is available only through the previous day in UTC (current day
329
+ # data is not available)
330
+ #
331
+ # The report provides daily statistics for both current and draft versions of the
332
+ # Auth rule, including approval, decline, and challenge counts along with sample
333
+ # events.
334
+ #
335
+ # @overload retrieve_report(auth_rule_token, begin_:, end_:, request_options: {})
336
+ #
337
+ # @param auth_rule_token [String] Globally unique identifier for the Auth Rule.
338
+ #
339
+ # @param begin_ [Date] Start date for the report
340
+ #
341
+ # @param end_ [Date] End date for the report
342
+ #
343
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
344
+ #
345
+ # @return [Lithic::Models::AuthRules::V2RetrieveReportResponse]
346
+ #
347
+ # @see Lithic::Models::AuthRules::V2RetrieveReportParams
348
+ def retrieve_report(auth_rule_token, params)
349
+ parsed, options = Lithic::AuthRules::V2RetrieveReportParams.dump_request(params)
350
+ @client.request(
351
+ method: :get,
352
+ path: ["v2/auth_rules/%1$s/report", auth_rule_token],
353
+ query: parsed.transform_keys(begin_: "begin", end_: "end"),
354
+ model: Lithic::Models::AuthRules::V2RetrieveReportResponse,
355
+ options: options
356
+ )
357
+ end
358
+
318
359
  # @api private
319
360
  #
320
361
  # @param client [Lithic::Client]
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lithic
4
+ module Resources
5
+ class Fraud
6
+ class Transactions
7
+ # Retrieve a fraud report for a specific transaction identified by its unique
8
+ # transaction token.
9
+ #
10
+ # @overload retrieve(transaction_token, request_options: {})
11
+ #
12
+ # @param transaction_token [String] The token of the transaction that the enhanced data is associated with.
13
+ #
14
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
15
+ #
16
+ # @return [Lithic::Models::Fraud::TransactionRetrieveResponse]
17
+ #
18
+ # @see Lithic::Models::Fraud::TransactionRetrieveParams
19
+ def retrieve(transaction_token, params = {})
20
+ @client.request(
21
+ method: :get,
22
+ path: ["v1/fraud/transactions/%1$s", transaction_token],
23
+ model: Lithic::Models::Fraud::TransactionRetrieveResponse,
24
+ options: params[:request_options]
25
+ )
26
+ end
27
+
28
+ # Some parameter documentations has been truncated, see
29
+ # {Lithic::Models::Fraud::TransactionReportParams} for more details.
30
+ #
31
+ # Report fraud for a specific transaction token by providing details such as fraud
32
+ # type, fraud status, and any additional comments.
33
+ #
34
+ # @overload report(transaction_token, fraud_status:, comment: nil, fraud_type: nil, request_options: {})
35
+ #
36
+ # @param transaction_token [String] The token of the transaction that the enhanced data is associated with.
37
+ #
38
+ # @param fraud_status [Symbol, Lithic::Models::Fraud::TransactionReportParams::FraudStatus] The fraud status of the transaction, string (enum) supporting the following valu
39
+ #
40
+ # @param comment [String] Optional field providing additional information or context about why the transac
41
+ #
42
+ # @param fraud_type [Symbol, Lithic::Models::Fraud::TransactionReportParams::FraudType] Specifies the type or category of fraud that the transaction is suspected or con
43
+ #
44
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
45
+ #
46
+ # @return [Lithic::Models::Fraud::TransactionReportResponse]
47
+ #
48
+ # @see Lithic::Models::Fraud::TransactionReportParams
49
+ def report(transaction_token, params)
50
+ parsed, options = Lithic::Fraud::TransactionReportParams.dump_request(params)
51
+ @client.request(
52
+ method: :post,
53
+ path: ["v1/fraud/transactions/%1$s", transaction_token],
54
+ body: parsed,
55
+ model: Lithic::Models::Fraud::TransactionReportResponse,
56
+ options: options
57
+ )
58
+ end
59
+
60
+ # @api private
61
+ #
62
+ # @param client [Lithic::Client]
63
+ def initialize(client:)
64
+ @client = client
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lithic
4
+ module Resources
5
+ class Fraud
6
+ # @return [Lithic::Resources::Fraud::Transactions]
7
+ attr_reader :transactions
8
+
9
+ # @api private
10
+ #
11
+ # @param client [Lithic::Client]
12
+ def initialize(client:)
13
+ @client = client
14
+ @transactions = Lithic::Resources::Fraud::Transactions.new(client: client)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -8,7 +8,7 @@ module Lithic
8
8
  #
9
9
  # @overload retrieve(three_ds_authentication_token, request_options: {})
10
10
  #
11
- # @param three_ds_authentication_token [String] 3DS Authentication Token
11
+ # @param three_ds_authentication_token [String] Globally unique identifier for the 3DS authentication.
12
12
  #
13
13
  # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
14
14
  #
@@ -36,11 +36,11 @@ module Lithic
36
36
  #
37
37
  # @overload simulate(merchant:, pan:, transaction:, card_expiry_check: nil, request_options: {})
38
38
  #
39
- # @param merchant [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant]
39
+ # @param merchant [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant] Merchant information for the simulated transaction
40
40
  #
41
41
  # @param pan [String] Sixteen digit card number.
42
42
  #
43
- # @param transaction [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction]
43
+ # @param transaction [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction] Transaction details for the simulation
44
44
  #
45
45
  # @param card_expiry_check [Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck] When set will use the following values as part of the Simulated Authentication.
46
46
  #
@@ -65,9 +65,9 @@ module Lithic
65
65
  # details.
66
66
  #
67
67
  # Endpoint for simulating entering OTP into 3DS Challenge UI. A call to
68
- # /v1/three_ds_authentication/simulate that resulted in triggered SMS-OTP
69
- # challenge must precede. Only a single attempt is supported; upon entering OTP,
70
- # the challenge is either approved or declined.
68
+ # [/v1/three_ds_authentication/simulate](https://docs.lithic.com/reference/postsimulateauthentication)
69
+ # that resulted in triggered SMS-OTP challenge must precede. Only a single attempt
70
+ # is supported; upon entering OTP, the challenge is either approved or declined.
71
71
  #
72
72
  # @overload simulate_otp_entry(token:, otp:, request_options: {})
73
73
  #
@@ -7,13 +7,18 @@ module Lithic
7
7
  # Some parameter documentations has been truncated, see
8
8
  # {Lithic::Models::ThreeDS::DecisioningChallengeResponseParams} for more details.
9
9
  #
10
- # Card program's response to a 3DS Challenge Request (CReq)
10
+ # Card program's response to a 3DS Challenge Request. Challenge Request is emitted
11
+ # as a webhook
12
+ # [three_ds_authentication.challenge](https://docs.lithic.com/reference/post_three-ds-authentication-challenge)
13
+ # and your Card Program needs to be configured with Out of Band (OOB) Challenges
14
+ # in order to receive it (see https://docs.lithic.com/docs/3ds-challenge-flow for
15
+ # more information).
11
16
  #
12
17
  # @overload challenge_response(token:, challenge_response:, request_options: {})
13
18
  #
14
- # @param token [String] Globally unique identifier for the 3DS authentication. This token is sent as par
19
+ # @param token [String] Globally unique identifier for 3DS Authentication that resulted in PENDING_CHALL
15
20
  #
16
- # @param challenge_response [Symbol, Lithic::Models::ThreeDS::ChallengeResult] Whether the Cardholder has Approved or Declined the issued Challenge
21
+ # @param challenge_response [Symbol, Lithic::Models::ThreeDS::ChallengeResult] Whether the Cardholder has approved or declined the issued Challenge
17
22
  #
18
23
  # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
19
24
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lithic
4
- VERSION = "0.1.0.pre.alpha.33"
4
+ VERSION = "0.1.0.pre.alpha.35"
5
5
  end
data/lib/lithic.rb CHANGED
@@ -85,6 +85,7 @@ require_relative "lithic/models/auth_rules/auth_rule"
85
85
  require_relative "lithic/models/auth_rules/auth_rule_condition"
86
86
  require_relative "lithic/models/auth_rules/conditional_attribute"
87
87
  require_relative "lithic/models/auth_rules/conditional_block_parameters"
88
+ require_relative "lithic/models/auth_rules/rule_stats"
88
89
  require_relative "lithic/models/auth_rules/v2/backtest_create_params"
89
90
  require_relative "lithic/models/auth_rules/v2/backtest_create_response"
90
91
  require_relative "lithic/models/auth_rules/v2/backtest_results"
@@ -103,6 +104,8 @@ require_relative "lithic/models/auth_rules/v2_promote_response"
103
104
  require_relative "lithic/models/auth_rules/v2_report_params"
104
105
  require_relative "lithic/models/auth_rules/v2_report_response"
105
106
  require_relative "lithic/models/auth_rules/v2_retrieve_params"
107
+ require_relative "lithic/models/auth_rules/v2_retrieve_report_params"
108
+ require_relative "lithic/models/auth_rules/v2_retrieve_report_response"
106
109
  require_relative "lithic/models/auth_rules/v2_retrieve_response"
107
110
  require_relative "lithic/models/auth_rules/v2_update_params"
108
111
  require_relative "lithic/models/auth_rules/v2_update_response"
@@ -232,6 +235,10 @@ require_relative "lithic/models/financial_accounts/statements/statement_line_ite
232
235
  require_relative "lithic/models/financial_account_update_params"
233
236
  require_relative "lithic/models/financial_account_update_status_params"
234
237
  require_relative "lithic/models/financial_transaction"
238
+ require_relative "lithic/models/fraud/transaction_report_params"
239
+ require_relative "lithic/models/fraud/transaction_report_response"
240
+ require_relative "lithic/models/fraud/transaction_retrieve_params"
241
+ require_relative "lithic/models/fraud/transaction_retrieve_response"
235
242
  require_relative "lithic/models/funding_event_list_params"
236
243
  require_relative "lithic/models/funding_event_list_response"
237
244
  require_relative "lithic/models/funding_event_retrieve_details_params"
@@ -366,6 +373,8 @@ require_relative "lithic/resources/financial_accounts/financial_transactions"
366
373
  require_relative "lithic/resources/financial_accounts/loan_tapes"
367
374
  require_relative "lithic/resources/financial_accounts/statements"
368
375
  require_relative "lithic/resources/financial_accounts/statements/line_items"
376
+ require_relative "lithic/resources/fraud"
377
+ require_relative "lithic/resources/fraud/transactions"
369
378
  require_relative "lithic/resources/funding_events"
370
379
  require_relative "lithic/resources/management_operations"
371
380
  require_relative "lithic/resources/payments"
@@ -100,6 +100,9 @@ module Lithic
100
100
  sig { returns(Lithic::Resources::FundingEvents) }
101
101
  attr_reader :funding_events
102
102
 
103
+ sig { returns(Lithic::Resources::Fraud) }
104
+ attr_reader :fraud
105
+
103
106
  # Status of api
104
107
  sig do
105
108
  params(request_options: Lithic::RequestOptions::OrHash).returns(
@@ -0,0 +1,229 @@
1
+ # typed: strong
2
+
3
+ module Lithic
4
+ module Models
5
+ module AuthRules
6
+ class RuleStats < Lithic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(Lithic::AuthRules::RuleStats, Lithic::Internal::AnyHash)
10
+ end
11
+
12
+ # The total number of historical transactions approved by this rule during the
13
+ # relevant period, or the number of transactions that would have been approved if
14
+ # the rule was evaluated in shadow mode.
15
+ sig { returns(T.nilable(Integer)) }
16
+ attr_reader :approved
17
+
18
+ sig { params(approved: Integer).void }
19
+ attr_writer :approved
20
+
21
+ # The total number of historical transactions challenged by this rule during the
22
+ # relevant period, or the number of transactions that would have been challenged
23
+ # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
24
+ # Rules.
25
+ sig { returns(T.nilable(Integer)) }
26
+ attr_reader :challenged
27
+
28
+ sig { params(challenged: Integer).void }
29
+ attr_writer :challenged
30
+
31
+ # The total number of historical transactions declined by this rule during the
32
+ # relevant period, or the number of transactions that would have been declined if
33
+ # the rule was evaluated in shadow mode.
34
+ sig { returns(T.nilable(Integer)) }
35
+ attr_reader :declined
36
+
37
+ sig { params(declined: Integer).void }
38
+ attr_writer :declined
39
+
40
+ # Example events and their outcomes.
41
+ sig do
42
+ returns(T.nilable(T::Array[Lithic::AuthRules::RuleStats::Example]))
43
+ end
44
+ attr_reader :examples
45
+
46
+ sig do
47
+ params(
48
+ examples: T::Array[Lithic::AuthRules::RuleStats::Example::OrHash]
49
+ ).void
50
+ end
51
+ attr_writer :examples
52
+
53
+ # The version of the rule, this is incremented whenever the rule's parameters
54
+ # change.
55
+ sig { returns(T.nilable(Integer)) }
56
+ attr_reader :version
57
+
58
+ sig { params(version: Integer).void }
59
+ attr_writer :version
60
+
61
+ sig do
62
+ params(
63
+ approved: Integer,
64
+ challenged: Integer,
65
+ declined: Integer,
66
+ examples: T::Array[Lithic::AuthRules::RuleStats::Example::OrHash],
67
+ version: Integer
68
+ ).returns(T.attached_class)
69
+ end
70
+ def self.new(
71
+ # The total number of historical transactions approved by this rule during the
72
+ # relevant period, or the number of transactions that would have been approved if
73
+ # the rule was evaluated in shadow mode.
74
+ approved: nil,
75
+ # The total number of historical transactions challenged by this rule during the
76
+ # relevant period, or the number of transactions that would have been challenged
77
+ # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth
78
+ # Rules.
79
+ challenged: nil,
80
+ # The total number of historical transactions declined by this rule during the
81
+ # relevant period, or the number of transactions that would have been declined if
82
+ # the rule was evaluated in shadow mode.
83
+ declined: nil,
84
+ # Example events and their outcomes.
85
+ examples: nil,
86
+ # The version of the rule, this is incremented whenever the rule's parameters
87
+ # change.
88
+ version: nil
89
+ )
90
+ end
91
+
92
+ sig do
93
+ override.returns(
94
+ {
95
+ approved: Integer,
96
+ challenged: Integer,
97
+ declined: Integer,
98
+ examples: T::Array[Lithic::AuthRules::RuleStats::Example],
99
+ version: Integer
100
+ }
101
+ )
102
+ end
103
+ def to_hash
104
+ end
105
+
106
+ class Example < Lithic::Internal::Type::BaseModel
107
+ OrHash =
108
+ T.type_alias do
109
+ T.any(
110
+ Lithic::AuthRules::RuleStats::Example,
111
+ Lithic::Internal::AnyHash
112
+ )
113
+ end
114
+
115
+ # Whether the rule would have approved the request.
116
+ sig { returns(T.nilable(T::Boolean)) }
117
+ attr_reader :approved
118
+
119
+ sig { params(approved: T::Boolean).void }
120
+ attr_writer :approved
121
+
122
+ # The decision made by the rule for this event.
123
+ sig do
124
+ returns(
125
+ T.nilable(
126
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
127
+ )
128
+ )
129
+ end
130
+ attr_reader :decision
131
+
132
+ sig do
133
+ params(
134
+ decision:
135
+ Lithic::AuthRules::RuleStats::Example::Decision::OrSymbol
136
+ ).void
137
+ end
138
+ attr_writer :decision
139
+
140
+ # The event token.
141
+ sig { returns(T.nilable(String)) }
142
+ attr_reader :event_token
143
+
144
+ sig { params(event_token: String).void }
145
+ attr_writer :event_token
146
+
147
+ # The timestamp of the event.
148
+ sig { returns(T.nilable(Time)) }
149
+ attr_reader :timestamp
150
+
151
+ sig { params(timestamp: Time).void }
152
+ attr_writer :timestamp
153
+
154
+ sig do
155
+ params(
156
+ approved: T::Boolean,
157
+ decision:
158
+ Lithic::AuthRules::RuleStats::Example::Decision::OrSymbol,
159
+ event_token: String,
160
+ timestamp: Time
161
+ ).returns(T.attached_class)
162
+ end
163
+ def self.new(
164
+ # Whether the rule would have approved the request.
165
+ approved: nil,
166
+ # The decision made by the rule for this event.
167
+ decision: nil,
168
+ # The event token.
169
+ event_token: nil,
170
+ # The timestamp of the event.
171
+ timestamp: nil
172
+ )
173
+ end
174
+
175
+ sig do
176
+ override.returns(
177
+ {
178
+ approved: T::Boolean,
179
+ decision:
180
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol,
181
+ event_token: String,
182
+ timestamp: Time
183
+ }
184
+ )
185
+ end
186
+ def to_hash
187
+ end
188
+
189
+ # The decision made by the rule for this event.
190
+ module Decision
191
+ extend Lithic::Internal::Type::Enum
192
+
193
+ TaggedSymbol =
194
+ T.type_alias do
195
+ T.all(Symbol, Lithic::AuthRules::RuleStats::Example::Decision)
196
+ end
197
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
198
+
199
+ APPROVED =
200
+ T.let(
201
+ :APPROVED,
202
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
203
+ )
204
+ DECLINED =
205
+ T.let(
206
+ :DECLINED,
207
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
208
+ )
209
+ CHALLENGED =
210
+ T.let(
211
+ :CHALLENGED,
212
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
213
+ )
214
+
215
+ sig do
216
+ override.returns(
217
+ T::Array[
218
+ Lithic::AuthRules::RuleStats::Example::Decision::TaggedSymbol
219
+ ]
220
+ )
221
+ end
222
+ def self.values
223
+ end
224
+ end
225
+ end
226
+ end
227
+ end
228
+ end
229
+ end