diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6d78745c..091cfb12 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.0" + ".": "0.10.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index b655e630..b52f2358 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 190 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-5bb8d2bedef02f07498de3f252fa6da1393d2fb59f727b05828804cea9aded30.yml -openapi_spec_hash: d1f260252b3bb7ebc77fa7134db6c65d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-8aac2690599ec7343fab3957433e94ebf63ac1186c753e00dff85b32f4d6e88c.yml +openapi_spec_hash: 84da9d0725e41cb5661c6ed6661ce101 config_hash: 400b9afe0f7f7b7d96177d05950775f9 diff --git a/CHANGELOG.md b/CHANGELOG.md index f0314a87..d1a1367a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## 0.10.0 (2026-03-20) + +Full Changelog: [v0.9.0...v0.10.0](https://github.com/lithic-com/lithic-ruby/compare/v0.9.0...v0.10.0) + +### Features + +* **api:** Add CARD_AGE and ACCOUNT_AGE attributes to authorization rules ([b5bc545](https://github.com/lithic-com/lithic-ruby/commit/b5bc54552df7e04862780f15b0dc96d2732ad038)) +* **api:** add override_company_name parameter to external payment create ([73612ab](https://github.com/lithic-com/lithic-ruby/commit/73612ab7a4e46f5572f7d12839acddb7beeb4b75)) +* **api:** Add service and merchant location fields ([d0111e3](https://github.com/lithic-com/lithic-ruby/commit/d0111e33b4f6ca04b75f07440f3fc11e0406bbcd)) + + +### Chores + +* **tests:** bump steady to v0.19.4 ([ecee69a](https://github.com/lithic-com/lithic-ruby/commit/ecee69aa012a80f970784d78a9298db6155dd991)) +* **tests:** bump steady to v0.19.5 ([8a046d1](https://github.com/lithic-com/lithic-ruby/commit/8a046d1ed8d6b7409244efb552809b28937ebed8)) + + +### Refactors + +* **tests:** switch from prism to steady ([74cea9d](https://github.com/lithic-com/lithic-ruby/commit/74cea9d46211777e8e1de61ef24f52b0412564cd)) + ## 0.9.0 (2026-03-17) Full Changelog: [v0.8.0...v0.9.0](https://github.com/lithic-com/lithic-ruby/compare/v0.8.0...v0.9.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7855934b..b9aba771 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,7 +66,7 @@ $ bundle exec rake ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. +Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. ```sh $ ./scripts/mock diff --git a/Gemfile.lock b/Gemfile.lock index d319dc03..38db2155 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - lithic (0.9.0) + lithic (0.10.0) cgi connection_pool diff --git a/README.md b/README.md index 96293004..1cd63711 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "lithic", "~> 0.9.0" +gem "lithic", "~> 0.10.0" ``` diff --git a/lib/lithic.rb b/lib/lithic.rb index 7d698a4c..bd345350 100644 --- a/lib/lithic.rb +++ b/lib/lithic.rb @@ -55,6 +55,7 @@ require_relative "lithic/client" require_relative "lithic/internal/cursor_page" require_relative "lithic/internal/single_page" +require_relative "lithic/models/merchant" require_relative "lithic/models/transaction" require_relative "lithic/models/auth_rules/v2/backtest_results" require_relative "lithic/models/book_transfer_response" @@ -348,7 +349,6 @@ require_relative "lithic/models/management_operation_retrieve_params" require_relative "lithic/models/management_operation_reverse_params" require_relative "lithic/models/management_operation_updated_webhook_event" -require_relative "lithic/models/merchant" require_relative "lithic/models/message_attempt" require_relative "lithic/models/network_program" require_relative "lithic/models/network_program_list_params" diff --git a/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb b/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb index 7cd0e29e..59cf6310 100644 --- a/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb +++ b/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb @@ -90,6 +90,17 @@ class Condition < Lithic::Internal::Type::BaseModel # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address # data with the cardholder KYC data if it exists. Valid values are `MATCH`, # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. # # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute] required :attribute, @@ -172,6 +183,17 @@ class Condition < Lithic::Internal::Type::BaseModel # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address # data with the cardholder KYC data if it exists. Valid values are `MATCH`, # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. # # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#attribute module Attribute @@ -196,6 +218,10 @@ module Attribute WALLET_TYPE = :WALLET_TYPE TRANSACTION_INITIATOR = :TRANSACTION_INITIATOR ADDRESS_MATCH = :ADDRESS_MATCH + SERVICE_LOCATION_STATE = :SERVICE_LOCATION_STATE + SERVICE_LOCATION_POSTAL_CODE = :SERVICE_LOCATION_POSTAL_CODE + CARD_AGE = :CARD_AGE + ACCOUNT_AGE = :ACCOUNT_AGE # @!method self.values # @return [Array] diff --git a/lib/lithic/models/auth_rules/rule_feature.rb b/lib/lithic/models/auth_rules/rule_feature.rb index 17fe22de..f798a60b 100644 --- a/lib/lithic/models/auth_rules/rule_feature.rb +++ b/lib/lithic/models/auth_rules/rule_feature.rb @@ -18,7 +18,7 @@ module AuthRules # - `CARD`: The card associated with the event. Available for AUTHORIZATION and # THREE_DS_AUTHENTICATION event stream rules. # - `ACCOUNT_HOLDER`: The account holder associated with the card. Available for - # THREE_DS_AUTHENTICATION event stream rules. + # AUTHORIZATION and THREE_DS_AUTHENTICATION event stream rules. # - `IP_METADATA`: IP address metadata for the request. Available for # THREE_DS_AUTHENTICATION event stream rules. # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires diff --git a/lib/lithic/models/card_authorization_approval_request_webhook_event.rb b/lib/lithic/models/card_authorization_approval_request_webhook_event.rb index 7caef651..e05124d0 100644 --- a/lib/lithic/models/card_authorization_approval_request_webhook_event.rb +++ b/lib/lithic/models/card_authorization_approval_request_webhook_event.rb @@ -90,9 +90,10 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas required :event_type, const: :"card_authorization.approval_request" # @!attribute merchant + # Merchant information including full location details. # - # @return [Lithic::Models::Merchant] - required :merchant, -> { Lithic::Merchant } + # @return [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Merchant] + required :merchant, -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant } # @!attribute merchant_amount # @deprecated @@ -114,6 +115,16 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas # @return [String] required :merchant_currency, String + # @!attribute service_location + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + # + # @return [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation, nil] + required :service_location, + -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation }, + nil?: true + # @!attribute settled_amount # @deprecated # @@ -232,7 +243,7 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas # @return [Time, nil] optional :ttl, Time - # @!method initialize(token:, acquirer_fee:, amount:, amounts:, authorization_amount:, avs:, card:, cardholder_currency:, cash_amount:, created:, merchant:, merchant_amount:, merchant_currency:, settled_amount:, status:, transaction_initiator:, account_type: nil, cardholder_authentication: nil, cashback: nil, conversion_rate: nil, event_token: nil, fleet_info: nil, latest_challenge: nil, network: nil, network_risk_score: nil, network_specific_data: nil, pos: nil, token_info: nil, ttl: nil, event_type: :"card_authorization.approval_request") + # @!method initialize(token:, acquirer_fee:, amount:, amounts:, authorization_amount:, avs:, card:, cardholder_currency:, cash_amount:, created:, merchant:, merchant_amount:, merchant_currency:, service_location:, settled_amount:, status:, transaction_initiator:, account_type: nil, cardholder_authentication: nil, cashback: nil, conversion_rate: nil, event_token: nil, fleet_info: nil, latest_challenge: nil, network: nil, network_risk_score: nil, network_specific_data: nil, pos: nil, token_info: nil, ttl: nil, event_type: :"card_authorization.approval_request") # Some parameter documentations has been truncated, see # {Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent} for more details. # @@ -256,12 +267,14 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas # # @param created [Time] Date and time when the transaction first occurred in UTC. # - # @param merchant [Lithic::Models::Merchant] + # @param merchant [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Merchant] Merchant information including full location details. # # @param merchant_amount [Integer] Deprecated, use `amounts`. The amount that the merchant will receive, denominate # # @param merchant_currency [String] 3-character alphabetic ISO 4217 code for the local currency of the transaction. # + # @param service_location [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation, nil] Where the cardholder received the service, when different from the card acceptor + # # @param settled_amount [Integer] Deprecated, use `amounts`. Amount (in cents) of the transaction that has been se # # @param status [Symbol, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Status] The type of authorization request that this request is for. Note that `CREDIT_AU @@ -605,6 +618,84 @@ module Type end end + # @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent#merchant + class Merchant < Lithic::Models::Merchant + # @!attribute phone_number + # Phone number of card acceptor. + # + # @return [String, nil] + required :phone_number, String, nil?: true + + # @!attribute postal_code + # Postal code of card acceptor. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute street_address + # Street address of card acceptor. + # + # @return [String, nil] + required :street_address, String, nil?: true + + # @!method initialize(phone_number:, postal_code:, street_address:) + # Merchant information including full location details. + # + # @param phone_number [String, nil] Phone number of card acceptor. + # + # @param postal_code [String, nil] Postal code of card acceptor. + # + # @param street_address [String, nil] Street address of card acceptor. + end + + # @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent#service_location + class ServiceLocation < Lithic::Internal::Type::BaseModel + # @!attribute city + # City of service location. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # Country code of service location, ISO 3166-1 alpha-3. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute postal_code + # Postal code of service location. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # State/province code of service location, ISO 3166-2. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!attribute street_address + # Street address of service location. + # + # @return [String, nil] + required :street_address, String, nil?: true + + # @!method initialize(city:, country:, postal_code:, state:, street_address:) + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + # + # @param city [String, nil] City of service location. + # + # @param country [String, nil] Country code of service location, ISO 3166-1 alpha-3. + # + # @param postal_code [String, nil] Postal code of service location. + # + # @param state [String, nil] State/province code of service location, ISO 3166-2. + # + # @param street_address [String, nil] Street address of service location. + end + # The type of authorization request that this request is for. Note that # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to # users with credit decisioning via ASA enabled. diff --git a/lib/lithic/models/payment.rb b/lib/lithic/models/payment.rb index 25b22bec..298dbe37 100644 --- a/lib/lithic/models/payment.rb +++ b/lib/lithic/models/payment.rb @@ -514,6 +514,13 @@ class ACHMethodAttributes < Lithic::Internal::Type::BaseModel # @return [String, nil] optional :company_id, String, nil?: true + # @!attribute override_company_name + # Value to override the configured company name with. Can only be used if allowed + # to override + # + # @return [String, nil] + optional :override_company_name, String, nil?: true + # @!attribute receipt_routing_number # Receipt routing number # @@ -538,7 +545,11 @@ class ACHMethodAttributes < Lithic::Internal::Type::BaseModel # @return [Array, nil] optional :trace_numbers, Lithic::Internal::Type::ArrayOf[String] - # @!method initialize(sec_code:, ach_hold_period: nil, addenda: nil, company_id: nil, receipt_routing_number: nil, retries: nil, return_reason_code: nil, trace_numbers: nil) + # @!method initialize(sec_code:, ach_hold_period: nil, addenda: nil, company_id: nil, override_company_name: nil, receipt_routing_number: nil, retries: nil, return_reason_code: nil, trace_numbers: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes} for more + # details. + # # @param sec_code [Symbol, Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes::SecCode] SEC code for ACH transaction # # @param ach_hold_period [Integer, nil] Number of days the ACH transaction is on hold @@ -547,6 +558,8 @@ class ACHMethodAttributes < Lithic::Internal::Type::BaseModel # # @param company_id [String, nil] Company ID for the ACH transaction # + # @param override_company_name [String, nil] Value to override the configured company name with. Can only be used if allowed + # # @param receipt_routing_number [String, nil] Receipt routing number # # @param retries [Integer, nil] Number of retries attempted diff --git a/lib/lithic/models/transaction.rb b/lib/lithic/models/transaction.rb index dcf50ac4..cdedd883 100644 --- a/lib/lithic/models/transaction.rb +++ b/lib/lithic/models/transaction.rb @@ -93,9 +93,10 @@ class Transaction < Lithic::Internal::Type::BaseModel required :financial_account_token, String, nil?: true # @!attribute merchant + # Merchant information including full location details. # - # @return [Lithic::Models::Merchant] - required :merchant, -> { Lithic::Merchant } + # @return [Lithic::Models::Transaction::Merchant] + required :merchant, -> { Lithic::Transaction::Merchant } # @!attribute merchant_amount # @deprecated @@ -148,6 +149,14 @@ class Transaction < Lithic::Internal::Type::BaseModel # @return [Symbol, Lithic::Models::Transaction::Result] required :result, enum: -> { Lithic::Transaction::Result } + # @!attribute service_location + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + # + # @return [Lithic::Models::Transaction::ServiceLocation, nil] + required :service_location, -> { Lithic::Transaction::ServiceLocation }, nil?: true + # @!attribute settled_amount # @deprecated # @@ -185,7 +194,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:, tags:, 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:, service_location:, settled_amount:, status:, tags:, token_info:, updated:, events: nil) # Some parameter documentations has been truncated, see # {Lithic::Models::Transaction} for more details. # @@ -215,7 +224,7 @@ class Transaction < Lithic::Internal::Type::BaseModel # # @param financial_account_token [String, nil] # - # @param merchant [Lithic::Models::Merchant] + # @param merchant [Lithic::Models::Transaction::Merchant] Merchant information including full location details. # # @param merchant_amount [Integer, nil] Analogous to the 'amount', but in the merchant currency. # @@ -231,6 +240,8 @@ class Transaction < Lithic::Internal::Type::BaseModel # # @param result [Symbol, Lithic::Models::Transaction::Result] # + # @param service_location [Lithic::Models::Transaction::ServiceLocation, nil] Where the cardholder received the service, when different from the card acceptor + # # @param settled_amount [Integer] The settled amount of the transaction in the settlement currency. # # @param status [Symbol, Lithic::Models::Transaction::Status] Status of the transaction. @@ -385,6 +396,36 @@ class Avs < Lithic::Internal::Type::BaseModel # @param zipcode [String] Cardholder ZIP code end + # @see Lithic::Models::Transaction#merchant + class Merchant < Lithic::Models::Merchant + # @!attribute phone_number + # Phone number of card acceptor. + # + # @return [String, nil] + required :phone_number, String, nil?: true + + # @!attribute postal_code + # Postal code of card acceptor. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute street_address + # Street address of card acceptor. + # + # @return [String, nil] + required :street_address, String, nil?: true + + # @!method initialize(phone_number:, postal_code:, street_address:) + # Merchant information including full location details. + # + # @param phone_number [String, nil] Phone number of card acceptor. + # + # @param postal_code [String, nil] Postal code of card acceptor. + # + # @param street_address [String, nil] Street address of card acceptor. + end + # Card network of the authorization. Value is `UNKNOWN` when Lithic cannot # determine the network code from the upstream provider. # @@ -693,6 +734,54 @@ module Result # @return [Array] end + # @see Lithic::Models::Transaction#service_location + class ServiceLocation < Lithic::Internal::Type::BaseModel + # @!attribute city + # City of service location. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # Country code of service location, ISO 3166-1 alpha-3. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute postal_code + # Postal code of service location. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # State/province code of service location, ISO 3166-2. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!attribute street_address + # Street address of service location. + # + # @return [String, nil] + required :street_address, String, nil?: true + + # @!method initialize(city:, country:, postal_code:, state:, street_address:) + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + # + # @param city [String, nil] City of service location. + # + # @param country [String, nil] Country code of service location, ISO 3166-1 alpha-3. + # + # @param postal_code [String, nil] Postal code of service location. + # + # @param state [String, nil] State/province code of service location, ISO 3166-2. + # + # @param street_address [String, nil] Street address of service location. + end + # Status of the transaction. # # @see Lithic::Models::Transaction#status diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb index 207fe459..fba104c0 100644 --- a/lib/lithic/version.rb +++ b/lib/lithic/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Lithic - VERSION = "0.9.0" + VERSION = "0.10.0" end diff --git a/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi b/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi index 1ff8142c..40635234 100644 --- a/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi +++ b/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi @@ -159,6 +159,17 @@ module Lithic # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address # data with the cardholder KYC data if it exists. Valid values are `MATCH`, # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. sig do returns( Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol @@ -237,6 +248,17 @@ module Lithic # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address # data with the cardholder KYC data if it exists. Valid values are `MATCH`, # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. attribute:, # The operation to apply to the attribute operation:, @@ -312,6 +334,17 @@ module Lithic # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address # data with the cardholder KYC data if it exists. Valid values are `MATCH`, # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. module Attribute extend Lithic::Internal::Type::Enum @@ -419,6 +452,26 @@ module Lithic :ADDRESS_MATCH, Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol ) + SERVICE_LOCATION_STATE = + T.let( + :SERVICE_LOCATION_STATE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + SERVICE_LOCATION_POSTAL_CODE = + T.let( + :SERVICE_LOCATION_POSTAL_CODE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_AGE = + T.let( + :CARD_AGE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + ACCOUNT_AGE = + T.let( + :ACCOUNT_AGE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/lithic/models/auth_rules/rule_feature.rbi b/rbi/lithic/models/auth_rules/rule_feature.rbi index 695ed9ae..efd1574a 100644 --- a/rbi/lithic/models/auth_rules/rule_feature.rbi +++ b/rbi/lithic/models/auth_rules/rule_feature.rbi @@ -18,7 +18,7 @@ module Lithic # - `CARD`: The card associated with the event. Available for AUTHORIZATION and # THREE_DS_AUTHENTICATION event stream rules. # - `ACCOUNT_HOLDER`: The account holder associated with the card. Available for - # THREE_DS_AUTHENTICATION event stream rules. + # AUTHORIZATION and THREE_DS_AUTHENTICATION event stream rules. # - `IP_METADATA`: IP address metadata for the request. Available for # THREE_DS_AUTHENTICATION event stream rules. # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires diff --git a/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi b/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi index 7f86a068..db67cdbf 100644 --- a/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi +++ b/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi @@ -96,10 +96,18 @@ module Lithic sig { returns(Symbol) } attr_accessor :event_type - sig { returns(Lithic::Merchant) } + # Merchant information including full location details. + sig do + returns(Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant) + end attr_reader :merchant - sig { params(merchant: Lithic::Merchant::OrHash).void } + sig do + params( + merchant: + Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant::OrHash + ).void + end attr_writer :merchant # Deprecated, use `amounts`. The amount that the merchant will receive, @@ -114,6 +122,28 @@ module Lithic sig { returns(String) } attr_accessor :merchant_currency + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + sig do + returns( + T.nilable( + Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation + ) + ) + end + attr_reader :service_location + + sig do + params( + service_location: + T.nilable( + Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation::OrHash + ) + ).void + end + attr_writer :service_location + # Deprecated, use `amounts`. Amount (in cents) of the transaction that has been # settled, including any acquirer fees. sig { returns(Integer) } @@ -323,9 +353,14 @@ module Lithic cardholder_currency: String, cash_amount: Integer, created: Time, - merchant: Lithic::Merchant::OrHash, + merchant: + Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant::OrHash, merchant_amount: Integer, merchant_currency: String, + service_location: + T.nilable( + Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation::OrHash + ), settled_amount: Integer, status: Lithic::CardAuthorizationApprovalRequestWebhookEvent::Status::OrSymbol, @@ -393,6 +428,7 @@ module Lithic cash_amount:, # Date and time when the transaction first occurred in UTC. created:, + # Merchant information including full location details. merchant:, # Deprecated, use `amounts`. The amount that the merchant will receive, # denominated in `merchant_currency` and in the smallest currency unit. Note the @@ -402,6 +438,10 @@ module Lithic merchant_amount:, # 3-character alphabetic ISO 4217 code for the local currency of the transaction. merchant_currency:, + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + service_location:, # Deprecated, use `amounts`. Amount (in cents) of the transaction that has been # settled, including any acquirer fees. settled_amount:, @@ -468,9 +508,14 @@ module Lithic cash_amount: Integer, created: Time, event_type: Symbol, - merchant: Lithic::Merchant, + merchant: + Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant, merchant_amount: Integer, merchant_currency: String, + service_location: + T.nilable( + Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation + ), settled_amount: Integer, status: Lithic::CardAuthorizationApprovalRequestWebhookEvent::Status::TaggedSymbol, @@ -1210,6 +1255,128 @@ module Lithic end end + class Merchant < Lithic::Models::Merchant + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant, + Lithic::Internal::AnyHash + ) + end + + # Phone number of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + + # Postal code of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Street address of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :street_address + + # Merchant information including full location details. + sig do + params( + phone_number: T.nilable(String), + postal_code: T.nilable(String), + street_address: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Phone number of card acceptor. + phone_number:, + # Postal code of card acceptor. + postal_code:, + # Street address of card acceptor. + street_address: + ) + end + + sig do + override.returns( + { + phone_number: T.nilable(String), + postal_code: T.nilable(String), + street_address: T.nilable(String) + } + ) + end + def to_hash + end + end + + class ServiceLocation < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation, + Lithic::Internal::AnyHash + ) + end + + # City of service location. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Country code of service location, ISO 3166-1 alpha-3. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # Postal code of service location. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State/province code of service location, ISO 3166-2. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Street address of service location. + sig { returns(T.nilable(String)) } + attr_accessor :street_address + + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + street_address: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # City of service location. + city:, + # Country code of service location, ISO 3166-1 alpha-3. + country:, + # Postal code of service location. + postal_code:, + # State/province code of service location, ISO 3166-2. + state:, + # Street address of service location. + street_address: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + street_address: T.nilable(String) + } + ) + end + def to_hash + end + end + # The type of authorization request that this request is for. Note that # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to # users with credit decisioning via ASA enabled. diff --git a/rbi/lithic/models/payment.rbi b/rbi/lithic/models/payment.rbi index bb68a075..89a7d58e 100644 --- a/rbi/lithic/models/payment.rbi +++ b/rbi/lithic/models/payment.rbi @@ -818,6 +818,11 @@ module Lithic sig { returns(T.nilable(String)) } attr_accessor :company_id + # Value to override the configured company name with. Can only be used if allowed + # to override + sig { returns(T.nilable(String)) } + attr_accessor :override_company_name + # Receipt routing number sig { returns(T.nilable(String)) } attr_accessor :receipt_routing_number @@ -844,6 +849,7 @@ module Lithic ach_hold_period: T.nilable(Integer), addenda: T.nilable(String), company_id: T.nilable(String), + override_company_name: T.nilable(String), receipt_routing_number: T.nilable(String), retries: T.nilable(Integer), return_reason_code: T.nilable(String), @@ -859,6 +865,9 @@ module Lithic addenda: nil, # Company ID for the ACH transaction company_id: nil, + # Value to override the configured company name with. Can only be used if allowed + # to override + override_company_name: nil, # Receipt routing number receipt_routing_number: nil, # Number of retries attempted @@ -878,6 +887,7 @@ module Lithic ach_hold_period: T.nilable(Integer), addenda: T.nilable(String), company_id: T.nilable(String), + override_company_name: T.nilable(String), receipt_routing_number: T.nilable(String), retries: T.nilable(Integer), return_reason_code: T.nilable(String), diff --git a/rbi/lithic/models/transaction.rbi b/rbi/lithic/models/transaction.rbi index 3a563dc2..0653cf79 100644 --- a/rbi/lithic/models/transaction.rbi +++ b/rbi/lithic/models/transaction.rbi @@ -76,10 +76,11 @@ module Lithic sig { returns(T.nilable(String)) } attr_accessor :financial_account_token - sig { returns(Lithic::Merchant) } + # Merchant information including full location details. + sig { returns(Lithic::Transaction::Merchant) } attr_reader :merchant - sig { params(merchant: Lithic::Merchant::OrHash).void } + sig { params(merchant: Lithic::Transaction::Merchant::OrHash).void } attr_writer :merchant # Analogous to the 'amount', but in the merchant currency. @@ -116,6 +117,20 @@ module Lithic sig { returns(Lithic::Transaction::Result::TaggedSymbol) } attr_accessor :result + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + sig { returns(T.nilable(Lithic::Transaction::ServiceLocation)) } + attr_reader :service_location + + sig do + params( + service_location: + T.nilable(Lithic::Transaction::ServiceLocation::OrHash) + ).void + end + attr_writer :service_location + # The settled amount of the transaction in the settlement currency. sig { returns(Integer) } attr_accessor :settled_amount @@ -161,7 +176,7 @@ module Lithic T.nilable(Lithic::CardholderAuthentication::OrHash), created: Time, financial_account_token: T.nilable(String), - merchant: Lithic::Merchant::OrHash, + merchant: Lithic::Transaction::Merchant::OrHash, merchant_amount: T.nilable(Integer), merchant_authorization_amount: T.nilable(Integer), merchant_currency: String, @@ -169,6 +184,8 @@ module Lithic network_risk_score: T.nilable(Integer), pos: Lithic::Transaction::Pos::OrHash, result: Lithic::Transaction::Result::OrSymbol, + service_location: + T.nilable(Lithic::Transaction::ServiceLocation::OrHash), settled_amount: Integer, status: Lithic::Transaction::Status::OrSymbol, tags: T::Hash[Symbol, String], @@ -208,6 +225,7 @@ module Lithic # Date and time when the transaction first occurred. UTC time zone. created:, financial_account_token:, + # Merchant information including full location details. merchant:, # Analogous to the 'amount', but in the merchant currency. merchant_amount:, @@ -226,6 +244,10 @@ module Lithic network_risk_score:, pos:, result:, + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + service_location:, # The settled amount of the transaction in the settlement currency. settled_amount:, # Status of the transaction. @@ -257,7 +279,7 @@ module Lithic T.nilable(Lithic::CardholderAuthentication), created: Time, financial_account_token: T.nilable(String), - merchant: Lithic::Merchant, + merchant: Lithic::Transaction::Merchant, merchant_amount: T.nilable(Integer), merchant_authorization_amount: T.nilable(Integer), merchant_currency: String, @@ -265,6 +287,7 @@ module Lithic network_risk_score: T.nilable(Integer), pos: Lithic::Transaction::Pos, result: Lithic::Transaction::Result::TaggedSymbol, + service_location: T.nilable(Lithic::Transaction::ServiceLocation), settled_amount: Integer, status: Lithic::Transaction::Status::TaggedSymbol, tags: T::Hash[Symbol, String], @@ -522,6 +545,55 @@ module Lithic end end + class Merchant < Lithic::Models::Merchant + OrHash = + T.type_alias do + T.any(Lithic::Transaction::Merchant, Lithic::Internal::AnyHash) + end + + # Phone number of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + + # Postal code of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Street address of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :street_address + + # Merchant information including full location details. + sig do + params( + phone_number: T.nilable(String), + postal_code: T.nilable(String), + street_address: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Phone number of card acceptor. + phone_number:, + # Postal code of card acceptor. + postal_code:, + # Street address of card acceptor. + street_address: + ) + end + + sig do + override.returns( + { + phone_number: T.nilable(String), + postal_code: T.nilable(String), + street_address: T.nilable(String) + } + ) + end + def to_hash + end + end + # Card network of the authorization. Value is `UNKNOWN` when Lithic cannot # determine the network code from the upstream provider. module Network @@ -1297,6 +1369,76 @@ module Lithic end end + class ServiceLocation < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::ServiceLocation, + Lithic::Internal::AnyHash + ) + end + + # City of service location. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Country code of service location, ISO 3166-1 alpha-3. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # Postal code of service location. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State/province code of service location, ISO 3166-2. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Street address of service location. + sig { returns(T.nilable(String)) } + attr_accessor :street_address + + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + street_address: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # City of service location. + city:, + # Country code of service location, ISO 3166-1 alpha-3. + country:, + # Postal code of service location. + postal_code:, + # State/province code of service location, ISO 3166-2. + state:, + # Street address of service location. + street_address: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + street_address: T.nilable(String) + } + ) + end + def to_hash + end + end + # Status of the transaction. module Status extend Lithic::Internal::Type::Enum diff --git a/scripts/mock b/scripts/mock index bcf3b392..ab814d38 100755 --- a/scripts/mock +++ b/scripts/mock @@ -19,34 +19,34 @@ fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version + npm exec --package=@stdy/cli@0.19.5 -- steady --version - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & - # Wait for server to come online (max 30s) + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" attempts=0 - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi attempts=$((attempts + 1)) if [ "$attempts" -ge 300 ]; then echo - echo "Timed out waiting for Prism server to start" - cat .prism.log + echo "Timed out waiting for Steady server to start" + cat .stdy.log exit 1 fi echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index e0dc1374..34a96c34 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.5 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi diff --git a/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs b/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs index 7a87a63c..ea1fb554 100644 --- a/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs +++ b/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs @@ -79,6 +79,10 @@ module Lithic | :WALLET_TYPE | :TRANSACTION_INITIATOR | :ADDRESS_MATCH + | :SERVICE_LOCATION_STATE + | :SERVICE_LOCATION_POSTAL_CODE + | :CARD_AGE + | :ACCOUNT_AGE module Attribute extend Lithic::Internal::Type::Enum @@ -102,6 +106,10 @@ module Lithic WALLET_TYPE: :WALLET_TYPE TRANSACTION_INITIATOR: :TRANSACTION_INITIATOR ADDRESS_MATCH: :ADDRESS_MATCH + SERVICE_LOCATION_STATE: :SERVICE_LOCATION_STATE + SERVICE_LOCATION_POSTAL_CODE: :SERVICE_LOCATION_POSTAL_CODE + CARD_AGE: :CARD_AGE + ACCOUNT_AGE: :ACCOUNT_AGE def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute] end diff --git a/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs b/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs index 096ab972..cd466c31 100644 --- a/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs +++ b/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs @@ -13,9 +13,10 @@ module Lithic cash_amount: Integer, created: Time, event_type: :"card_authorization.approval_request", - merchant: Lithic::Merchant, + merchant: Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant, merchant_amount: Integer, merchant_currency: String, + service_location: Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation?, settled_amount: Integer, status: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::status, transaction_initiator: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::transaction_initiator, @@ -57,12 +58,14 @@ module Lithic attr_accessor event_type: :"card_authorization.approval_request" - attr_accessor merchant: Lithic::Merchant + attr_accessor merchant: Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant attr_accessor merchant_amount: Integer attr_accessor merchant_currency: String + attr_accessor service_location: Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation? + attr_accessor settled_amount: Integer attr_accessor status: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::status @@ -134,9 +137,10 @@ module Lithic cardholder_currency: String, cash_amount: Integer, created: Time, - merchant: Lithic::Merchant, + merchant: Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant, merchant_amount: Integer, merchant_currency: String, + service_location: Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation?, settled_amount: Integer, status: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::status, transaction_initiator: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::transaction_initiator, @@ -168,9 +172,10 @@ module Lithic cash_amount: Integer, created: Time, event_type: :"card_authorization.approval_request", - merchant: Lithic::Merchant, + merchant: Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant, merchant_amount: Integer, merchant_currency: String, + service_location: Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation?, settled_amount: Integer, status: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::status, transaction_initiator: Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::transaction_initiator, @@ -450,6 +455,72 @@ module Lithic end end + type merchant = + { phone_number: String?, postal_code: String?, street_address: String? } + + class Merchant < Lithic::Models::Merchant + def phone_number: -> String? + + def phone_number=: (String? _) -> String? + + def postal_code: -> String? + + def postal_code=: (String? _) -> String? + + def street_address: -> String? + + def street_address=: (String? _) -> String? + + def initialize: ( + phone_number: String?, + postal_code: String?, + street_address: String? + ) -> void + + def to_hash: -> { + phone_number: String?, + postal_code: String?, + street_address: String? + } + end + + type service_location = + { + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + } + + class ServiceLocation < Lithic::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + attr_accessor street_address: String? + + def initialize: ( + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + } + end + type status = :AUTHORIZATION | :CREDIT_AUTHORIZATION diff --git a/sig/lithic/models/payment.rbs b/sig/lithic/models/payment.rbs index a8eff0f0..7d19e88b 100644 --- a/sig/lithic/models/payment.rbs +++ b/sig/lithic/models/payment.rbs @@ -354,6 +354,7 @@ module Lithic ach_hold_period: Integer?, addenda: String?, company_id: String?, + override_company_name: String?, receipt_routing_number: String?, retries: Integer?, return_reason_code: String?, @@ -369,6 +370,8 @@ module Lithic attr_accessor company_id: String? + attr_accessor override_company_name: String? + attr_accessor receipt_routing_number: String? attr_accessor retries: Integer? @@ -384,6 +387,7 @@ module Lithic ?ach_hold_period: Integer?, ?addenda: String?, ?company_id: String?, + ?override_company_name: String?, ?receipt_routing_number: String?, ?retries: Integer?, ?return_reason_code: String?, @@ -395,6 +399,7 @@ module Lithic ach_hold_period: Integer?, addenda: String?, company_id: String?, + override_company_name: String?, receipt_routing_number: String?, retries: Integer?, return_reason_code: String?, diff --git a/sig/lithic/models/transaction.rbs b/sig/lithic/models/transaction.rbs index 40dd25b9..732e5ecf 100644 --- a/sig/lithic/models/transaction.rbs +++ b/sig/lithic/models/transaction.rbs @@ -15,7 +15,7 @@ module Lithic cardholder_authentication: Lithic::CardholderAuthentication?, created: Time, financial_account_token: String?, - merchant: Lithic::Merchant, + merchant: Lithic::Transaction::Merchant, merchant_amount: Integer?, merchant_authorization_amount: Integer?, merchant_currency: String, @@ -23,6 +23,7 @@ module Lithic network_risk_score: Integer?, pos: Lithic::Transaction::Pos, result: Lithic::Models::Transaction::result, + service_location: Lithic::Transaction::ServiceLocation?, settled_amount: Integer, status: Lithic::Models::Transaction::status, tags: ::Hash[Symbol, String], @@ -58,7 +59,7 @@ module Lithic attr_accessor financial_account_token: String? - attr_accessor merchant: Lithic::Merchant + attr_accessor merchant: Lithic::Transaction::Merchant attr_accessor merchant_amount: Integer? @@ -74,6 +75,8 @@ module Lithic attr_accessor result: Lithic::Models::Transaction::result + attr_accessor service_location: Lithic::Transaction::ServiceLocation? + attr_accessor settled_amount: Integer attr_accessor status: Lithic::Models::Transaction::status @@ -104,7 +107,7 @@ module Lithic cardholder_authentication: Lithic::CardholderAuthentication?, created: Time, financial_account_token: String?, - merchant: Lithic::Merchant, + merchant: Lithic::Transaction::Merchant, merchant_amount: Integer?, merchant_authorization_amount: Integer?, merchant_currency: String, @@ -112,6 +115,7 @@ module Lithic network_risk_score: Integer?, pos: Lithic::Transaction::Pos, result: Lithic::Models::Transaction::result, + service_location: Lithic::Transaction::ServiceLocation?, settled_amount: Integer, status: Lithic::Models::Transaction::status, tags: ::Hash[Symbol, String], @@ -134,7 +138,7 @@ module Lithic cardholder_authentication: Lithic::CardholderAuthentication?, created: Time, financial_account_token: String?, - merchant: Lithic::Merchant, + merchant: Lithic::Transaction::Merchant, merchant_amount: Integer?, merchant_authorization_amount: Integer?, merchant_currency: String, @@ -142,6 +146,7 @@ module Lithic network_risk_score: Integer?, pos: Lithic::Transaction::Pos, result: Lithic::Models::Transaction::result, + service_location: Lithic::Transaction::ServiceLocation?, settled_amount: Integer, status: Lithic::Models::Transaction::status, tags: ::Hash[Symbol, String], @@ -253,6 +258,35 @@ module Lithic def to_hash: -> { address: String, zipcode: String } end + type merchant = + { phone_number: String?, postal_code: String?, street_address: String? } + + class Merchant < Lithic::Models::Merchant + def phone_number: -> String? + + def phone_number=: (String? _) -> String? + + def postal_code: -> String? + + def postal_code=: (String? _) -> String? + + def street_address: -> String? + + def street_address=: (String? _) -> String? + + def initialize: ( + phone_number: String?, + postal_code: String?, + street_address: String? + ) -> void + + def to_hash: -> { + phone_number: String?, + postal_code: String?, + street_address: String? + } + end + type network = :AMEX | :INTERLINK | :MAESTRO | :MASTERCARD | :UNKNOWN | :VISA @@ -600,6 +634,43 @@ module Lithic def self?.values: -> ::Array[Lithic::Models::Transaction::result] end + type service_location = + { + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + } + + class ServiceLocation < Lithic::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + attr_accessor street_address: String? + + def initialize: ( + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + } + end + type status = :DECLINED | :EXPIRED | :PENDING | :SETTLED | :VOIDED module Status diff --git a/test/lithic/resources/transactions_test.rb b/test/lithic/resources/transactions_test.rb index 8d0ba968..1306eacb 100644 --- a/test/lithic/resources/transactions_test.rb +++ b/test/lithic/resources/transactions_test.rb @@ -25,7 +25,7 @@ def test_retrieve cardholder_authentication: Lithic::CardholderAuthentication | nil, created: Time, financial_account_token: String | nil, - merchant: Lithic::Merchant, + merchant: Lithic::Transaction::Merchant, merchant_amount: Integer | nil, merchant_authorization_amount: Integer | nil, merchant_currency: String, @@ -33,6 +33,7 @@ def test_retrieve network_risk_score: Integer | nil, pos: Lithic::Transaction::Pos, result: Lithic::Transaction::Result, + service_location: Lithic::Transaction::ServiceLocation | nil, settled_amount: Integer, status: Lithic::Transaction::Status, tags: ^(Lithic::Internal::Type::HashOf[String]), @@ -72,7 +73,7 @@ def test_list cardholder_authentication: Lithic::CardholderAuthentication | nil, created: Time, financial_account_token: String | nil, - merchant: Lithic::Merchant, + merchant: Lithic::Transaction::Merchant, merchant_amount: Integer | nil, merchant_authorization_amount: Integer | nil, merchant_currency: String, @@ -80,6 +81,7 @@ def test_list network_risk_score: Integer | nil, pos: Lithic::Transaction::Pos, result: Lithic::Transaction::Result, + service_location: Lithic::Transaction::ServiceLocation | nil, settled_amount: Integer, status: Lithic::Transaction::Status, tags: ^(Lithic::Internal::Type::HashOf[String]),