lithic 0.1.0.pre.alpha.32 → 0.1.0.pre.alpha.34

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 (106) 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/errors.rb +22 -0
  6. data/lib/lithic/internal/type/array_of.rb +6 -1
  7. data/lib/lithic/internal/type/base_model.rb +77 -25
  8. data/lib/lithic/internal/type/boolean.rb +7 -1
  9. data/lib/lithic/internal/type/converter.rb +42 -34
  10. data/lib/lithic/internal/type/enum.rb +10 -2
  11. data/lib/lithic/internal/type/file_input.rb +6 -1
  12. data/lib/lithic/internal/type/hash_of.rb +6 -1
  13. data/lib/lithic/internal/type/union.rb +12 -7
  14. data/lib/lithic/internal/type/unknown.rb +7 -1
  15. data/lib/lithic/models/auth_rules/rule_stats.rb +112 -0
  16. data/lib/lithic/models/auth_rules/v2/backtest_results.rb +6 -238
  17. data/lib/lithic/models/auth_rules/v2_retrieve_report_params.rb +32 -0
  18. data/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb +71 -0
  19. data/lib/lithic/models/card_convert_physical_params.rb +10 -6
  20. data/lib/lithic/models/card_create_params.rb +10 -6
  21. data/lib/lithic/models/card_reissue_params.rb +10 -6
  22. data/lib/lithic/models/card_renew_params.rb +10 -6
  23. data/lib/lithic/models/external_bank_account_create_params.rb +1 -1
  24. data/lib/lithic/models/financial_accounts/statements/statement_line_items.rb +1 -0
  25. data/lib/lithic/models/financial_transaction.rb +1 -0
  26. data/lib/lithic/models/fraud/transaction_report_params.rb +130 -0
  27. data/lib/lithic/models/fraud/transaction_report_response.rb +160 -0
  28. data/lib/lithic/models/fraud/transaction_retrieve_params.rb +16 -0
  29. data/lib/lithic/models/fraud/transaction_retrieve_response.rb +160 -0
  30. data/lib/lithic/models/payment.rb +7 -1
  31. data/lib/lithic/models/payment_create_params.rb +7 -1
  32. data/lib/lithic/models/three_ds/authentication_retrieve_response.rb +111 -79
  33. data/lib/lithic/models/three_ds/authentication_simulate_params.rb +8 -2
  34. data/lib/lithic/models/three_ds/authentication_simulate_response.rb +2 -6
  35. data/lib/lithic/models/three_ds/challenge_response.rb +7 -7
  36. data/lib/lithic/models/three_ds/challenge_result.rb +1 -1
  37. data/lib/lithic/models/transfer.rb +1 -0
  38. data/lib/lithic/models.rb +2 -0
  39. data/lib/lithic/resources/auth_rules/v2/backtests.rb +8 -7
  40. data/lib/lithic/resources/auth_rules/v2.rb +45 -4
  41. data/lib/lithic/resources/fraud/transactions.rb +69 -0
  42. data/lib/lithic/resources/fraud.rb +18 -0
  43. data/lib/lithic/resources/three_ds/authentication.rb +6 -6
  44. data/lib/lithic/resources/three_ds/decisioning.rb +8 -3
  45. data/lib/lithic/version.rb +1 -1
  46. data/lib/lithic.rb +9 -0
  47. data/rbi/lithic/client.rbi +3 -0
  48. data/rbi/lithic/errors.rbi +16 -0
  49. data/rbi/lithic/internal/type/boolean.rbi +2 -0
  50. data/rbi/lithic/internal/type/converter.rbi +15 -15
  51. data/rbi/lithic/internal/type/union.rbi +5 -0
  52. data/rbi/lithic/internal/type/unknown.rbi +2 -0
  53. data/rbi/lithic/models/auth_rules/rule_stats.rbi +229 -0
  54. data/rbi/lithic/models/auth_rules/v2/backtest_results.rbi +8 -523
  55. data/rbi/lithic/models/auth_rules/v2_retrieve_report_params.rbi +56 -0
  56. data/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi +149 -0
  57. data/rbi/lithic/models/card_convert_physical_params.rbi +15 -9
  58. data/rbi/lithic/models/card_create_params.rbi +15 -9
  59. data/rbi/lithic/models/card_reissue_params.rbi +15 -9
  60. data/rbi/lithic/models/card_renew_params.rbi +15 -9
  61. data/rbi/lithic/models/external_bank_account_create_params.rbi +2 -2
  62. data/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi +5 -0
  63. data/rbi/lithic/models/financial_transaction.rbi +5 -0
  64. data/rbi/lithic/models/fraud/transaction_report_params.rbi +263 -0
  65. data/rbi/lithic/models/fraud/transaction_report_response.rbi +309 -0
  66. data/rbi/lithic/models/fraud/transaction_retrieve_params.rbi +32 -0
  67. data/rbi/lithic/models/fraud/transaction_retrieve_response.rbi +309 -0
  68. data/rbi/lithic/models/payment.rbi +9 -3
  69. data/rbi/lithic/models/payment_create_params.rbi +8 -3
  70. data/rbi/lithic/models/three_ds/authentication_retrieve_response.rbi +171 -108
  71. data/rbi/lithic/models/three_ds/authentication_simulate_params.rbi +6 -0
  72. data/rbi/lithic/models/three_ds/authentication_simulate_response.rbi +2 -4
  73. data/rbi/lithic/models/three_ds/challenge_response.rbi +7 -10
  74. data/rbi/lithic/models/three_ds/challenge_result.rbi +1 -1
  75. data/rbi/lithic/models/transfer.rbi +2 -0
  76. data/rbi/lithic/models.rbi +2 -0
  77. data/rbi/lithic/resources/auth_rules/v2/backtests.rbi +8 -7
  78. data/rbi/lithic/resources/auth_rules/v2.rbi +37 -4
  79. data/rbi/lithic/resources/cards.rbi +20 -12
  80. data/rbi/lithic/resources/fraud/transactions.rbi +86 -0
  81. data/rbi/lithic/resources/fraud.rbi +15 -0
  82. data/rbi/lithic/resources/three_ds/authentication.rbi +6 -4
  83. data/rbi/lithic/resources/three_ds/decisioning.rbi +9 -6
  84. data/sig/lithic/client.rbs +2 -0
  85. data/sig/lithic/errors.rbs +9 -0
  86. data/sig/lithic/internal/type/converter.rbs +7 -1
  87. data/sig/lithic/models/auth_rules/rule_stats.rbs +108 -0
  88. data/sig/lithic/models/auth_rules/v2/backtest_results.rbs +8 -214
  89. data/sig/lithic/models/auth_rules/v2_retrieve_report_params.rbs +30 -0
  90. data/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs +64 -0
  91. data/sig/lithic/models/external_bank_account_create_params.rbs +2 -2
  92. data/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs +2 -0
  93. data/sig/lithic/models/financial_transaction.rbs +2 -0
  94. data/sig/lithic/models/fraud/transaction_report_params.rbs +75 -0
  95. data/sig/lithic/models/fraud/transaction_report_response.rbs +90 -0
  96. data/sig/lithic/models/fraud/transaction_retrieve_params.rbs +17 -0
  97. data/sig/lithic/models/fraud/transaction_retrieve_response.rbs +90 -0
  98. data/sig/lithic/models/payment.rbs +8 -3
  99. data/sig/lithic/models/payment_create_params.rbs +8 -3
  100. data/sig/lithic/models/three_ds/authentication_retrieve_response.rbs +19 -20
  101. data/sig/lithic/models/transfer.rbs +2 -0
  102. data/sig/lithic/models.rbs +2 -0
  103. data/sig/lithic/resources/auth_rules/v2.rbs +7 -0
  104. data/sig/lithic/resources/fraud/transactions.rbs +22 -0
  105. data/sig/lithic/resources/fraud.rbs +9 -0
  106. 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.32"
