lithic 0.3.0 → 0.4.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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/models/auth_rules/velocity_limit_params.rb +21 -21
  5. data/lib/lithic/models/card_create_params.rb +12 -5
  6. data/lib/lithic/models/card_updated_webhook_event.rb +40 -0
  7. data/lib/lithic/models/card_web_provision_response.rb +5 -5
  8. data/lib/lithic/models/event.rb +3 -0
  9. data/lib/lithic/models/event_list_params.rb +2 -0
  10. data/lib/lithic/models/event_subscription.rb +2 -0
  11. data/lib/lithic/models/events/subscription_create_params.rb +2 -0
  12. data/lib/lithic/models/events/subscription_send_simulated_example_params.rb +1 -0
  13. data/lib/lithic/models/events/subscription_update_params.rb +2 -0
  14. data/lib/lithic/models/financial_transaction.rb +4 -2
  15. data/lib/lithic/models/non_pci_card.rb +8 -10
  16. data/lib/lithic/models/parsed_webhook_event.rb +3 -1
  17. data/lib/lithic/models/payment.rb +1 -1
  18. data/lib/lithic/models/payment_create_params.rb +1 -1
  19. data/lib/lithic/models/transaction.rb +10 -1
  20. data/lib/lithic/models/transaction_simulate_authorization_params.rb +25 -1
  21. data/lib/lithic/models/transaction_simulate_credit_authorization_advice_params.rb +25 -1
  22. data/lib/lithic/models.rb +2 -0
  23. data/lib/lithic/resources/cards.rb +32 -22
  24. data/lib/lithic/resources/financial_accounts.rb +5 -5
  25. data/lib/lithic/resources/transactions.rb +14 -2
  26. data/lib/lithic/resources/webhooks.rb +1 -1
  27. data/lib/lithic/version.rb +1 -1
  28. data/lib/lithic.rb +1 -0
  29. data/rbi/lithic/models/auth_rules/velocity_limit_params.rbi +47 -45
  30. data/rbi/lithic/models/card_create_params.rbi +15 -6
  31. data/rbi/lithic/models/card_updated_webhook_event.rbi +61 -0
  32. data/rbi/lithic/models/card_web_provision_response.rbi +5 -10
  33. data/rbi/lithic/models/event.rbi +5 -0
  34. data/rbi/lithic/models/event_list_params.rbi +6 -0
  35. data/rbi/lithic/models/event_subscription.rbi +6 -0
  36. data/rbi/lithic/models/events/subscription_create_params.rbi +6 -0
  37. data/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi +5 -0
  38. data/rbi/lithic/models/events/subscription_update_params.rbi +6 -0
  39. data/rbi/lithic/models/financial_transaction.rbi +8 -4
  40. data/rbi/lithic/models/non_pci_card.rbi +12 -15
  41. data/rbi/lithic/models/parsed_webhook_event.rbi +1 -0
  42. data/rbi/lithic/models/payment.rbi +5 -2
  43. data/rbi/lithic/models/transaction.rbi +10 -0
  44. data/rbi/lithic/models/transaction_simulate_authorization_params.rbi +33 -0
  45. data/rbi/lithic/models/transaction_simulate_credit_authorization_advice_params.rbi +33 -0
  46. data/rbi/lithic/models.rbi +2 -0
  47. data/rbi/lithic/resources/cards.rbi +51 -45
  48. data/rbi/lithic/resources/financial_accounts.rbi +5 -5
  49. data/rbi/lithic/resources/transactions.rbi +18 -0
  50. data/rbi/lithic/resources/webhooks.rbi +62 -1
  51. data/sig/lithic/models/auth_rules/velocity_limit_params.rbs +20 -16
  52. data/sig/lithic/models/card_create_params.rbs +8 -1
  53. data/sig/lithic/models/card_updated_webhook_event.rbs +35 -0
  54. data/sig/lithic/models/card_web_provision_response.rbs +4 -10
  55. data/sig/lithic/models/event.rbs +2 -0
  56. data/sig/lithic/models/event_list_params.rbs +2 -0
  57. data/sig/lithic/models/event_subscription.rbs +2 -0
  58. data/sig/lithic/models/events/subscription_create_params.rbs +2 -0
  59. data/sig/lithic/models/events/subscription_send_simulated_example_params.rbs +2 -0
  60. data/sig/lithic/models/events/subscription_update_params.rbs +2 -0
  61. data/sig/lithic/models/parsed_webhook_event.rbs +1 -0
  62. data/sig/lithic/models/payment.rbs +2 -2
  63. data/sig/lithic/models/transaction.rbs +5 -0
  64. data/sig/lithic/models/transaction_simulate_authorization_params.rbs +21 -0
  65. data/sig/lithic/models/transaction_simulate_credit_authorization_advice_params.rbs +22 -1
  66. data/sig/lithic/models.rbs +2 -0
  67. data/sig/lithic/resources/cards.rbs +1 -0
  68. data/sig/lithic/resources/transactions.rbs +6 -0
  69. data/sig/lithic/resources/webhooks.rbs +58 -1
  70. metadata +19 -2
