diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 631daab8..1d20e873 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -36,7 +36,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/lithic-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index a48dc659..7322f05b 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index ae6f51b8..4f43d314 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'lithic-com/lithic-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6b7b74c5..da59f99e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.4.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index ddb484b7..30dea04f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 176 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-4ecc06edca2cfad4eaf11573611e89823fda5f56370bac5cd02a498a6b277d09.yml -openapi_spec_hash: 8f4a30bec4348cbde85b1e65bef9189a -config_hash: 9dddee5f7af579864599849cb28a0770 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-a6c56df3bc156ac1e6ee5d635c6cd964f0d60836fe17a97deec8af8429bd339c.yml +openapi_spec_hash: c563acd10d96ddabe6c9643b592bd509 +config_hash: 31d71922d7838f34ae0875c9b8026d99 diff --git a/CHANGELOG.md b/CHANGELOG.md index 82022fd2..4845df5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,44 @@ # Changelog +## 0.4.0 (2026-01-26) + +Full Changelog: [v0.3.0...v0.4.0](https://github.com/lithic-com/lithic-ruby/compare/v0.3.0...v0.4.0) + +### Features + +* **api:** Add card state attribute to tokenization rules ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) +* **api:** Add card.updated event ([80369fe](https://github.com/lithic-com/lithic-ruby/commit/80369fe89f4bfb7255bfa05a2035c77238debe3a)) +* **api:** Add event_type to ASA request and 3DS decisioning request ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) +* **api:** Add idempotency key to cards POST and PATCH endpoints ([51321d8](https://github.com/lithic-com/lithic-ruby/commit/51321d8d84f5e1fcb4e9161dd607f01dc9d5cf5d)) +* **api:** Add tags field to card transactions ([edf8fbc](https://github.com/lithic-com/lithic-ruby/commit/edf8fbccb53de602bc52be916d6c80498ae4e390)) +* **api:** Add user defined status to ledger accounts ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) +* **api:** Expose Payment Allocation Details ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) +* **api:** make filter optional for Spend Velocity Auth Rules ([3e09d4a](https://github.com/lithic-com/lithic-ruby/commit/3e09d4a5488c83ad8122c973baf5eb4e18de29b0)) + + +### Bug Fixes + +* **api:** Correct field name from ach_hold__period to ach_hold_period ([16b6555](https://github.com/lithic-com/lithic-ruby/commit/16b65553840cfad0d39eb52d9770ca394a893c44)) +* **api:** mark AppleWebPushProvisioningResponse fields required ([4105b29](https://github.com/lithic-com/lithic-ruby/commit/4105b29d27ce48c60180c5b7166e664fdd1c0e46)) +* **api:** rename WIRE_DRAWDOWN_REQUEST to WIRE_INBOUND_DRAWDOWN_REQUEST ([3e09d4a](https://github.com/lithic-com/lithic-ruby/commit/3e09d4a5488c83ad8122c973baf5eb4e18de29b0)) + + +### Chores + +* Add spec linter for YAML and folded style multiline strings ([35a67d3](https://github.com/lithic-com/lithic-ruby/commit/35a67d3154e8f54d374c53d8b3b53b9485272878)) +* configure new SDK language ([ba770b2](https://github.com/lithic-com/lithic-ruby/commit/ba770b2cd5f50ba1871c539f89036ff4538b1df2)) +* **internal:** codegen related update ([ef965b2](https://github.com/lithic-com/lithic-ruby/commit/ef965b2fc0cfebc92a3d2317b7201318bcd500aa)) +* **internal:** codegen related update ([143a5ea](https://github.com/lithic-com/lithic-ruby/commit/143a5ea456ee1e6db32fd923ddb68f749ceed53b)) +* **internal:** update `actions/checkout` version ([830ae4a](https://github.com/lithic-com/lithic-ruby/commit/830ae4ad28662e5be21860d14ea86d2f1fa25ec0)) +* Rework event type generation to support spec splitting ([fdb9960](https://github.com/lithic-com/lithic-ruby/commit/fdb9960d08f95f161da8abf310509d594a0d2957)) +* update code formatting ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) + + +### Documentation + +* Remove deprecated tag from MERCHANT_LOCKED card type ([b3104df](https://github.com/lithic-com/lithic-ruby/commit/b3104df92ab8f161c92c1136b86a1a734576f574)) +* Update language for Google Web Push Provisioning docs ([0fe9646](https://github.com/lithic-com/lithic-ruby/commit/0fe9646694e932fddba74b91dcc7cdb1bb565d10)) + ## 0.3.0 (2026-01-08) Full Changelog: [v0.2.0...v0.3.0](https://github.com/lithic-com/lithic-ruby/compare/v0.2.0...v0.3.0) diff --git a/Gemfile.lock b/Gemfile.lock index ec7d09db..b3ae62c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,8 @@ GIT PATH remote: . specs: - lithic (0.3.0) + lithic (0.4.0) + cgi connection_pool GEM @@ -49,6 +50,7 @@ GEM base64 (0.3.0) benchmark (0.5.0) bigdecimal (3.3.1) + cgi (0.5.1) concurrent-ruby (1.3.5) connection_pool (2.5.4) console (1.34.2) diff --git a/README.md b/README.md index 2333dd34..69d956a4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "lithic", "~> 0.3.0" +gem "lithic", "~> 0.4.0" ``` diff --git a/lib/lithic.rb b/lib/lithic.rb index 2b939bb5..3924f8a8 100644 --- a/lib/lithic.rb +++ b/lib/lithic.rb @@ -185,6 +185,7 @@ require_relative "lithic/models/card_transaction_enhanced_data_created_webhook_event" require_relative "lithic/models/card_transaction_enhanced_data_updated_webhook_event" require_relative "lithic/models/card_transaction_updated_webhook_event" +require_relative "lithic/models/card_updated_webhook_event" require_relative "lithic/models/card_update_params" require_relative "lithic/models/card_web_provision_params" require_relative "lithic/models/card_web_provision_response" diff --git a/lib/lithic/models.rb b/lib/lithic/models.rb index 746c1f2d..f74a466a 100644 --- a/lib/lithic/models.rb +++ b/lib/lithic/models.rb @@ -189,6 +189,8 @@ module Lithic CardTransactionUpdatedWebhookEvent = Lithic::Models::CardTransactionUpdatedWebhookEvent + CardUpdatedWebhookEvent = Lithic::Models::CardUpdatedWebhookEvent + CardUpdateParams = Lithic::Models::CardUpdateParams CardWebProvisionParams = Lithic::Models::CardWebProvisionParams diff --git a/lib/lithic/models/auth_rules/velocity_limit_params.rb b/lib/lithic/models/auth_rules/velocity_limit_params.rb index af706df4..55b2d7a4 100644 --- a/lib/lithic/models/auth_rules/velocity_limit_params.rb +++ b/lib/lithic/models/auth_rules/velocity_limit_params.rb @@ -4,11 +4,6 @@ module Lithic module Models module AuthRules class VelocityLimitParams < Lithic::Internal::Type::BaseModel - # @!attribute filters - # - # @return [Lithic::Models::AuthRules::VelocityLimitParams::Filters] - required :filters, -> { Lithic::AuthRules::VelocityLimitParams::Filters } - # @!attribute period # Velocity over the current day since 00:00 / 12 AM in Eastern Time # @@ -21,6 +16,11 @@ class VelocityLimitParams < Lithic::Internal::Type::BaseModel # @return [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] required :scope, enum: -> { Lithic::AuthRules::VelocityLimitParams::Scope } + # @!attribute filters + # + # @return [Lithic::Models::AuthRules::VelocityLimitParams::Filters, nil] + optional :filters, -> { Lithic::AuthRules::VelocityLimitParams::Filters } + # @!attribute limit_amount # The maximum amount of spend velocity allowed in the period in minor units (the # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this @@ -39,20 +39,33 @@ class VelocityLimitParams < Lithic::Internal::Type::BaseModel # @return [Integer, nil] optional :limit_count, Integer, nil?: true - # @!method initialize(filters:, period:, scope:, limit_amount: nil, limit_count: nil) + # @!method initialize(period:, scope:, filters: nil, limit_amount: nil, limit_count: nil) # Some parameter documentations has been truncated, see # {Lithic::Models::AuthRules::VelocityLimitParams} for more details. # - # @param filters [Lithic::Models::AuthRules::VelocityLimitParams::Filters] - # # @param period [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] Velocity over the current day since 00:00 / 12 AM in Eastern Time # # @param scope [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] The scope the velocity is calculated for # + # @param filters [Lithic::Models::AuthRules::VelocityLimitParams::Filters] + # # @param limit_amount [Integer, nil] The maximum amount of spend velocity allowed in the period in minor units (the s # # @param limit_count [Integer, nil] The number of spend velocity impacting transactions may not exceed this limit in + # The scope the velocity is calculated for + # + # @see Lithic::Models::AuthRules::VelocityLimitParams#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + + # @!method self.values + # @return [Array] + end + # @see Lithic::Models::AuthRules::VelocityLimitParams#filters class Filters < Lithic::Internal::Type::BaseModel # @!attribute exclude_countries @@ -133,19 +146,6 @@ module IncludePanEntryMode # @return [Array] end end - - # The scope the velocity is calculated for - # - # @see Lithic::Models::AuthRules::VelocityLimitParams#scope - module Scope - extend Lithic::Internal::Type::Enum - - CARD = :CARD - ACCOUNT = :ACCOUNT - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/lithic/models/card_create_params.rb b/lib/lithic/models/card_create_params.rb index 02866cdf..669b73db 100644 --- a/lib/lithic/models/card_create_params.rb +++ b/lib/lithic/models/card_create_params.rb @@ -18,8 +18,8 @@ class CardCreateParams < Lithic::Internal::Type::BaseModel # Reach out at [lithic.com/contact](https://lithic.com/contact) for more # information. # - `SINGLE_USE` - Card is closed upon first successful authorization. - # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that - # successfully authorizes the card. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use # VIRTUAL instead. # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please @@ -226,7 +226,12 @@ class CardCreateParams < Lithic::Internal::Type::BaseModel # @return [Symbol, Lithic::Models::CardCreateParams::State, nil] optional :state, enum: -> { Lithic::CardCreateParams::State } - # @!method initialize(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: {}) + # @!attribute idempotency_key + # + # @return [String, nil] + optional :idempotency_key, String + + # @!method initialize(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: {}) # Some parameter documentations has been truncated, see # {Lithic::Models::CardCreateParams} for more details. # @@ -270,6 +275,8 @@ class CardCreateParams < Lithic::Internal::Type::BaseModel # # @param state [Symbol, Lithic::Models::CardCreateParams::State] Card state values: # + # @param idempotency_key [String] + # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] # Card types: @@ -282,8 +289,8 @@ class CardCreateParams < Lithic::Internal::Type::BaseModel # Reach out at [lithic.com/contact](https://lithic.com/contact) for more # information. # - `SINGLE_USE` - Card is closed upon first successful authorization. - # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that - # successfully authorizes the card. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use # VIRTUAL instead. # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please diff --git a/lib/lithic/models/card_updated_webhook_event.rb b/lib/lithic/models/card_updated_webhook_event.rb new file mode 100644 index 00000000..31f52e69 --- /dev/null +++ b/lib/lithic/models/card_updated_webhook_event.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute card_token + # The token of the card that was updated. + # + # @return [String] + required :card_token, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.updated"] + required :event_type, const: :"card.updated" + + # @!attribute previous_fields + # The previous values of the fields that were updated. + # + # @return [Object] + required :previous_fields, Lithic::Internal::Type::Unknown + + # @!attribute state + # The current state of the card. + # + # @return [String] + required :state, String + + # @!method initialize(card_token:, previous_fields:, state:, event_type: :"card.updated") + # @param card_token [String] The token of the card that was updated. + # + # @param previous_fields [Object] The previous values of the fields that were updated. + # + # @param state [String] The current state of the card. + # + # @param event_type [Symbol, :"card.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_web_provision_response.rb b/lib/lithic/models/card_web_provision_response.rb index c5371e02..2f20b874 100644 --- a/lib/lithic/models/card_web_provision_response.rb +++ b/lib/lithic/models/card_web_provision_response.rb @@ -14,16 +14,16 @@ class AppleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel # @!attribute jws # JWS object required for handoff to Apple's script. # - # @return [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, nil] - optional :jws, -> { Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws } + # @return [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws] + required :jws, -> { Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws } # @!attribute state # A unique identifier for the JWS object. # - # @return [String, nil] - optional :state, String + # @return [String] + required :state, String - # @!method initialize(jws: nil, state: nil) + # @!method initialize(jws:, state:) # @param jws [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws] JWS object required for handoff to Apple's script. # # @param state [String] A unique identifier for the JWS object. diff --git a/lib/lithic/models/event.rb b/lib/lithic/models/event.rb index a613fa61..e64fa7ee 100644 --- a/lib/lithic/models/event.rb +++ b/lib/lithic/models/event.rb @@ -44,6 +44,7 @@ class Event < Lithic::Internal::Type::BaseModel # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -167,6 +168,7 @@ class Event < Lithic::Internal::Type::BaseModel # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -263,6 +265,7 @@ module EventType CARD_REISSUED = :"card.reissued" CARD_RENEWED = :"card.renewed" CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = diff --git a/lib/lithic/models/event_list_params.rb b/lib/lithic/models/event_list_params.rb index f74e1d04..31913c4b 100644 --- a/lib/lithic/models/event_list_params.rb +++ b/lib/lithic/models/event_list_params.rb @@ -98,6 +98,7 @@ class EventListParams < Lithic::Internal::Type::BaseModel # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -192,6 +193,7 @@ module EventType CARD_REISSUED = :"card.reissued" CARD_RENEWED = :"card.renewed" CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = diff --git a/lib/lithic/models/event_subscription.rb b/lib/lithic/models/event_subscription.rb index ad0a5dc4..95dc392c 100644 --- a/lib/lithic/models/event_subscription.rb +++ b/lib/lithic/models/event_subscription.rb @@ -71,6 +71,7 @@ class EventSubscription < Lithic::Internal::Type::BaseModel # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -165,6 +166,7 @@ module EventType CARD_REISSUED = :"card.reissued" CARD_RENEWED = :"card.renewed" CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = diff --git a/lib/lithic/models/events/subscription_create_params.rb b/lib/lithic/models/events/subscription_create_params.rb index c0daecd1..8785fb85 100644 --- a/lib/lithic/models/events/subscription_create_params.rb +++ b/lib/lithic/models/events/subscription_create_params.rb @@ -73,6 +73,7 @@ class SubscriptionCreateParams < Lithic::Internal::Type::BaseModel # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -167,6 +168,7 @@ module EventType CARD_REISSUED = :"card.reissued" CARD_RENEWED = :"card.renewed" CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = diff --git a/lib/lithic/models/events/subscription_send_simulated_example_params.rb b/lib/lithic/models/events/subscription_send_simulated_example_params.rb index 131d46e8..cb3f8074 100644 --- a/lib/lithic/models/events/subscription_send_simulated_example_params.rb +++ b/lib/lithic/models/events/subscription_send_simulated_example_params.rb @@ -39,6 +39,7 @@ module EventType CARD_REISSUED = :"card.reissued" CARD_RENEWED = :"card.renewed" CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = diff --git a/lib/lithic/models/events/subscription_update_params.rb b/lib/lithic/models/events/subscription_update_params.rb index c46ff59c..619bc83d 100644 --- a/lib/lithic/models/events/subscription_update_params.rb +++ b/lib/lithic/models/events/subscription_update_params.rb @@ -73,6 +73,7 @@ class SubscriptionUpdateParams < Lithic::Internal::Type::BaseModel # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -167,6 +168,7 @@ module EventType CARD_REISSUED = :"card.reissued" CARD_RENEWED = :"card.renewed" CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = diff --git a/lib/lithic/models/financial_transaction.rb b/lib/lithic/models/financial_transaction.rb index 4a12ab1a..d987a017 100644 --- a/lib/lithic/models/financial_transaction.rb +++ b/lib/lithic/models/financial_transaction.rb @@ -49,8 +49,10 @@ class FinancialTransaction < Lithic::Internal::Type::BaseModel # @!attribute pending_amount # Pending amount of the transaction in the currency's smallest unit (e.g., cents), - # including any acquirer fees. The value of this field will go to zero over time - # once the financial transaction is settled. + # including any acquirer fees. + # + # The value of this field will go to zero over time once the financial transaction + # is settled. # # @return [Integer] required :pending_amount, Integer diff --git a/lib/lithic/models/non_pci_card.rb b/lib/lithic/models/non_pci_card.rb index 4a444fe3..9b81b3eb 100644 --- a/lib/lithic/models/non_pci_card.rb +++ b/lib/lithic/models/non_pci_card.rb @@ -97,11 +97,10 @@ class NonPCICard < Lithic::Internal::Type::BaseModel # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe # functionality. _ `SINGLE_USE` - Card is closed upon first successful - # authorization. _ `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first - # merchant that successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ - # Similar behavior to VIRTUAL cards, please use VIRTUAL instead. _ - # `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use - # VIRTUAL instead. + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. # # @return [Symbol, Lithic::Models::NonPCICard::Type] required :type, enum: -> { Lithic::NonPCICard::Type } @@ -436,11 +435,10 @@ module State # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe # functionality. _ `SINGLE_USE` - Card is closed upon first successful - # authorization. _ `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first - # merchant that successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ - # Similar behavior to VIRTUAL cards, please use VIRTUAL instead. _ - # `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use - # VIRTUAL instead. + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. # # @see Lithic::Models::NonPCICard#type module Type diff --git a/lib/lithic/models/parsed_webhook_event.rb b/lib/lithic/models/parsed_webhook_event.rb index d00da4bc..b044bcb1 100644 --- a/lib/lithic/models/parsed_webhook_event.rb +++ b/lib/lithic/models/parsed_webhook_event.rb @@ -46,6 +46,8 @@ module ParsedWebhookEvent variant -> { Lithic::CardShippedWebhookEvent } + variant -> { Lithic::CardUpdatedWebhookEvent } + variant -> { Lithic::CardTransactionUpdatedWebhookEvent } variant -> { Lithic::CardTransactionEnhancedDataCreatedWebhookEvent } @@ -811,7 +813,7 @@ module EventType end # @!method self.variants - # @return [Array(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)] + # @return [Array(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)] end end end diff --git a/lib/lithic/models/payment.rb b/lib/lithic/models/payment.rb index 68b8f367..aa25ca3c 100644 --- a/lib/lithic/models/payment.rb +++ b/lib/lithic/models/payment.rb @@ -650,7 +650,7 @@ module Type WIRE_INBOUND_ADMIN = :WIRE_INBOUND_ADMIN WIRE_OUTBOUND_PAYMENT = :WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN = :WIRE_OUTBOUND_ADMIN - WIRE_DRAWDOWN_REQUEST = :WIRE_DRAWDOWN_REQUEST + WIRE_INBOUND_DRAWDOWN_REQUEST = :WIRE_INBOUND_DRAWDOWN_REQUEST # @!method self.values # @return [Array] diff --git a/lib/lithic/models/payment_create_params.rb b/lib/lithic/models/payment_create_params.rb index ee1ae3a5..efba70e3 100644 --- a/lib/lithic/models/payment_create_params.rb +++ b/lib/lithic/models/payment_create_params.rb @@ -98,7 +98,7 @@ class MethodAttributes < Lithic::Internal::Type::BaseModel # Number of days to hold the ACH payment # # @return [Integer, nil] - optional :ach_hold_period, Integer, api_name: :ach_hold__period + optional :ach_hold_period, Integer # @!attribute addenda # diff --git a/lib/lithic/models/transaction.rb b/lib/lithic/models/transaction.rb index cb8f93e1..dcf50ac4 100644 --- a/lib/lithic/models/transaction.rb +++ b/lib/lithic/models/transaction.rb @@ -162,6 +162,13 @@ class Transaction < Lithic::Internal::Type::BaseModel # @return [Symbol, Lithic::Models::Transaction::Status] required :status, enum: -> { Lithic::Transaction::Status } + # @!attribute tags + # Key-value pairs for tagging resources. Tags allow you to associate arbitrary + # metadata with a resource for your own purposes. + # + # @return [Hash{Symbol=>String}] + required :tags, Lithic::Internal::Type::HashOf[String] + # @!attribute token_info # # @return [Lithic::Models::TokenInfo, nil] @@ -178,7 +185,7 @@ class Transaction < Lithic::Internal::Type::BaseModel # @return [Array, nil] optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event] } - # @!method initialize(token:, account_token:, acquirer_fee:, acquirer_reference_number:, amount:, amounts:, authorization_amount:, authorization_code:, avs:, card_token:, cardholder_authentication:, created:, financial_account_token:, merchant:, merchant_amount:, merchant_authorization_amount:, merchant_currency:, network:, network_risk_score:, pos:, result:, settled_amount:, status:, token_info:, updated:, events: nil) + # @!method initialize(token:, account_token:, acquirer_fee:, acquirer_reference_number:, amount:, amounts:, authorization_amount:, authorization_code:, avs:, card_token:, cardholder_authentication:, created:, financial_account_token:, merchant:, merchant_amount:, merchant_authorization_amount:, merchant_currency:, network:, network_risk_score:, pos:, result:, settled_amount:, status:, tags:, token_info:, updated:, events: nil) # Some parameter documentations has been truncated, see # {Lithic::Models::Transaction} for more details. # @@ -228,6 +235,8 @@ class Transaction < Lithic::Internal::Type::BaseModel # # @param status [Symbol, Lithic::Models::Transaction::Status] Status of the transaction. # + # @param tags [Hash{Symbol=>String}] Key-value pairs for tagging resources. Tags allow you to associate arbitrary met + # # @param token_info [Lithic::Models::TokenInfo, nil] # # @param updated [Time] Date and time when the transaction last updated. UTC time zone. diff --git a/lib/lithic/resources/cards.rb b/lib/lithic/resources/cards.rb index 5d7bd6cb..bcf5e7b3 100644 --- a/lib/lithic/resources/cards.rb +++ b/lib/lithic/resources/cards.rb @@ -15,47 +15,49 @@ class Cards # Create a new virtual or physical card. Parameters `shipping_address` and # `product_id` only apply to physical cards. # - # @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: {}) + # @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: {}) # - # @param type [Symbol, Lithic::Models::CardCreateParams::Type] Card types: + # @param type [Symbol, Lithic::Models::CardCreateParams::Type] Body param: Card types: # - # @param account_token [String] Globally unique identifier for the account that the card will be associated with + # @param account_token [String] Body param: Globally unique identifier for the account that the card will be ass # - # @param bulk_order_token [String] Globally unique identifier for an existing bulk order to associate this card wit + # @param bulk_order_token [String] Body param: Globally unique identifier for an existing bulk order to associate t # - # @param card_program_token [String] For card programs with more than one BIN range. This must be configured with Lit + # @param card_program_token [String] Body param: For card programs with more than one BIN range. This must be configu # - # @param carrier [Lithic::Models::Carrier] + # @param carrier [Lithic::Models::Carrier] Body param # - # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet afte + # @param digital_card_art_token [String] Body param: Specifies the digital card art to be displayed in the user’s digital # - # @param exp_month [String] Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # @param exp_month [String] Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` i # - # @param exp_year [String] Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided + # @param exp_year [String] Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` # - # @param memo [String] Friendly name to identify the card. + # @param memo [String] Body param: Friendly name to identify the card. # - # @param pin [String] Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and `VIRTUA + # @param pin [String] Body param: Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` # - # @param product_id [String] Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # @param product_id [String] Body param: Only applicable to cards of type `PHYSICAL`. This must be configured # - # @param replacement_account_token [String] Restricted field limited to select use cases. Lithic will reach out directly if + # @param replacement_account_token [String] Body param: Restricted field limited to select use cases. Lithic will reach out # - # @param replacement_comment [String] Additional context or information related to the card that this card will replac + # @param replacement_comment [String] Body param: Additional context or information related to the card that this card # - # @param replacement_for [String] Globally unique identifier for the card that this card will replace. If the card + # @param replacement_for [String] Body param: Globally unique identifier for the card that this card will replace. # - # @param replacement_substatus [Symbol, Lithic::Models::CardCreateParams::ReplacementSubstatus] Card state substatus values for the card that this card will replace: + # @param replacement_substatus [Symbol, Lithic::Models::CardCreateParams::ReplacementSubstatus] Body param: Card state substatus values for the card that this card will replace # - # @param shipping_address [Lithic::Models::ShippingAddress] + # @param shipping_address [Lithic::Models::ShippingAddress] Body param # - # @param shipping_method [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL. + # @param shipping_method [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] Body param: Shipping method for the card. Only applies to cards of type PHYSICAL # - # @param spend_limit [Integer] Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,00 + # @param spend_limit [Integer] Body param: Amount (in cents) to limit approved authorizations (e.g. 100000 woul # - # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Spend limit duration values: + # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Body param: Spend limit duration values: + # + # @param state [Symbol, Lithic::Models::CardCreateParams::State] Body param: Card state values: # - # @param state [Symbol, Lithic::Models::CardCreateParams::State] Card state values: + # @param idempotency_key [String] Header param: Idempotency key for the request # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -64,7 +66,15 @@ class Cards # @see Lithic::Models::CardCreateParams def create(params) parsed, options = Lithic::CardCreateParams.dump_request(params) - @client.request(method: :post, path: "v1/cards", body: parsed, model: Lithic::Card, options: options) + header_params = {idempotency_key: "idempotency-key"} + @client.request( + method: :post, + path: "v1/cards", + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Lithic::Card, + options: options + ) end # Get card configuration such as spend limit and state. diff --git a/lib/lithic/resources/financial_accounts.rb b/lib/lithic/resources/financial_accounts.rb index ee7e18c0..fc2f9e9c 100644 --- a/lib/lithic/resources/financial_accounts.rb +++ b/lib/lithic/resources/financial_accounts.rb @@ -22,15 +22,15 @@ class FinancialAccounts # # @overload create(nickname:, type:, account_token: nil, is_for_benefit_of: nil, idempotency_key: nil, request_options: {}) # - # @param nickname [String] Body param: + # @param nickname [String] Body param # - # @param type [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] Body param: + # @param type [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] Body param # - # @param account_token [String] Body param: + # @param account_token [String] Body param # - # @param is_for_benefit_of [Boolean] Body param: + # @param is_for_benefit_of [Boolean] Body param # - # @param idempotency_key [String] Header param: + # @param idempotency_key [String] Header param: Idempotency key for the request # # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/lithic/resources/webhooks.rb b/lib/lithic/resources/webhooks.rb index fd3925b2..c54bf610 100644 --- a/lib/lithic/resources/webhooks.rb +++ b/lib/lithic/resources/webhooks.rb @@ -32,7 +32,7 @@ def parse(payload, headers:, secret: nil) # # @param payload [String] The raw webhook payload as a string # - # @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] + # @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] def parse_unsafe(payload) parsed = JSON.parse(payload, symbolize_names: true) Lithic::Internal::Type::Converter.coerce(Lithic::Models::ParsedWebhookEvent, parsed) diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb index 5040b33e..3586eca7 100644 --- a/lib/lithic/version.rb +++ b/lib/lithic/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Lithic - VERSION = "0.3.0" + VERSION = "0.4.0" end diff --git a/lithic.gemspec b/lithic.gemspec index fb28b4e3..004e5d22 100644 --- a/lithic.gemspec +++ b/lithic.gemspec @@ -24,5 +24,6 @@ Gem::Specification.new do |s| ".ignore" ] s.extra_rdoc_files = ["README.md"] + s.add_dependency "cgi" s.add_dependency "connection_pool" end diff --git a/rbi/lithic/models.rbi b/rbi/lithic/models.rbi index e4b80c79..c711f98e 100644 --- a/rbi/lithic/models.rbi +++ b/rbi/lithic/models.rbi @@ -167,6 +167,8 @@ module Lithic CardTransactionUpdatedWebhookEvent = Lithic::Models::CardTransactionUpdatedWebhookEvent + CardUpdatedWebhookEvent = Lithic::Models::CardUpdatedWebhookEvent + CardUpdateParams = Lithic::Models::CardUpdateParams CardWebProvisionParams = Lithic::Models::CardWebProvisionParams diff --git a/rbi/lithic/models/auth_rules/velocity_limit_params.rbi b/rbi/lithic/models/auth_rules/velocity_limit_params.rbi index a7fa0ed9..c9026a50 100644 --- a/rbi/lithic/models/auth_rules/velocity_limit_params.rbi +++ b/rbi/lithic/models/auth_rules/velocity_limit_params.rbi @@ -12,16 +12,6 @@ module Lithic ) end - sig { returns(Lithic::AuthRules::VelocityLimitParams::Filters) } - attr_reader :filters - - sig do - params( - filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash - ).void - end - attr_writer :filters - # Velocity over the current day since 00:00 / 12 AM in Eastern Time sig do returns( @@ -40,6 +30,18 @@ module Lithic sig { returns(Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol) } attr_accessor :scope + sig do + returns(T.nilable(Lithic::AuthRules::VelocityLimitParams::Filters)) + end + attr_reader :filters + + sig do + params( + filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash + ).void + end + attr_writer :filters + # The maximum amount of spend velocity allowed in the period in minor units (the # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this # limit will be declined. @@ -56,7 +58,6 @@ module Lithic sig do params( - filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash, period: T.any( Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash, @@ -66,16 +67,17 @@ module Lithic Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash ), scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol, + filters: Lithic::AuthRules::VelocityLimitParams::Filters::OrHash, limit_amount: T.nilable(Integer), limit_count: T.nilable(Integer) ).returns(T.attached_class) end def self.new( - filters:, # Velocity over the current day since 00:00 / 12 AM in Eastern Time period:, # The scope the velocity is calculated for scope:, + filters: nil, # The maximum amount of spend velocity allowed in the period in minor units (the # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this # limit will be declined. @@ -92,7 +94,6 @@ module Lithic sig do override.returns( { - filters: Lithic::AuthRules::VelocityLimitParams::Filters, period: T.any( Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, @@ -102,6 +103,7 @@ module Lithic Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear ), scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol, + filters: Lithic::AuthRules::VelocityLimitParams::Filters, limit_amount: T.nilable(Integer), limit_count: T.nilable(Integer) } @@ -110,6 +112,38 @@ module Lithic def to_hash end + # The scope the velocity is calculated for + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::VelocityLimitParams::Scope) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + class Filters < Lithic::Internal::Type::BaseModel OrHash = T.type_alias do @@ -307,38 +341,6 @@ module Lithic end end end - - # The scope the velocity is calculated for - module Scope - extend Lithic::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, Lithic::AuthRules::VelocityLimitParams::Scope) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CARD = - T.let( - :CARD, - Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol - ) - ACCOUNT = - T.let( - :ACCOUNT, - Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/lithic/models/card_create_params.rbi b/rbi/lithic/models/card_create_params.rbi index 7e6901cc..a3ffe2a1 100644 --- a/rbi/lithic/models/card_create_params.rbi +++ b/rbi/lithic/models/card_create_params.rbi @@ -21,8 +21,8 @@ module Lithic # Reach out at [lithic.com/contact](https://lithic.com/contact) for more # information. # - `SINGLE_USE` - Card is closed upon first successful authorization. - # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that - # successfully authorizes the card. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use # VIRTUAL instead. # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please @@ -264,6 +264,12 @@ module Lithic sig { params(state: Lithic::CardCreateParams::State::OrSymbol).void } attr_writer :state + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key + sig do params( type: Lithic::CardCreateParams::Type::OrSymbol, @@ -287,6 +293,7 @@ module Lithic spend_limit: Integer, spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, state: Lithic::CardCreateParams::State::OrSymbol, + idempotency_key: String, request_options: Lithic::RequestOptions::OrHash ).returns(T.attached_class) end @@ -301,8 +308,8 @@ module Lithic # Reach out at [lithic.com/contact](https://lithic.com/contact) for more # information. # - `SINGLE_USE` - Card is closed upon first successful authorization. - # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that - # successfully authorizes the card. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use # VIRTUAL instead. # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please @@ -430,6 +437,7 @@ module Lithic # - `PAUSED` - Card will decline authorizations, but can be resumed at a later # time. state: nil, + idempotency_key: nil, request_options: {} ) end @@ -458,6 +466,7 @@ module Lithic spend_limit: Integer, spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, state: Lithic::CardCreateParams::State::OrSymbol, + idempotency_key: String, request_options: Lithic::RequestOptions } ) @@ -475,8 +484,8 @@ module Lithic # Reach out at [lithic.com/contact](https://lithic.com/contact) for more # information. # - `SINGLE_USE` - Card is closed upon first successful authorization. - # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that - # successfully authorizes the card. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use # VIRTUAL instead. # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please diff --git a/rbi/lithic/models/card_updated_webhook_event.rbi b/rbi/lithic/models/card_updated_webhook_event.rbi new file mode 100644 index 00000000..70172f3c --- /dev/null +++ b/rbi/lithic/models/card_updated_webhook_event.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Lithic + module Models + class CardUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardUpdatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The token of the card that was updated. + sig { returns(String) } + attr_accessor :card_token + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The previous values of the fields that were updated. + sig { returns(T.anything) } + attr_accessor :previous_fields + + # The current state of the card. + sig { returns(String) } + attr_accessor :state + + sig do + params( + card_token: String, + previous_fields: T.anything, + state: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the card that was updated. + card_token:, + # The previous values of the fields that were updated. + previous_fields:, + # The current state of the card. + state:, + # The type of event that occurred. + event_type: :"card.updated" + ) + end + + sig do + override.returns( + { + card_token: String, + event_type: Symbol, + previous_fields: T.anything, + state: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_web_provision_response.rbi b/rbi/lithic/models/card_web_provision_response.rbi index fb68bbba..ad66b2d1 100644 --- a/rbi/lithic/models/card_web_provision_response.rbi +++ b/rbi/lithic/models/card_web_provision_response.rbi @@ -25,9 +25,7 @@ module Lithic # JWS object required for handoff to Apple's script. sig do returns( - T.nilable( - Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws - ) + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws ) end attr_reader :jws @@ -41,11 +39,8 @@ module Lithic attr_writer :jws # A unique identifier for the JWS object. - sig { returns(T.nilable(String)) } - attr_reader :state - - sig { params(state: String).void } - attr_writer :state + sig { returns(String) } + attr_accessor :state sig do params( @@ -56,9 +51,9 @@ module Lithic end def self.new( # JWS object required for handoff to Apple's script. - jws: nil, + jws:, # A unique identifier for the JWS object. - state: nil + state: ) end diff --git a/rbi/lithic/models/event.rbi b/rbi/lithic/models/event.rbi index 45298700..6cd21bd3 100644 --- a/rbi/lithic/models/event.rbi +++ b/rbi/lithic/models/event.rbi @@ -40,6 +40,7 @@ module Lithic # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -162,6 +163,7 @@ module Lithic # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -280,6 +282,7 @@ module Lithic # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -423,6 +426,8 @@ module Lithic T.let(:"card.renewed", Lithic::Event::EventType::TaggedSymbol) CARD_SHIPPED = T.let(:"card.shipped", Lithic::Event::EventType::TaggedSymbol) + CARD_UPDATED = + T.let(:"card.updated", Lithic::Event::EventType::TaggedSymbol) DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = T.let( :"digital_wallet.tokenization_approval_request", diff --git a/rbi/lithic/models/event_list_params.rbi b/rbi/lithic/models/event_list_params.rbi index 9464b5e1..e64d0e7e 100644 --- a/rbi/lithic/models/event_list_params.rbi +++ b/rbi/lithic/models/event_list_params.rbi @@ -149,6 +149,7 @@ module Lithic # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -311,6 +312,11 @@ module Lithic :"card.shipped", Lithic::EventListParams::EventType::TaggedSymbol ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = T.let( :"digital_wallet.tokenization_approval_request", diff --git a/rbi/lithic/models/event_subscription.rbi b/rbi/lithic/models/event_subscription.rbi index 8886afe0..3a80e8bb 100644 --- a/rbi/lithic/models/event_subscription.rbi +++ b/rbi/lithic/models/event_subscription.rbi @@ -97,6 +97,7 @@ module Lithic # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -259,6 +260,11 @@ module Lithic :"card.shipped", Lithic::EventSubscription::EventType::TaggedSymbol ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = T.let( :"digital_wallet.tokenization_approval_request", diff --git a/rbi/lithic/models/events/subscription_create_params.rbi b/rbi/lithic/models/events/subscription_create_params.rbi index 56e52a46..3ba86daa 100644 --- a/rbi/lithic/models/events/subscription_create_params.rbi +++ b/rbi/lithic/models/events/subscription_create_params.rbi @@ -124,6 +124,7 @@ module Lithic # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -288,6 +289,11 @@ module Lithic :"card.shipped", Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = T.let( :"digital_wallet.tokenization_approval_request", diff --git a/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi b/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi index 866adaeb..9d3ce05d 100644 --- a/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi +++ b/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi @@ -152,6 +152,11 @@ module Lithic :"card.shipped", Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = T.let( :"digital_wallet.tokenization_approval_request", diff --git a/rbi/lithic/models/events/subscription_update_params.rbi b/rbi/lithic/models/events/subscription_update_params.rbi index 1ec917c5..56accacb 100644 --- a/rbi/lithic/models/events/subscription_update_params.rbi +++ b/rbi/lithic/models/events/subscription_update_params.rbi @@ -124,6 +124,7 @@ module Lithic # - card.reissued: Occurs when a card is reissued. # - card.renewed: Occurs when a card is renewed. # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. # - digital_wallet.tokenization_approval_request: Occurs when a tokenization # approval request is made. This event will be deprecated in the future. We # recommend using `tokenization.approval_request` instead. @@ -288,6 +289,11 @@ module Lithic :"card.shipped", Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = T.let( :"digital_wallet.tokenization_approval_request", diff --git a/rbi/lithic/models/financial_transaction.rbi b/rbi/lithic/models/financial_transaction.rbi index ea7aa4f6..a9489978 100644 --- a/rbi/lithic/models/financial_transaction.rbi +++ b/rbi/lithic/models/financial_transaction.rbi @@ -41,8 +41,10 @@ module Lithic attr_accessor :events # Pending amount of the transaction in the currency's smallest unit (e.g., cents), - # including any acquirer fees. The value of this field will go to zero over time - # once the financial transaction is settled. + # including any acquirer fees. + # + # The value of this field will go to zero over time once the financial transaction + # is settled. sig { returns(Integer) } attr_accessor :pending_amount @@ -109,8 +111,10 @@ module Lithic # A list of all financial events that have modified this financial transaction. events:, # Pending amount of the transaction in the currency's smallest unit (e.g., cents), - # including any acquirer fees. The value of this field will go to zero over time - # once the financial transaction is settled. + # including any acquirer fees. + # + # The value of this field will go to zero over time once the financial transaction + # is settled. pending_amount:, # APPROVED transactions were successful while DECLINED transactions were declined # by user, Lithic, or the network. diff --git a/rbi/lithic/models/non_pci_card.rbi b/rbi/lithic/models/non_pci_card.rbi index 3a77e87e..d240969a 100644 --- a/rbi/lithic/models/non_pci_card.rbi +++ b/rbi/lithic/models/non_pci_card.rbi @@ -81,11 +81,10 @@ module Lithic # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe # functionality. _ `SINGLE_USE` - Card is closed upon first successful - # authorization. _ `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first - # merchant that successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ - # Similar behavior to VIRTUAL cards, please use VIRTUAL instead. _ - # `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use - # VIRTUAL instead. + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. sig { returns(Lithic::NonPCICard::Type::TaggedSymbol) } attr_accessor :type @@ -293,11 +292,10 @@ module Lithic # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe # functionality. _ `SINGLE_USE` - Card is closed upon first successful - # authorization. _ `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first - # merchant that successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ - # Similar behavior to VIRTUAL cards, please use VIRTUAL instead. _ - # `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use - # VIRTUAL instead. + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. type:, # List of identifiers for the Auth Rule(s) that are applied on the card. This # field is deprecated and will no longer be populated in the `Card` object. The @@ -614,11 +612,10 @@ module Lithic # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe # functionality. _ `SINGLE_USE` - Card is closed upon first successful - # authorization. _ `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first - # merchant that successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ - # Similar behavior to VIRTUAL cards, please use VIRTUAL instead. _ - # `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use - # VIRTUAL instead. + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. module Type extend Lithic::Internal::Type::Enum diff --git a/rbi/lithic/models/parsed_webhook_event.rbi b/rbi/lithic/models/parsed_webhook_event.rbi index e667d775..5265312d 100644 --- a/rbi/lithic/models/parsed_webhook_event.rbi +++ b/rbi/lithic/models/parsed_webhook_event.rbi @@ -26,6 +26,7 @@ module Lithic Lithic::CardRenewedWebhookEvent, Lithic::CardReissuedWebhookEvent, Lithic::CardShippedWebhookEvent, + Lithic::CardUpdatedWebhookEvent, Lithic::CardTransactionUpdatedWebhookEvent, Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, diff --git a/rbi/lithic/models/payment.rbi b/rbi/lithic/models/payment.rbi index 523b96dc..28dd76eb 100644 --- a/rbi/lithic/models/payment.rbi +++ b/rbi/lithic/models/payment.rbi @@ -1061,8 +1061,11 @@ module Lithic T.let(:WIRE_OUTBOUND_PAYMENT, Lithic::Payment::Type::TaggedSymbol) WIRE_OUTBOUND_ADMIN = T.let(:WIRE_OUTBOUND_ADMIN, Lithic::Payment::Type::TaggedSymbol) - WIRE_DRAWDOWN_REQUEST = - T.let(:WIRE_DRAWDOWN_REQUEST, Lithic::Payment::Type::TaggedSymbol) + WIRE_INBOUND_DRAWDOWN_REQUEST = + T.let( + :WIRE_INBOUND_DRAWDOWN_REQUEST, + Lithic::Payment::Type::TaggedSymbol + ) sig { override.returns(T::Array[Lithic::Payment::Type::TaggedSymbol]) } def self.values diff --git a/rbi/lithic/models/transaction.rbi b/rbi/lithic/models/transaction.rbi index 8135ae5e..3a563dc2 100644 --- a/rbi/lithic/models/transaction.rbi +++ b/rbi/lithic/models/transaction.rbi @@ -124,6 +124,11 @@ module Lithic sig { returns(Lithic::Transaction::Status::TaggedSymbol) } attr_accessor :status + # Key-value pairs for tagging resources. Tags allow you to associate arbitrary + # metadata with a resource for your own purposes. + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :tags + sig { returns(T.nilable(Lithic::TokenInfo)) } attr_reader :token_info @@ -166,6 +171,7 @@ module Lithic result: Lithic::Transaction::Result::OrSymbol, settled_amount: Integer, status: Lithic::Transaction::Status::OrSymbol, + tags: T::Hash[Symbol, String], token_info: T.nilable(Lithic::TokenInfo::OrHash), updated: Time, events: T::Array[Lithic::Transaction::Event::OrHash] @@ -224,6 +230,9 @@ module Lithic settled_amount:, # Status of the transaction. status:, + # Key-value pairs for tagging resources. Tags allow you to associate arbitrary + # metadata with a resource for your own purposes. + tags:, token_info:, # Date and time when the transaction last updated. UTC time zone. updated:, @@ -258,6 +267,7 @@ module Lithic result: Lithic::Transaction::Result::TaggedSymbol, settled_amount: Integer, status: Lithic::Transaction::Status::TaggedSymbol, + tags: T::Hash[Symbol, String], token_info: T.nilable(Lithic::TokenInfo), updated: Time, events: T::Array[Lithic::Transaction::Event] diff --git a/rbi/lithic/resources/cards.rbi b/rbi/lithic/resources/cards.rbi index 733e5ad2..8aa66d9e 100644 --- a/rbi/lithic/resources/cards.rbi +++ b/rbi/lithic/resources/cards.rbi @@ -34,11 +34,12 @@ module Lithic spend_limit: Integer, spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, state: Lithic::CardCreateParams::State::OrSymbol, + idempotency_key: String, request_options: Lithic::RequestOptions::OrHash ).returns(Lithic::Card) end def create( - # Card types: + # Body param: Card types: # # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital # wallet like Apple Pay or Google Pay (if the card program is digital @@ -48,65 +49,67 @@ module Lithic # Reach out at [lithic.com/contact](https://lithic.com/contact) for more # information. # - `SINGLE_USE` - Card is closed upon first successful authorization. - # - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that - # successfully authorizes the card. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use # VIRTUAL instead. # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please # use VIRTUAL instead. type:, - # Globally unique identifier for the account that the card will be associated - # with. Required for programs enrolling users using the + # Body param: Globally unique identifier for the account that the card will be + # associated with. Required for programs enrolling users using the # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). # See [Managing Your Program](doc:managing-your-program) for more information. account_token: nil, - # Globally unique identifier for an existing bulk order to associate this card - # with. When specified, the card will be added to the bulk order for batch - # shipment. Only applicable to cards of type PHYSICAL + # Body param: Globally unique identifier for an existing bulk order to associate + # this card with. When specified, the card will be added to the bulk order for + # batch shipment. Only applicable to cards of type PHYSICAL bulk_order_token: nil, - # For card programs with more than one BIN range. This must be configured with - # Lithic before use. Identifies the card program/BIN range under which to create - # the card. If omitted, will utilize the program's default `card_program_token`. - # In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # Body param: For card programs with more than one BIN range. This must be + # configured with Lithic before use. Identifies the card program/BIN range under + # which to create the card. If omitted, will utilize the program's default + # `card_program_token`. In Sandbox, use 00000000-0000-0000-1000-000000000000 and # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card # programs. card_program_token: nil, + # Body param carrier: nil, - # Specifies the digital card art to be displayed in the user’s digital wallet - # after tokenization. This artwork must be approved by Mastercard and configured - # by Lithic to use. See + # Body param: Specifies the digital card art to be displayed in the user’s digital + # wallet after tokenization. This artwork must be approved by Mastercard and + # configured by Lithic to use. See # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). digital_card_art_token: nil, - # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, - # an expiration date will be generated. + # Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` + # is provided, an expiration date will be generated. exp_month: nil, - # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is - # provided, an expiration date will be generated. + # Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` + # is provided, an expiration date will be generated. exp_year: nil, - # Friendly name to identify the card. + # Body param: Friendly name to identify the card. memo: nil, - # Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and - # `VIRTUAL`. See + # Body param: Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` + # and `VIRTUAL`. See # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). pin: nil, - # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic - # before use. Specifies the configuration (i.e., physical card art) that the card - # should be manufactured with. + # Body param: Only applicable to cards of type `PHYSICAL`. This must be configured + # with Lithic before use. Specifies the configuration (i.e., physical card art) + # that the card should be manufactured with. product_id: nil, - # Restricted field limited to select use cases. Lithic will reach out directly if - # this field should be used. Globally unique identifier for the replacement card's - # account. If this field is specified, `replacement_for` must also be specified. - # If `replacement_for` is specified and this field is omitted, the replacement - # card's account will be inferred from the card being replaced. + # Body param: Restricted field limited to select use cases. Lithic will reach out + # directly if this field should be used. Globally unique identifier for the + # replacement card's account. If this field is specified, `replacement_for` must + # also be specified. If `replacement_for` is specified and this field is omitted, + # the replacement card's account will be inferred from the card being replaced. replacement_account_token: nil, - # Additional context or information related to the card that this card will - # replace. + # Body param: Additional context or information related to the card that this card + # will replace. replacement_comment: nil, - # Globally unique identifier for the card that this card will replace. If the card - # type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is - # `VIRTUAL` it will be replaced by a `VIRTUAL` card. + # Body param: Globally unique identifier for the card that this card will replace. + # If the card type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the + # card type is `VIRTUAL` it will be replaced by a `VIRTUAL` card. replacement_for: nil, - # Card state substatus values for the card that this card will replace: + # Body param: Card state substatus values for the card that this card will + # replace: # # - `LOST` - The physical card is no longer in the cardholder's possession due to # being lost or never received by the cardholder. @@ -134,9 +137,10 @@ module Lithic # - `OTHER` - The reason for the status does not fall into any of the above # categories. A comment should be provided to specify the reason. replacement_substatus: nil, + # Body param shipping_address: nil, - # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of - # options besides `STANDARD` require additional permissions. + # Body param: Shipping method for the card. Only applies to cards of type + # PHYSICAL. Use of options besides `STANDARD` require additional permissions. # # - `STANDARD` - USPS regular mail or similar international option, with no # tracking @@ -151,13 +155,13 @@ module Lithic # or similar international option, with tracking # - `BULK_EXPEDITED` - Bulk shipment with Expedited shipping shipping_method: nil, - # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a - # $1,000 limit). Transaction requests above the spend limit will be declined. Note - # that a spend limit of 0 is effectively no limit, and should only be used to - # reset or remove a prior limit. Only a limit of 1 or above will result in - # declined transactions due to checks against the card limit. + # Body param: Amount (in cents) to limit approved authorizations (e.g. 100000 + # would be a $1,000 limit). Transaction requests above the spend limit will be + # declined. Note that a spend limit of 0 is effectively no limit, and should only + # be used to reset or remove a prior limit. Only a limit of 1 or above will result + # in declined transactions due to checks against the card limit. spend_limit: nil, - # Spend limit duration values: + # Body param: Spend limit duration values: # # - `ANNUALLY` - Card will authorize transactions up to spend limit for the # trailing year. @@ -170,13 +174,15 @@ module Lithic # - `TRANSACTION` - Card will authorize multiple transactions if each individual # transaction is under the spend limit. spend_limit_duration: nil, - # Card state values: + # Body param: Card state values: # # - `OPEN` - Card will approve authorizations (if they match card and account # parameters). # - `PAUSED` - Card will decline authorizations, but can be resumed at a later # time. state: nil, + # Header param: Idempotency key for the request + idempotency_key: nil, request_options: {} ) end diff --git a/rbi/lithic/resources/financial_accounts.rbi b/rbi/lithic/resources/financial_accounts.rbi index 66e0ac9e..fddebdd4 100644 --- a/rbi/lithic/resources/financial_accounts.rbi +++ b/rbi/lithic/resources/financial_accounts.rbi @@ -32,15 +32,15 @@ module Lithic ).returns(Lithic::FinancialAccount) end def create( - # Body param: + # Body param nickname:, - # Body param: + # Body param type:, - # Body param: + # Body param account_token: nil, - # Body param: + # Body param is_for_benefit_of: nil, - # Header param: + # Header param: Idempotency key for the request idempotency_key: nil, request_options: {} ) diff --git a/rbi/lithic/resources/webhooks.rbi b/rbi/lithic/resources/webhooks.rbi index 767a2dfd..61f48021 100644 --- a/rbi/lithic/resources/webhooks.rbi +++ b/rbi/lithic/resources/webhooks.rbi @@ -8,7 +8,68 @@ module Lithic payload: String, headers: T::Hash[String, String], secret: T.nilable(String) - ).returns(Lithic::ParsedWebhookEvent::Variants) + ).returns( + T.any( + Lithic::AccountHolderCreatedWebhookEvent, + Lithic::ParsedWebhookEvent::KYBPayload, + Lithic::ParsedWebhookEvent::KYCPayload, + Lithic::ParsedWebhookEvent::LegacyPayload, + Lithic::AccountHolderVerificationWebhookEvent, + Lithic::AccountHolderDocumentUpdatedWebhookEvent, + Lithic::CardAuthorizationApprovalRequestWebhookEvent, + Lithic::TokenizationDecisioningRequestWebhookEvent, + Lithic::AuthRulesBacktestReportCreatedWebhookEvent, + Lithic::BalanceUpdatedWebhookEvent, + Lithic::BookTransferTransactionCreatedWebhookEvent, + Lithic::BookTransferTransactionUpdatedWebhookEvent, + Lithic::CardCreatedWebhookEvent, + Lithic::CardConvertedWebhookEvent, + Lithic::CardRenewedWebhookEvent, + Lithic::CardReissuedWebhookEvent, + Lithic::CardShippedWebhookEvent, + Lithic::CardUpdatedWebhookEvent, + Lithic::CardTransactionUpdatedWebhookEvent, + Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, + Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent, + Lithic::DigitalWalletTokenizationResultWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::DigitalWalletTokenizationUpdatedWebhookEvent, + Lithic::DisputeUpdatedWebhookEvent, + Lithic::DisputeEvidenceUploadFailedWebhookEvent, + Lithic::ExternalBankAccountCreatedWebhookEvent, + Lithic::ExternalBankAccountUpdatedWebhookEvent, + Lithic::ExternalPaymentCreatedWebhookEvent, + Lithic::ExternalPaymentUpdatedWebhookEvent, + Lithic::FinancialAccountCreatedWebhookEvent, + Lithic::FinancialAccountUpdatedWebhookEvent, + Lithic::FundingEventCreatedWebhookEvent, + Lithic::LoanTapeCreatedWebhookEvent, + Lithic::LoanTapeUpdatedWebhookEvent, + Lithic::ManagementOperationCreatedWebhookEvent, + Lithic::ManagementOperationUpdatedWebhookEvent, + Lithic::InternalTransactionCreatedWebhookEvent, + Lithic::InternalTransactionUpdatedWebhookEvent, + Lithic::NetworkTotalCreatedWebhookEvent, + Lithic::NetworkTotalUpdatedWebhookEvent, + Lithic::PaymentTransactionCreatedWebhookEvent, + Lithic::PaymentTransactionUpdatedWebhookEvent, + Lithic::SettlementReportUpdatedWebhookEvent, + Lithic::StatementsCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent, + Lithic::TokenizationApprovalRequestWebhookEvent, + Lithic::TokenizationResultWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::TokenizationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationApprovalRequestWebhookEvent, + Lithic::DisputeTransactionCreatedWebhookEvent, + Lithic::DisputeTransactionUpdatedWebhookEvent + ) + ) end def parse(payload, headers:, secret: nil) end diff --git a/sig/lithic/models.rbs b/sig/lithic/models.rbs index 9a292f5d..51887173 100644 --- a/sig/lithic/models.rbs +++ b/sig/lithic/models.rbs @@ -145,6 +145,8 @@ module Lithic class CardTransactionUpdatedWebhookEvent = Lithic::Models::CardTransactionUpdatedWebhookEvent + class CardUpdatedWebhookEvent = Lithic::Models::CardUpdatedWebhookEvent + class CardUpdateParams = Lithic::Models::CardUpdateParams class CardWebProvisionParams = Lithic::Models::CardWebProvisionParams diff --git a/sig/lithic/models/auth_rules/velocity_limit_params.rbs b/sig/lithic/models/auth_rules/velocity_limit_params.rbs index 709c43fb..d85272ca 100644 --- a/sig/lithic/models/auth_rules/velocity_limit_params.rbs +++ b/sig/lithic/models/auth_rules/velocity_limit_params.rbs @@ -3,40 +3,55 @@ module Lithic module AuthRules type velocity_limit_params = { - filters: Lithic::AuthRules::VelocityLimitParams::Filters, period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + filters: Lithic::AuthRules::VelocityLimitParams::Filters, limit_amount: Integer?, limit_count: Integer? } class VelocityLimitParams < Lithic::Internal::Type::BaseModel - attr_accessor filters: Lithic::AuthRules::VelocityLimitParams::Filters - attr_accessor period: Lithic::Models::AuthRules::velocity_limit_period attr_accessor scope: Lithic::Models::AuthRules::VelocityLimitParams::scope + attr_reader filters: Lithic::AuthRules::VelocityLimitParams::Filters? + + def filters=: ( + Lithic::AuthRules::VelocityLimitParams::Filters + ) -> Lithic::AuthRules::VelocityLimitParams::Filters + attr_accessor limit_amount: Integer? attr_accessor limit_count: Integer? def initialize: ( - filters: Lithic::AuthRules::VelocityLimitParams::Filters, period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + ?filters: Lithic::AuthRules::VelocityLimitParams::Filters, ?limit_amount: Integer?, ?limit_count: Integer? ) -> void def to_hash: -> { - filters: Lithic::AuthRules::VelocityLimitParams::Filters, period: Lithic::Models::AuthRules::velocity_limit_period, scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + filters: Lithic::AuthRules::VelocityLimitParams::Filters, limit_amount: Integer?, limit_count: Integer? } + type scope = :CARD | :ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::scope] + end + type filters = { exclude_countries: ::Array[String]?, @@ -112,17 +127,6 @@ module Lithic def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::Filters::include_pan_entry_mode] end end - - type scope = :CARD | :ACCOUNT - - module Scope - extend Lithic::Internal::Type::Enum - - CARD: :CARD - ACCOUNT: :ACCOUNT - - def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::scope] - end end end end diff --git a/sig/lithic/models/card_create_params.rbs b/sig/lithic/models/card_create_params.rbs index edc57451..8ea307b4 100644 --- a/sig/lithic/models/card_create_params.rbs +++ b/sig/lithic/models/card_create_params.rbs @@ -21,7 +21,8 @@ module Lithic shipping_method: Lithic::Models::CardCreateParams::shipping_method, spend_limit: Integer, spend_limit_duration: Lithic::Models::spend_limit_duration, - state: Lithic::Models::CardCreateParams::state + state: Lithic::Models::CardCreateParams::state, + idempotency_key: String } & Lithic::Internal::Type::request_parameters @@ -117,6 +118,10 @@ module Lithic Lithic::Models::CardCreateParams::state ) -> Lithic::Models::CardCreateParams::state + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + def initialize: ( type: Lithic::Models::CardCreateParams::type_, ?account_token: String, @@ -138,6 +143,7 @@ module Lithic ?spend_limit: Integer, ?spend_limit_duration: Lithic::Models::spend_limit_duration, ?state: Lithic::Models::CardCreateParams::state, + ?idempotency_key: String, ?request_options: Lithic::request_opts ) -> void @@ -162,6 +168,7 @@ module Lithic spend_limit: Integer, spend_limit_duration: Lithic::Models::spend_limit_duration, state: Lithic::Models::CardCreateParams::state, + idempotency_key: String, request_options: Lithic::RequestOptions } diff --git a/sig/lithic/models/card_updated_webhook_event.rbs b/sig/lithic/models/card_updated_webhook_event.rbs new file mode 100644 index 00000000..ec768914 --- /dev/null +++ b/sig/lithic/models/card_updated_webhook_event.rbs @@ -0,0 +1,35 @@ +module Lithic + module Models + type card_updated_webhook_event = + { + card_token: String, + event_type: :"card.updated", + previous_fields: top, + state: String + } + + class CardUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor card_token: String + + attr_accessor event_type: :"card.updated" + + attr_accessor previous_fields: top + + attr_accessor state: String + + def initialize: ( + card_token: String, + previous_fields: top, + state: String, + ?event_type: :"card.updated" + ) -> void + + def to_hash: -> { + card_token: String, + event_type: :"card.updated", + previous_fields: top, + state: String + } + end + end +end diff --git a/sig/lithic/models/card_web_provision_response.rbs b/sig/lithic/models/card_web_provision_response.rbs index 59537141..2f4fa578 100644 --- a/sig/lithic/models/card_web_provision_response.rbs +++ b/sig/lithic/models/card_web_provision_response.rbs @@ -14,19 +14,13 @@ module Lithic } class AppleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel - attr_reader jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws? + attr_accessor jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws - def jws=: ( - Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws - ) -> Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws - - attr_reader state: String? - - def state=: (String) -> String + attr_accessor state: String def initialize: ( - ?jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, - ?state: String + jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, + state: String ) -> void def to_hash: -> { diff --git a/sig/lithic/models/event.rbs b/sig/lithic/models/event.rbs index 78790bab..c2c6ce53 100644 --- a/sig/lithic/models/event.rbs +++ b/sig/lithic/models/event.rbs @@ -48,6 +48,7 @@ module Lithic | :"card.reissued" | :"card.renewed" | :"card.shipped" + | :"card.updated" | :"digital_wallet.tokenization_approval_request" | :"digital_wallet.tokenization_result" | :"digital_wallet.tokenization_two_factor_authentication_code" @@ -104,6 +105,7 @@ module Lithic CARD_REISSUED: :"card.reissued" CARD_RENEWED: :"card.renewed" CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" diff --git a/sig/lithic/models/event_list_params.rbs b/sig/lithic/models/event_list_params.rbs index 30a319db..35d0111e 100644 --- a/sig/lithic/models/event_list_params.rbs +++ b/sig/lithic/models/event_list_params.rbs @@ -85,6 +85,7 @@ module Lithic | :"card.reissued" | :"card.renewed" | :"card.shipped" + | :"card.updated" | :"digital_wallet.tokenization_approval_request" | :"digital_wallet.tokenization_result" | :"digital_wallet.tokenization_two_factor_authentication_code" @@ -141,6 +142,7 @@ module Lithic CARD_REISSUED: :"card.reissued" CARD_RENEWED: :"card.renewed" CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" diff --git a/sig/lithic/models/event_subscription.rbs b/sig/lithic/models/event_subscription.rbs index c9299784..525f1c37 100644 --- a/sig/lithic/models/event_subscription.rbs +++ b/sig/lithic/models/event_subscription.rbs @@ -53,6 +53,7 @@ module Lithic | :"card.reissued" | :"card.renewed" | :"card.shipped" + | :"card.updated" | :"digital_wallet.tokenization_approval_request" | :"digital_wallet.tokenization_result" | :"digital_wallet.tokenization_two_factor_authentication_code" @@ -109,6 +110,7 @@ module Lithic CARD_REISSUED: :"card.reissued" CARD_RENEWED: :"card.renewed" CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" diff --git a/sig/lithic/models/events/subscription_create_params.rbs b/sig/lithic/models/events/subscription_create_params.rbs index 72dab4ec..f6cc4f03 100644 --- a/sig/lithic/models/events/subscription_create_params.rbs +++ b/sig/lithic/models/events/subscription_create_params.rbs @@ -63,6 +63,7 @@ module Lithic | :"card.reissued" | :"card.renewed" | :"card.shipped" + | :"card.updated" | :"digital_wallet.tokenization_approval_request" | :"digital_wallet.tokenization_result" | :"digital_wallet.tokenization_two_factor_authentication_code" @@ -119,6 +120,7 @@ module Lithic CARD_REISSUED: :"card.reissued" CARD_RENEWED: :"card.renewed" CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" diff --git a/sig/lithic/models/events/subscription_send_simulated_example_params.rbs b/sig/lithic/models/events/subscription_send_simulated_example_params.rbs index f09cd4e0..f4ce767e 100644 --- a/sig/lithic/models/events/subscription_send_simulated_example_params.rbs +++ b/sig/lithic/models/events/subscription_send_simulated_example_params.rbs @@ -44,6 +44,7 @@ module Lithic | :"card.reissued" | :"card.renewed" | :"card.shipped" + | :"card.updated" | :"digital_wallet.tokenization_approval_request" | :"digital_wallet.tokenization_result" | :"digital_wallet.tokenization_two_factor_authentication_code" @@ -100,6 +101,7 @@ module Lithic CARD_REISSUED: :"card.reissued" CARD_RENEWED: :"card.renewed" CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" diff --git a/sig/lithic/models/events/subscription_update_params.rbs b/sig/lithic/models/events/subscription_update_params.rbs index a80273bf..f2821310 100644 --- a/sig/lithic/models/events/subscription_update_params.rbs +++ b/sig/lithic/models/events/subscription_update_params.rbs @@ -63,6 +63,7 @@ module Lithic | :"card.reissued" | :"card.renewed" | :"card.shipped" + | :"card.updated" | :"digital_wallet.tokenization_approval_request" | :"digital_wallet.tokenization_result" | :"digital_wallet.tokenization_two_factor_authentication_code" @@ -119,6 +120,7 @@ module Lithic CARD_REISSUED: :"card.reissued" CARD_RENEWED: :"card.renewed" CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" diff --git a/sig/lithic/models/parsed_webhook_event.rbs b/sig/lithic/models/parsed_webhook_event.rbs index b80501d8..6b901f7b 100644 --- a/sig/lithic/models/parsed_webhook_event.rbs +++ b/sig/lithic/models/parsed_webhook_event.rbs @@ -18,6 +18,7 @@ module Lithic | Lithic::CardRenewedWebhookEvent | Lithic::CardReissuedWebhookEvent | Lithic::CardShippedWebhookEvent + | Lithic::CardUpdatedWebhookEvent | Lithic::CardTransactionUpdatedWebhookEvent | Lithic::CardTransactionEnhancedDataCreatedWebhookEvent | Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent diff --git a/sig/lithic/models/payment.rbs b/sig/lithic/models/payment.rbs index 3fbdbd5b..e908b268 100644 --- a/sig/lithic/models/payment.rbs +++ b/sig/lithic/models/payment.rbs @@ -524,7 +524,7 @@ module Lithic | :WIRE_INBOUND_ADMIN | :WIRE_OUTBOUND_PAYMENT | :WIRE_OUTBOUND_ADMIN - | :WIRE_DRAWDOWN_REQUEST + | :WIRE_INBOUND_DRAWDOWN_REQUEST module Type extend Lithic::Internal::Type::Enum @@ -537,7 +537,7 @@ module Lithic WIRE_INBOUND_ADMIN: :WIRE_INBOUND_ADMIN WIRE_OUTBOUND_PAYMENT: :WIRE_OUTBOUND_PAYMENT WIRE_OUTBOUND_ADMIN: :WIRE_OUTBOUND_ADMIN - WIRE_DRAWDOWN_REQUEST: :WIRE_DRAWDOWN_REQUEST + WIRE_INBOUND_DRAWDOWN_REQUEST: :WIRE_INBOUND_DRAWDOWN_REQUEST def self?.values: -> ::Array[Lithic::Models::Payment::type_] end diff --git a/sig/lithic/models/transaction.rbs b/sig/lithic/models/transaction.rbs index ab7e3025..40dd25b9 100644 --- a/sig/lithic/models/transaction.rbs +++ b/sig/lithic/models/transaction.rbs @@ -25,6 +25,7 @@ module Lithic result: Lithic::Models::Transaction::result, settled_amount: Integer, status: Lithic::Models::Transaction::status, + tags: ::Hash[Symbol, String], token_info: Lithic::TokenInfo?, updated: Time, events: ::Array[Lithic::Transaction::Event] @@ -77,6 +78,8 @@ module Lithic attr_accessor status: Lithic::Models::Transaction::status + attr_accessor tags: ::Hash[Symbol, String] + attr_accessor token_info: Lithic::TokenInfo? attr_accessor updated: Time @@ -111,6 +114,7 @@ module Lithic result: Lithic::Models::Transaction::result, settled_amount: Integer, status: Lithic::Models::Transaction::status, + tags: ::Hash[Symbol, String], token_info: Lithic::TokenInfo?, updated: Time, ?events: ::Array[Lithic::Transaction::Event] @@ -140,6 +144,7 @@ module Lithic result: Lithic::Models::Transaction::result, settled_amount: Integer, status: Lithic::Models::Transaction::status, + tags: ::Hash[Symbol, String], token_info: Lithic::TokenInfo?, updated: Time, events: ::Array[Lithic::Transaction::Event] diff --git a/sig/lithic/resources/cards.rbs b/sig/lithic/resources/cards.rbs index ef8d2773..b8288b8f 100644 --- a/sig/lithic/resources/cards.rbs +++ b/sig/lithic/resources/cards.rbs @@ -26,6 +26,7 @@ module Lithic ?spend_limit: Integer, ?spend_limit_duration: Lithic::Models::spend_limit_duration, ?state: Lithic::Models::CardCreateParams::state, + ?idempotency_key: String, ?request_options: Lithic::request_opts ) -> Lithic::Card diff --git a/sig/lithic/resources/webhooks.rbs b/sig/lithic/resources/webhooks.rbs index 66669a57..f00a481a 100644 --- a/sig/lithic/resources/webhooks.rbs +++ b/sig/lithic/resources/webhooks.rbs @@ -5,7 +5,64 @@ module Lithic String payload, headers: Hash[String, String], ?secret: String? - ) -> Lithic::Models::parsed_webhook_event + ) -> (Lithic::AccountHolderCreatedWebhookEvent + | Lithic::ParsedWebhookEvent::KYBPayload + | Lithic::ParsedWebhookEvent::KYCPayload + | Lithic::ParsedWebhookEvent::LegacyPayload + | Lithic::AccountHolderVerificationWebhookEvent + | Lithic::AccountHolderDocumentUpdatedWebhookEvent + | Lithic::CardAuthorizationApprovalRequestWebhookEvent + | Lithic::TokenizationDecisioningRequestWebhookEvent + | Lithic::AuthRulesBacktestReportCreatedWebhookEvent + | Lithic::BalanceUpdatedWebhookEvent + | Lithic::BookTransferTransactionCreatedWebhookEvent + | Lithic::BookTransferTransactionUpdatedWebhookEvent + | Lithic::CardCreatedWebhookEvent + | Lithic::CardConvertedWebhookEvent + | Lithic::CardRenewedWebhookEvent + | Lithic::CardReissuedWebhookEvent + | Lithic::CardShippedWebhookEvent + | Lithic::CardUpdatedWebhookEvent + | Lithic::CardTransactionUpdatedWebhookEvent + | Lithic::CardTransactionEnhancedDataCreatedWebhookEvent + | Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent + | Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent + | Lithic::DigitalWalletTokenizationResultWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::DigitalWalletTokenizationUpdatedWebhookEvent + | Lithic::DisputeUpdatedWebhookEvent + | Lithic::DisputeEvidenceUploadFailedWebhookEvent + | Lithic::ExternalBankAccountCreatedWebhookEvent + | Lithic::ExternalBankAccountUpdatedWebhookEvent + | Lithic::ExternalPaymentCreatedWebhookEvent + | Lithic::ExternalPaymentUpdatedWebhookEvent + | Lithic::FinancialAccountCreatedWebhookEvent + | Lithic::FinancialAccountUpdatedWebhookEvent + | Lithic::FundingEventCreatedWebhookEvent + | Lithic::LoanTapeCreatedWebhookEvent + | Lithic::LoanTapeUpdatedWebhookEvent + | Lithic::ManagementOperationCreatedWebhookEvent + | Lithic::ManagementOperationUpdatedWebhookEvent + | Lithic::InternalTransactionCreatedWebhookEvent + | Lithic::InternalTransactionUpdatedWebhookEvent + | Lithic::NetworkTotalCreatedWebhookEvent + | Lithic::NetworkTotalUpdatedWebhookEvent + | Lithic::PaymentTransactionCreatedWebhookEvent + | Lithic::PaymentTransactionUpdatedWebhookEvent + | Lithic::SettlementReportUpdatedWebhookEvent + | Lithic::StatementsCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationUpdatedWebhookEvent + | Lithic::ThreeDSAuthenticationChallengeWebhookEvent + | Lithic::TokenizationApprovalRequestWebhookEvent + | Lithic::TokenizationResultWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::TokenizationUpdatedWebhookEvent + | Lithic::ThreeDSAuthenticationApprovalRequestWebhookEvent + | Lithic::DisputeTransactionCreatedWebhookEvent + | Lithic::DisputeTransactionUpdatedWebhookEvent) def parse_unsafe: (String payload) -> Lithic::Models::parsed_webhook_event diff --git a/test/lithic/resources/transactions_test.rb b/test/lithic/resources/transactions_test.rb index f1940a0a..8d0ba968 100644 --- a/test/lithic/resources/transactions_test.rb +++ b/test/lithic/resources/transactions_test.rb @@ -35,6 +35,7 @@ def test_retrieve result: Lithic::Transaction::Result, settled_amount: Integer, status: Lithic::Transaction::Status, + tags: ^(Lithic::Internal::Type::HashOf[String]), token_info: Lithic::TokenInfo | nil, updated: Time, events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event]) | nil @@ -81,6 +82,7 @@ def test_list result: Lithic::Transaction::Result, settled_amount: Integer, status: Lithic::Transaction::Status, + tags: ^(Lithic::Internal::Type::HashOf[String]), token_info: Lithic::TokenInfo | nil, updated: Time, events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event]) | nil