4
+ VERSION = "0.1.0.pre.alpha.34"
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(
@@ -8,6 +8,22 @@ module Lithic
8
8
  end
9
9
 
10
10
  class ConversionError < Lithic::Errors::Error
11
+ sig { returns(T.nilable(StandardError)) }
12
+ def cause
13
+ end
14
+
15
+ # @api private
16
+ sig do
17
+ params(
18
+ on: T::Class[StandardError],
19
+ method: Symbol,
20
+ target: T.anything,
21
+ value: T.anything,
22
+ cause: T.nilable(StandardError)
23
+ ).returns(T.attached_class)
24
+ end
25
+ def self.new(on:, method:, target:, value:, cause: nil)
26
+ end
11
27
  end
12
28
 
13
29
  class APIError < Lithic::Errors::Error
@@ -22,6 +22,8 @@ module Lithic
22
22
 
23
23
  class << self
24
24
  # @api private
25
+ #
26
+ # Coerce value to Boolean if possible, otherwise return the original value.
25
27
  sig do
26
28
  override
27
29
  .params(
@@ -15,12 +15,14 @@ module Lithic
15
15
  CoerceState =
16
16
  T.type_alias do
17
17
  {
18
- strictness: T.any(T::Boolean, Symbol),
18
+ translate_names: T::Boolean,
19
+ strictness: T::Boolean,
19
20
  exactness: {
20
21
  yes: Integer,
21
22
  no: Integer,
22
23
  maybe: Integer
23
24
  },
25
+ error: T::Class[StandardError],
24
26
  branched: Integer
25
27
  }
26
28
  end
@@ -84,6 +86,15 @@ module Lithic
84
86
  def self.type_info(spec)
85
87
  end
86
88
 
89
+ # @api private
90
+ sig do
91
+ params(translate_names: T::Boolean).returns(
92
+ Lithic::Internal::Type::Converter::CoerceState
93
+ )
94
+ end
95
+ def self.new_coerce_state(translate_names: true)
96
+ end
97
+
87
98
  # @api private
88
99
  #
89
100
  # Based on `target`, transform `value` into `target`, to the extent possible:
@@ -105,14 +116,11 @@ module Lithic
105
116
  def self.coerce(
106
117
  target,
107
118
  value,
108
- # The `strictness` is one of `true`, `false`, or `:strong`. This informs the
109
- # coercion strategy when we have to decide between multiple possible conversion
110
- # targets:
119
+ # The `strictness` is one of `true`, `false`. This informs the coercion strategy
120
+ # when we have to decide between multiple possible conversion targets:
111
121
  #
112
122
  # - `true`: the conversion must be exact, with minimum coercion.
113
123
  # - `false`: the conversion can be approximate, with some coercion.
114
- # - `:strong`: the conversion must be exact, with no coercion, and raise an error
115
- # if not possible.
116
124
  #
117
125
  # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For
118
126
  # any given conversion attempt, the exactness will be updated based on how closely
@@ -124,15 +132,7 @@ module Lithic
124
132
  # - `no`: the value cannot be converted to the target type.
125
133
  #
126
134
  # See implementation below for more details.
127
- state: {
128
- strictness: true,
129
- exactness: {
130
- yes: 0,
131
- no: 0,
132
- maybe: 0
133
- },
134
- branched: 0
135
- }
135
+ state: Lithic::Internal::Type::Converter.new_coerce_state
136
136
  )
137
137
  end
138
138
 
@@ -78,6 +78,11 @@ module Lithic
78
78
  end
79
79
 
80
80
  # @api private
81
+ #
82
+ # Tries to efficiently coerce the given value to one of the known variants.
83
+ #
84
+ # If the value cannot match any of the known variants, the coercion is considered
85
+ # non-viable and returns the original value.
81
86
  sig do
82
87
  override
83
88
  .params(
@@ -22,6 +22,8 @@ module Lithic
22
22
 
23
23
  class << self
24
24
  # @api private
25
+ #
26
+ # No coercion needed for Unknown type.
25
27
  sig do
26
28
  override
27
29
  .params(