@@ -15,47 +15,49 @@ module Lithic
15
15
  # Create a new virtual or physical card. Parameters `shipping_address` and
16
16
  # `product_id` only apply to physical cards.
17
17
  #
18
- # @overload create(type:, account_token: nil, bulk_order_token: nil, card_program_token: nil, carrier: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, memo: nil, pin: nil, product_id: nil, replacement_account_token: nil, replacement_comment: nil, replacement_for: nil, replacement_substatus: nil, shipping_address: nil, shipping_method: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, request_options: {})
18
+ # @overload create(type:, account_token: nil, bulk_order_token: nil, card_program_token: nil, carrier: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, memo: nil, pin: nil, product_id: nil, replacement_account_token: nil, replacement_comment: nil, replacement_for: nil, replacement_substatus: nil, shipping_address: nil, shipping_method: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, idempotency_key: nil, request_options: {})
19
19
  #
20
- # @param type [Symbol, Lithic::Models::CardCreateParams::Type] Card types:
20
+ # @param type [Symbol, Lithic::Models::CardCreateParams::Type] Body param: Card types:
21
21
  #
22
- # @param account_token [String] Globally unique identifier for the account that the card will be associated with
22
+ # @param account_token [String] Body param: Globally unique identifier for the account that the card will be ass
23
23
  #
24
- # @param bulk_order_token [String] Globally unique identifier for an existing bulk order to associate this card wit
24
+ # @param bulk_order_token [String] Body param: Globally unique identifier for an existing bulk order to associate t
25
25
  #
26
- # @param card_program_token [String] For card programs with more than one BIN range. This must be configured with Lit
26
+ # @param card_program_token [String] Body param: For card programs with more than one BIN range. This must be configu
27
27
  #
28
- # @param carrier [Lithic::Models::Carrier]
28
+ # @param carrier [Lithic::Models::Carrier] Body param
29
29
  #
30
- # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet afte
30
+ # @param digital_card_art_token [String] Body param: Specifies the digital card art to be displayed in the user’s digital
31
31
  #
32
- # @param exp_month [String] Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided,
32
+ # @param exp_month [String] Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` i
33
33
  #
34
- # @param exp_year [String] Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided
34
+ # @param exp_year [String] Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year`
35
35
  #
36
- # @param memo [String] Friendly name to identify the card.
36
+ # @param memo [String] Body param: Friendly name to identify the card.
37
37
  #
38
- # @param pin [String] Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and `VIRTUA
38
+ # @param pin [String] Body param: Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL`
39
39
  #
40
- # @param product_id [String] Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic
40
+ # @param product_id [String] Body param: Only applicable to cards of type `PHYSICAL`. This must be configured
41
41
  #
42
- # @param replacement_account_token [String] Restricted field limited to select use cases. Lithic will reach out directly if
42
+ # @param replacement_account_token [String] Body param: Restricted field limited to select use cases. Lithic will reach out
43
43
  #
44
- # @param replacement_comment [String] Additional context or information related to the card that this card will replac
44
+ # @param replacement_comment [String] Body param: Additional context or information related to the card that this card
45
45
  #
46
- # @param replacement_for [String] Globally unique identifier for the card that this card will replace. If the card
46
+ # @param replacement_for [String] Body param: Globally unique identifier for the card that this card will replace.
47
47
  #
48
- # @param replacement_substatus [Symbol, Lithic::Models::CardCreateParams::ReplacementSubstatus] Card state substatus values for the card that this card will replace:
48
+ # @param replacement_substatus [Symbol, Lithic::Models::CardCreateParams::ReplacementSubstatus] Body param: Card state substatus values for the card that this card will replace
49
49
  #
50
- # @param shipping_address [Lithic::Models::ShippingAddress]
50
+ # @param shipping_address [Lithic::Models::ShippingAddress] Body param
51
51
  #
52
- # @param shipping_method [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL.
52
+ # @param shipping_method [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] Body param: Shipping method for the card. Only applies to cards of type PHYSICAL
53
53
  #
54
- # @param spend_limit [Integer] Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,00
54
+ # @param spend_limit [Integer] Body param: Amount (in cents) to limit approved authorizations (e.g. 100000 woul
55
55
  #
56
- # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Spend limit duration values:
56
+ # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Body param: Spend limit duration values:
57
+ #
58
+ # @param state [Symbol, Lithic::Models::CardCreateParams::State] Body param: Card state values:
57
59
  #
58
- # @param state [Symbol, Lithic::Models::CardCreateParams::State] Card state values:
60
+ # @param idempotency_key [String] Header param: Idempotency key for the request
59
61
  #
60
62
  # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
61
63
  #
@@ -64,7 +66,15 @@ module Lithic
64
66
  # @see Lithic::Models::CardCreateParams
65
67
  def create(params)
66
68
  parsed, options = Lithic::CardCreateParams.dump_request(params)
67
- @client.request(method: :post, path: "v1/cards", body: parsed, model: Lithic::Card, options: options)
69
+ header_params = {idempotency_key: "idempotency-key"}
70
+ @client.request(
71
+ method: :post,
72
+ path: "v1/cards",
73
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
74
+ body: parsed.except(*header_params.keys),
75
+ model: Lithic::Card,
76
+ options: options
77
+ )
68
78
  end
69
79
 
70
80
  # Get card configuration such as spend limit and state.
@@ -22,15 +22,15 @@ module Lithic
22
22
  #
23
23
  # @overload create(nickname:, type:, account_token: nil, is_for_benefit_of: nil, idempotency_key: nil, request_options: {})
24
24
  #
25
- # @param nickname [String] Body param:
25
+ # @param nickname [String] Body param
26
26
  #
27
- # @param type [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] Body param:
27
+ # @param type [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] Body param
28
28
  #
29
- # @param account_token [String] Body param:
29
+ # @param account_token [String] Body param
30
30
  #
31
- # @param is_for_benefit_of [Boolean] Body param:
31
+ # @param is_for_benefit_of [Boolean] Body param
32
32
  #
33
- # @param idempotency_key [String] Header param:
33
+ # @param idempotency_key [String] Header param: Idempotency key for the request
34
34
  #
35
35
  # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
36
36
  #
@@ -105,7 +105,7 @@ module Lithic
105
105
  # [update account](https://docs.lithic.com/reference/patchaccountbytoken)
106
106
  # endpoint.
107
107
  #
108
- # @overload simulate_authorization(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, merchant_amount: nil, merchant_currency: nil, partial_approval_capable: nil, pin: nil, status: nil, request_options: {})
108
+ # @overload simulate_authorization(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_city: nil, merchant_acceptor_country: nil, merchant_acceptor_id: nil, merchant_acceptor_state: nil, merchant_amount: nil, merchant_currency: nil, partial_approval_capable: nil, pin: nil, status: nil, request_options: {})
109
109
  #
110
110
  # @param amount [Integer] Amount (in cents) to authorize. For credit authorizations and financial credit a
111
111
  #
@@ -115,8 +115,14 @@ module Lithic
115
115
  #
116
116
  # @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number
117
117
  #
118
+ # @param merchant_acceptor_city [String] Merchant acceptor city
119
+ #
120
+ # @param merchant_acceptor_country [String] Merchant acceptor country code (ISO 3166-1 alpha-3)
121
+ #
118
122
  # @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor.
119
123
  #
124
+ # @param merchant_acceptor_state [String] Merchant acceptor state/province (ISO 3166-2 subdivision code)
125
+ #
120
126
  # @param merchant_amount [Integer] Amount of the transaction to be simulated in currency specified in merchant_curr
121
127
  #
122
128
  # @param merchant_currency [String] 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD,
@@ -211,7 +217,7 @@ module Lithic
211
217
  # Simulates a credit authorization advice from the card network. This message
212
218
  # indicates that the network approved a credit authorization on your behalf.
213
219
  #
214
- # @overload simulate_credit_authorization_advice(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {})
220
+ # @overload simulate_credit_authorization_advice(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_city: nil, merchant_acceptor_country: nil, merchant_acceptor_id: nil, merchant_acceptor_state: nil, request_options: {})
215
221
  #
216
222
  # @param amount [Integer] Amount (in cents). Any value entered will be converted into a negative amount in
217
223
  #
@@ -221,8 +227,14 @@ module Lithic
221
227
  #
222
228
  # @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number
223
229
  #
230
+ # @param merchant_acceptor_city [String] Merchant acceptor city
231
+ #
232
+ # @param merchant_acceptor_country [String] Merchant acceptor country code (ISO 3166-1 alpha-3)
233
+ #
224
234
  # @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor.
225
235
  #
236
+ # @param merchant_acceptor_state [String] Merchant acceptor state/province (ISO 3166-2 subdivision code)
237
+ #
226
238
  # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
227
239
  #
228
240
  # @return [Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse]
@@ -32,7 +32,7 @@ module Lithic
32
32
  #
33
33
  # @param payload [String] The raw webhook payload as a string
34
34
  #
35
- # @return [Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationDecisioningRequestWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent]
35
+ # @return [Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationDecisioningRequestWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardUpdatedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent]
36
36
  def parse_unsafe(payload)
37
37
  parsed = JSON.parse(payload, symbolize_names: true)
38
38
  Lithic::Internal::Type::Converter.coerce(Lithic::Models::ParsedWebhookEvent, parsed)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lithic
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/lithic.rb CHANGED
@@ -185,6 +185,7 @@ require_relative "lithic/models/card_spend_limits"
185
185
  require_relative "lithic/models/card_transaction_enhanced_data_created_webhook_event"
186
186
  require_relative "lithic/models/card_transaction_enhanced_data_updated_webhook_event"
187
187
  require_relative "lithic/models/card_transaction_updated_webhook_event"
188
+ require_relative "lithic/models/card_updated_webhook_event"
188
189
  require_relative "lithic/models/card_update_params"
189
190
  require_relative "lithic/models/card_web_provision_params"
190
191
  require_relative "lithic/models/card_web_provision_response"
@@ -12,16 +12,6 @@ module Lithic
12
12
  )
13
13
  end
14
14
 
15
- sig { returns(Lithic::AuthRules::VelocityLimitParams::Filters) }
16
- attr_reader :filters
17
-
18
- sig do
19
- params(
20
- filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash
21
- ).void
22
- end
23
- attr_writer :filters
24
-
25
15
  # Velocity over the current day since 00:00 / 12 AM in Eastern Time
26
16
  sig do
27
17
  returns(
@@ -40,6 +30,18 @@ module Lithic
40
30
  sig { returns(Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol) }
41
31
  attr_accessor :scope
42
32
 
33
+ sig do
34
+ returns(T.nilable(Lithic::AuthRules::VelocityLimitParams::Filters))
35
+ end
36
+ attr_reader :filters
37
+
38
+ sig do
39
+ params(
40
+ filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash
41
+ ).void
42
+ end
43
+ attr_writer :filters
44
+
43
45
  # The maximum amount of spend velocity allowed in the period in minor units (the
44
46
  # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this
45
47
  # limit will be declined.
@@ -56,7 +58,6 @@ module Lithic
56
58
 
57
59
  sig do
58
60
  params(
59
- filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash,
60
61
  period:
61
62
  T.any(
62
63
  Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash,
@@ -66,16 +67,17 @@ module Lithic
66
67
  Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash
67
68
  ),
68
69
  scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol,
70
+ filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash,
69
71
  limit_amount: T.nilable(Integer),
70
72
  limit_count: T.nilable(Integer)
71
73
  ).returns(T.attached_class)
72
74
  end
73
75
  def self.new(
74
- filters:,
75
76
  # Velocity over the current day since 00:00 / 12 AM in Eastern Time
76
77
  period:,
77
78
  # The scope the velocity is calculated for
78
79
  scope:,
80
+ filters: nil,
79
81
  # The maximum amount of spend velocity allowed in the period in minor units (the
80
82
  # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this
81
83
  # limit will be declined.
@@ -92,7 +94,6 @@ module Lithic
92
94
  sig do
93
95
  override.returns(
94
96
  {
95
- filters: Lithic::AuthRules::VelocityLimitParams::Filters,
96
97
  period:
97
98
  T.any(
98
99
  Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject,
@@ -102,6 +103,7 @@ module Lithic
102
103
  Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear
103
104
  ),
104
105
  scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol,
106
+ filters: Lithic::AuthRules::VelocityLimitParams::Filters,
105
107
  limit_amount: T.nilable(Integer),
106
108
  limit_count: T.nilable(Integer)
107
109
  }
@@ -110,6 +112,38 @@ module Lithic
110
112
  def to_hash
111
113
  end
112
114
 
115
+ # The scope the velocity is calculated for
116
+ module Scope
117
+ extend Lithic::Internal::Type::Enum
118
+
119
+ TaggedSymbol =
120
+ T.type_alias do
121
+ T.all(Symbol, Lithic::AuthRules::VelocityLimitParams::Scope)
122
+ end
123
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
124
+
125
+ CARD =
126
+ T.let(
127
+ :CARD,
128
+ Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
129
+ )
130
+ ACCOUNT =
131
+ T.let(
132
+ :ACCOUNT,
133
+ Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
134
+ )
135
+
136
+ sig do
137
+ override.returns(
138
+ T::Array[
139
+ Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
140
+ ]
141
+ )
142
+ end
143
+ def self.values
144
+ end
145
+ end
146
+
113
147
  class Filters < Lithic::Internal::Type::BaseModel
114
148
  OrHash =
115
149
  T.type_alias do
@@ -307,38 +341,6 @@ module Lithic
307
341
  end
308
342
  end
309
343
  end
310
-
311
- # The scope the velocity is calculated for
312
- module Scope
313
- extend Lithic::Internal::Type::Enum
314
-
315
- TaggedSymbol =
316
- T.type_alias do
317
- T.all(Symbol, Lithic::AuthRules::VelocityLimitParams::Scope)
318
- end
319
- OrSymbol = T.type_alias { T.any(Symbol, String) }
320
-
321
- CARD =
322
- T.let(
323
- :CARD,
324
- Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
325
- )
326
- ACCOUNT =
327
- T.let(
328
- :ACCOUNT,
329
- Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
330
- )
331
-
332
- sig do
333
- override.returns(
334
- T::Array[
335
- Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol
336
- ]
337
- )
338
- end
339
- def self.values
340
- end
341
- end
342
344
  end
343
345
  end
344
346
  end
@@ -21,8 +21,8 @@ module Lithic
21
21
  # Reach out at [lithic.com/contact](https://lithic.com/contact) for more
22
22
  # information.
23
23
  # - `SINGLE_USE` - Card is closed upon first successful authorization.
24
- # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
25
- # successfully authorizes the card.
24
+ # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully
25
+ # authorizes the card.
26
26
  # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use
27
27
  # VIRTUAL instead.
28
28
  # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please
@@ -264,6 +264,12 @@ module Lithic
264
264
  sig { params(state: Lithic::CardCreateParams::State::OrSymbol).void }
265
265
  attr_writer :state
266
266
 
267
+ sig { returns(T.nilable(String)) }
268
+ attr_reader :idempotency_key
269
+
270
+ sig { params(idempotency_key: String).void }
271
+ attr_writer :idempotency_key
272
+
267
273
  sig do
268
274
  params(
269
275
  type: Lithic::CardCreateParams::Type::OrSymbol,
@@ -287,6 +293,7 @@ module Lithic
287
293
  spend_limit: Integer,
288
294
  spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol,
289
295
  state: Lithic::CardCreateParams::State::OrSymbol,
296
+ idempotency_key: String,
290
297
  request_options: Lithic::RequestOptions::OrHash
291
298
  ).returns(T.attached_class)
292
299
  end
@@ -301,8 +308,8 @@ module Lithic
301
308
  # Reach out at [lithic.com/contact](https://lithic.com/contact) for more
302
309
  # information.
303
310
  # - `SINGLE_USE` - Card is closed upon first successful authorization.
304
- # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
305
- # successfully authorizes the card.
311
+ # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully
312
+ # authorizes the card.
306
313
  # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use
307
314
  # VIRTUAL instead.
308
315
  # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please
@@ -430,6 +437,7 @@ module Lithic
430
437
  # - `PAUSED` - Card will decline authorizations, but can be resumed at a later
431
438
  # time.
432
439
  state: nil,
440
+ idempotency_key: nil,
433
441
  request_options: {}
434
442
  )
435
443
  end
@@ -458,6 +466,7 @@ module Lithic
458
466
  spend_limit: Integer,
459
467
  spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol,
460
468
  state: Lithic::CardCreateParams::State::OrSymbol,
469
+ idempotency_key: String,
461
470
  request_options: Lithic::RequestOptions
462
471
  }
463
472
  )
@@ -475,8 +484,8 @@ module Lithic
475
484
  # Reach out at [lithic.com/contact](https://lithic.com/contact) for more
476
485
  # information.
477
486
  # - `SINGLE_USE` - Card is closed upon first successful authorization.
478
- # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
479
- # successfully authorizes the card.
487
+ # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully
488
+ # authorizes the card.
480
489
  # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use
481
490
  # VIRTUAL instead.
482
491
  # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please
@@ -0,0 +1,61 @@
1
+ # typed: strong
2
+
3
+ module Lithic
4
+ module Models
5
+ class CardUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Lithic::CardUpdatedWebhookEvent, Lithic::Internal::AnyHash)
9
+ end
10
+
11
+ # The token of the card that was updated.
12
+ sig { returns(String) }
13
+ attr_accessor :card_token
14
+
15
+ # The type of event that occurred.
16
+ sig { returns(Symbol) }
17
+ attr_accessor :event_type
18
+
19
+ # The previous values of the fields that were updated.
20
+ sig { returns(T.anything) }
21
+ attr_accessor :previous_fields
22
+
23
+ # The current state of the card.
24
+ sig { returns(String) }
25
+ attr_accessor :state
26
+
27
+ sig do
28
+ params(
29
+ card_token: String,
30
+ previous_fields: T.anything,
31
+ state: String,
32
+ event_type: Symbol
33
+ ).returns(T.attached_class)
34
+ end
35
+ def self.new(
36
+ # The token of the card that was updated.
37
+ card_token:,
38
+ # The previous values of the fields that were updated.
39
+ previous_fields:,
40
+ # The current state of the card.
41
+ state:,
42
+ # The type of event that occurred.
43
+ event_type: :"card.updated"
44
+ )
45
+ end
46
+
47
+ sig do
48
+ override.returns(
49
+ {
50
+ card_token: String,
51
+ event_type: Symbol,
52
+ previous_fields: T.anything,
53
+ state: String
54
+ }
55
+ )
56
+ end
57
+ def to_hash
58
+ end
59
+ end
60
+ end
61
+ end
@@ -25,9 +25,7 @@ module Lithic
25
25
  # JWS object required for handoff to Apple's script.
26
26
  sig do
27
27
  returns(
28
- T.nilable(
29
- Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws
30
- )
28
+ Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws
31
29
  )
32
30
  end
33
31
  attr_reader :jws
@@ -41,11 +39,8 @@ module Lithic
41
39
  attr_writer :jws
42
40
 
43
41
  # A unique identifier for the JWS object.
44
- sig { returns(T.nilable(String)) }
45
- attr_reader :state
46
-
47
- sig { params(state: String).void }
48
- attr_writer :state
42
+ sig { returns(String) }
43
+ attr_accessor :state
49
44
 
50
45
  sig do
51
46
  params(
@@ -56,9 +51,9 @@ module Lithic
56
51
  end
57
52
  def self.new(
58
53
  # JWS object required for handoff to Apple's script.
59
- jws: nil,
54
+ jws:,
60
55
  # A unique identifier for the JWS object.
61
- state: nil
56
+ state:
62
57
  )
63
58
  end
64
59
 
@@ -40,6 +40,7 @@ module Lithic
40
40
  # - card.reissued: Occurs when a card is reissued.
41
41
  # - card.renewed: Occurs when a card is renewed.
42
42
  # - card.shipped: Occurs when a card is shipped.
43
+ # - card.updated: Occurs when a card is updated.
43
44
  # - digital_wallet.tokenization_approval_request: Occurs when a tokenization
44
45
  # approval request is made. This event will be deprecated in the future. We
45
46
  # recommend using `tokenization.approval_request` instead.
@@ -162,6 +163,7 @@ module Lithic
162
163
  # - card.reissued: Occurs when a card is reissued.
163
164
  # - card.renewed: Occurs when a card is renewed.
164
165
  # - card.shipped: Occurs when a card is shipped.
166
+ # - card.updated: Occurs when a card is updated.
165
167
  # - digital_wallet.tokenization_approval_request: Occurs when a tokenization
166
168
  # approval request is made. This event will be deprecated in the future. We
167
169
  # recommend using `tokenization.approval_request` instead.
@@ -280,6 +282,7 @@ module Lithic
280
282
  # - card.reissued: Occurs when a card is reissued.
281
283
  # - card.renewed: Occurs when a card is renewed.
282
284
  # - card.shipped: Occurs when a card is shipped.
285
+ # - card.updated: Occurs when a card is updated.
283
286
  # - digital_wallet.tokenization_approval_request: Occurs when a tokenization
284
287
  # approval request is made. This event will be deprecated in the future. We
285
288
  # recommend using `tokenization.approval_request` instead.
@@ -423,6 +426,8 @@ module Lithic
423
426
  T.let(:"card.renewed", Lithic::Event::EventType::TaggedSymbol)
424
427
  CARD_SHIPPED =
425
428
  T.let(:"card.shipped", Lithic::Event::EventType::TaggedSymbol)
429
+ CARD_UPDATED =
430
+ T.let(:"card.updated", Lithic::Event::EventType::TaggedSymbol)
426
431
  DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
427
432
  T.let(
428
433
  :"digital_wallet.tokenization_approval_request",
@@ -149,6 +149,7 @@ module Lithic
149
149
  # - card.reissued: Occurs when a card is reissued.
150
150
  # - card.renewed: Occurs when a card is renewed.
151
151
  # - card.shipped: Occurs when a card is shipped.
152
+ # - card.updated: Occurs when a card is updated.
152
153
  # - digital_wallet.tokenization_approval_request: Occurs when a tokenization
153
154
  # approval request is made. This event will be deprecated in the future. We
154
155
  # recommend using `tokenization.approval_request` instead.
@@ -311,6 +312,11 @@ module Lithic
311
312
  :"card.shipped",
312
313
  Lithic::EventListParams::EventType::TaggedSymbol
313
314
  )
315
+ CARD_UPDATED =
316
+ T.let(
317
+ :"card.updated",
318
+ Lithic::EventListParams::EventType::TaggedSymbol
319
+ )
314
320
  DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
315
321
  T.let(
316
322
  :"digital_wallet.tokenization_approval_request",
@@ -97,6 +97,7 @@ module Lithic
97
97
  # - card.reissued: Occurs when a card is reissued.
98
98
  # - card.renewed: Occurs when a card is renewed.
99
99
  # - card.shipped: Occurs when a card is shipped.
100
+ # - card.updated: Occurs when a card is updated.
100
101
  # - digital_wallet.tokenization_approval_request: Occurs when a tokenization
101
102
  # approval request is made. This event will be deprecated in the future. We
102
103
  # recommend using `tokenization.approval_request` instead.
@@ -259,6 +260,11 @@ module Lithic
259
260
  :"card.shipped",
260
261
  Lithic::EventSubscription::EventType::TaggedSymbol
261
262
  )
263
+ CARD_UPDATED =
264
+ T.let(
265
+ :"card.updated",
266
+ Lithic::EventSubscription::EventType::TaggedSymbol
267
+ )
262
268
  DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
263
269
  T.let(
264
270
  :"digital_wallet.tokenization_approval_request",
@@ -124,6 +124,7 @@ module Lithic
124
124
  # - card.reissued: Occurs when a card is reissued.
125
125
  # - card.renewed: Occurs when a card is renewed.
126
126
  # - card.shipped: Occurs when a card is shipped.
127
+ # - card.updated: Occurs when a card is updated.
127
128
  # - digital_wallet.tokenization_approval_request: Occurs when a tokenization
128
129
  # approval request is made. This event will be deprecated in the future. We
129
130
  # recommend using `tokenization.approval_request` instead.
@@ -288,6 +289,11 @@ module Lithic
288
289
  :"card.shipped",
289
290
  Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol
290
291
  )
292
+ CARD_UPDATED =
293
+ T.let(
294
+ :"card.updated",
295
+ Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol
296
+ )
291
297
  DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
292
298
  T.let(
293
299
  :"digital_wallet.tokenization_approval_request",
@@ -152,6 +152,11 @@ module Lithic
152
152
  :"card.shipped",
153
153
  Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol
154
154
  )
155
+ CARD_UPDATED =
156
+ T.let(
157
+ :"card.updated",
158
+ Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol
159
+ )
155
160
  DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
156
161
  T.let(
157
162
  :"digital_wallet.tokenization_approval_request",
@@ -124,6 +124,7 @@ module Lithic
124
124
  # - card.reissued: Occurs when a card is reissued.
125
125
  # - card.renewed: Occurs when a card is renewed.
126
126
  # - card.shipped: Occurs when a card is shipped.
127
+ # - card.updated: Occurs when a card is updated.
127
128
  # - digital_wallet.tokenization_approval_request: Occurs when a tokenization
128
129
  # approval request is made. This event will be deprecated in the future. We
129
130
  # recommend using `tokenization.approval_request` instead.
@@ -288,6 +289,11 @@ module Lithic
288
289
  :"card.shipped",
289
290
  Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol
290
291
  )
292
+ CARD_UPDATED =
293
+ T.let(
294
+ :"card.updated",
295
+ Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol
296
+ )
291
297
  DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST =
292
298
  T.let(
293
299
  :"digital_wallet.tokenization_approval_request",