Skip to content

Commit d0111e3

Browse files
feat(api): Add service and merchant location fields
1 parent b5bc545 commit d0111e3

12 files changed

Lines changed: 718 additions & 29 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 190
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-5f3c4878ed085a0e8925abdf14ed250ba25b04d5a128e3edd81f28be5fd79b69.yml
3-
openapi_spec_hash: f2cc51f780daf0454712a4f73b9c8302
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-7fb459122adaf544433c3d5acd17566e642289b3eccb7ee25d7b7ce418967e32.yml
3+
openapi_spec_hash: fe69fbb129fa5b7d7b1e71d4f2a908f1
44
config_hash: 400b9afe0f7f7b7d96177d05950775f9

lib/lithic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
require_relative "lithic/client"
5656
require_relative "lithic/internal/cursor_page"
5757
require_relative "lithic/internal/single_page"
58+
require_relative "lithic/models/merchant"
5859
require_relative "lithic/models/transaction"
5960
require_relative "lithic/models/auth_rules/v2/backtest_results"
6061
require_relative "lithic/models/book_transfer_response"
@@ -348,7 +349,6 @@
348349
require_relative "lithic/models/management_operation_retrieve_params"
349350
require_relative "lithic/models/management_operation_reverse_params"
350351
require_relative "lithic/models/management_operation_updated_webhook_event"
351-
require_relative "lithic/models/merchant"
352352
require_relative "lithic/models/message_attempt"
353353
require_relative "lithic/models/network_program"
354354
require_relative "lithic/models/network_program_list_params"

lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ class Condition < Lithic::Internal::Type::BaseModel
9090
# - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address
9191
# data with the cardholder KYC data if it exists. Valid values are `MATCH`,
9292
# `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
93+
# - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the
94+
# cardholder received the service, e.g. "NY". When a service location is present
95+
# in the network data, the service location state is used. Otherwise, falls back
96+
# to the card acceptor state.
97+
# - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received
98+
# the service, e.g. "10001". When a service location is present in the network
99+
# data, the service location postal code is used. Otherwise, falls back to the
100+
# card acceptor postal code.
93101
# - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
94102
# - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
95103
# of the authorization.
@@ -175,6 +183,14 @@ class Condition < Lithic::Internal::Type::BaseModel
175183
# - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address
176184
# data with the cardholder KYC data if it exists. Valid values are `MATCH`,
177185
# `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`.
186+
# - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the
187+
# cardholder received the service, e.g. "NY". When a service location is present
188+
# in the network data, the service location state is used. Otherwise, falls back
189+
# to the card acceptor state.
190+
# - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received
191+
# the service, e.g. "10001". When a service location is present in the network
192+
# data, the service location postal code is used. Otherwise, falls back to the
193+
# card acceptor postal code.
178194
# - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
179195
# - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
180196
# of the authorization.
@@ -202,6 +218,8 @@ module Attribute
202218
WALLET_TYPE = :WALLET_TYPE
203219
TRANSACTION_INITIATOR = :TRANSACTION_INITIATOR
204220
ADDRESS_MATCH = :ADDRESS_MATCH
221+
SERVICE_LOCATION_STATE = :SERVICE_LOCATION_STATE
222+
SERVICE_LOCATION_POSTAL_CODE = :SERVICE_LOCATION_POSTAL_CODE
205223
CARD_AGE = :CARD_AGE
206224
ACCOUNT_AGE = :ACCOUNT_AGE
207225

lib/lithic/models/card_authorization_approval_request_webhook_event.rb

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
9090
required :event_type, const: :"card_authorization.approval_request"
9191

9292
# @!attribute merchant
93+
# Merchant information including full location details.
9394
#
94-
# @return [Lithic::Models::Merchant]
95-
required :merchant, -> { Lithic::Merchant }
95+
# @return [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Merchant]
96+
required :merchant, -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::Merchant }
9697

9798
# @!attribute merchant_amount
9899
# @deprecated
@@ -114,6 +115,16 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
114115
# @return [String]
115116
required :merchant_currency, String
116117

118+
# @!attribute service_location
119+
# Where the cardholder received the service, when different from the card acceptor
120+
# location. This is populated from network data elements such as Mastercard DE-122
121+
# SE1 SF9-14 and Visa F34 DS02.
122+
#
123+
# @return [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation, nil]
124+
required :service_location,
125+
-> { Lithic::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation },
126+
nil?: true
127+
117128
# @!attribute settled_amount
118129
# @deprecated
119130
#
@@ -232,7 +243,7 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
232243
# @return [Time, nil]
233244
optional :ttl, Time
234245

235-
# @!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")
246+
# @!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")
236247
# Some parameter documentations has been truncated, see
237248
# {Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent} for more details.
238249
#
@@ -256,12 +267,14 @@ class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Internal::Type::Bas
256267
#
257268
# @param created [Time] Date and time when the transaction first occurred in UTC.
258269
#
259-
# @param merchant [Lithic::Models::Merchant]
270+
# @param merchant [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::Merchant] Merchant information including full location details.
260271
#
261272
# @param merchant_amount [Integer] Deprecated, use `amounts`. The amount that the merchant will receive, denominate
262273
#
263274
# @param merchant_currency [String] 3-character alphabetic ISO 4217 code for the local currency of the transaction.
264275
#
276+
# @param service_location [Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent::ServiceLocation, nil] Where the cardholder received the service, when different from the card acceptor
277+
#
265278
# @param settled_amount [Integer] Deprecated, use `amounts`. Amount (in cents) of the transaction that has been se
266279
#
267280
# @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
605618
end
606619
end
607620

621+
# @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent#merchant
622+
class Merchant < Lithic::Models::Merchant
623+
# @!attribute phone_number
624+
# Phone number of card acceptor.
625+
#
626+
# @return [String, nil]
627+
required :phone_number, String, nil?: true
628+
629+
# @!attribute postal_code
630+
# Postal code of card acceptor.
631+
#
632+
# @return [String, nil]
633+
required :postal_code, String, nil?: true
634+
635+
# @!attribute street_address
636+
# Street address of card acceptor.
637+
#
638+
# @return [String, nil]
639+
required :street_address, String, nil?: true
640+
641+
# @!method initialize(phone_number:, postal_code:, street_address:)
642+
# Merchant information including full location details.
643+
#
644+
# @param phone_number [String, nil] Phone number of card acceptor.
645+
#
646+
# @param postal_code [String, nil] Postal code of card acceptor.
647+
#
648+
# @param street_address [String, nil] Street address of card acceptor.
649+
end
650+
651+
# @see Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent#service_location
652+
class ServiceLocation < Lithic::Internal::Type::BaseModel
653+
# @!attribute city
654+
# City of service location.
655+
#
656+
# @return [String, nil]
657+
required :city, String, nil?: true
658+
659+
# @!attribute country
660+
# Country code of service location, ISO 3166-1 alpha-3.
661+
#
662+
# @return [String, nil]
663+
required :country, String, nil?: true
664+
665+
# @!attribute postal_code
666+
# Postal code of service location.
667+
#
668+
# @return [String, nil]
669+
required :postal_code, String, nil?: true
670+
671+
# @!attribute state
672+
# State/province code of service location, ISO 3166-2.
673+
#
674+
# @return [String, nil]
675+
required :state, String, nil?: true
676+
677+
# @!attribute street_address
678+
# Street address of service location.
679+
#
680+
# @return [String, nil]
681+
required :street_address, String, nil?: true
682+
683+
# @!method initialize(city:, country:, postal_code:, state:, street_address:)
684+
# Where the cardholder received the service, when different from the card acceptor
685+
# location. This is populated from network data elements such as Mastercard DE-122
686+
# SE1 SF9-14 and Visa F34 DS02.
687+
#
688+
# @param city [String, nil] City of service location.
689+
#
690+
# @param country [String, nil] Country code of service location, ISO 3166-1 alpha-3.
691+
#
692+
# @param postal_code [String, nil] Postal code of service location.
693+
#
694+
# @param state [String, nil] State/province code of service location, ISO 3166-2.
695+
#
696+
# @param street_address [String, nil] Street address of service location.
697+
end
698+
608699
# The type of authorization request that this request is for. Note that
609700
# `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to
610701
# users with credit decisioning via ASA enabled.

lib/lithic/models/transaction.rb

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ class Transaction < Lithic::Internal::Type::BaseModel
9393
required :financial_account_token, String, nil?: true
9494

9595
# @!attribute merchant
96+
# Merchant information including full location details.
9697
#
97-
# @return [Lithic::Models::Merchant]
98-
required :merchant, -> { Lithic::Merchant }
98+
# @return [Lithic::Models::Transaction::Merchant]
99+
required :merchant, -> { Lithic::Transaction::Merchant }
99100

100101
# @!attribute merchant_amount
101102
# @deprecated
@@ -148,6 +149,14 @@ class Transaction < Lithic::Internal::Type::BaseModel
148149
# @return [Symbol, Lithic::Models::Transaction::Result]
149150
required :result, enum: -> { Lithic::Transaction::Result }
150151

152+
# @!attribute service_location
153+
# Where the cardholder received the service, when different from the card acceptor
154+
# location. This is populated from network data elements such as Mastercard DE-122
155+
# SE1 SF9-14 and Visa F34 DS02.
156+
#
157+
# @return [Lithic::Models::Transaction::ServiceLocation, nil]
158+
required :service_location, -> { Lithic::Transaction::ServiceLocation }, nil?: true
159+
151160
# @!attribute settled_amount
152161
# @deprecated
153162
#
@@ -185,7 +194,7 @@ class Transaction < Lithic::Internal::Type::BaseModel
185194
# @return [Array<Lithic::Models::Transaction::Event>, nil]
186195
optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event] }
187196

188-
# @!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)
197+
# @!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)
189198
# Some parameter documentations has been truncated, see
190199
# {Lithic::Models::Transaction} for more details.
191200
#
@@ -215,7 +224,7 @@ class Transaction < Lithic::Internal::Type::BaseModel
215224
#
216225
# @param financial_account_token [String, nil]
217226
#
218-
# @param merchant [Lithic::Models::Merchant]
227+
# @param merchant [Lithic::Models::Transaction::Merchant] Merchant information including full location details.
219228
#
220229
# @param merchant_amount [Integer, nil] Analogous to the 'amount', but in the merchant currency.
221230
#
@@ -231,6 +240,8 @@ class Transaction < Lithic::Internal::Type::BaseModel
231240
#
232241
# @param result [Symbol, Lithic::Models::Transaction::Result]
233242
#
243+
# @param service_location [Lithic::Models::Transaction::ServiceLocation, nil] Where the cardholder received the service, when different from the card acceptor
244+
#
234245
# @param settled_amount [Integer] The settled amount of the transaction in the settlement currency.
235246
#
236247
# @param status [Symbol, Lithic::Models::Transaction::Status] Status of the transaction.
@@ -385,6 +396,36 @@ class Avs < Lithic::Internal::Type::BaseModel
385396
# @param zipcode [String] Cardholder ZIP code
386397
end
387398

399+
# @see Lithic::Models::Transaction#merchant
400+
class Merchant < Lithic::Models::Merchant
401+
# @!attribute phone_number
402+
# Phone number of card acceptor.
403+
#
404+
# @return [String, nil]
405+
required :phone_number, String, nil?: true
406+
407+
# @!attribute postal_code
408+
# Postal code of card acceptor.
409+
#
410+
# @return [String, nil]
411+
required :postal_code, String, nil?: true
412+
413+
# @!attribute street_address
414+
# Street address of card acceptor.
415+
#
416+
# @return [String, nil]
417+
required :street_address, String, nil?: true
418+
419+
# @!method initialize(phone_number:, postal_code:, street_address:)
420+
# Merchant information including full location details.
421+
#
422+
# @param phone_number [String, nil] Phone number of card acceptor.
423+
#
424+
# @param postal_code [String, nil] Postal code of card acceptor.
425+
#
426+
# @param street_address [String, nil] Street address of card acceptor.
427+
end
428+
388429
# Card network of the authorization. Value is `UNKNOWN` when Lithic cannot
389430
# determine the network code from the upstream provider.
390431
#
@@ -693,6 +734,54 @@ module Result
693734
# @return [Array<Symbol>]
694735
end
695736

737+
# @see Lithic::Models::Transaction#service_location
738+
class ServiceLocation < Lithic::Internal::Type::BaseModel
739+
# @!attribute city
740+
# City of service location.
741+
#
742+
# @return [String, nil]
743+
required :city, String, nil?: true
744+
745+
# @!attribute country
746+
# Country code of service location, ISO 3166-1 alpha-3.
747+
#
748+
# @return [String, nil]
749+
required :country, String, nil?: true
750+
751+
# @!attribute postal_code
752+
# Postal code of service location.
753+
#
754+
# @return [String, nil]
755+
required :postal_code, String, nil?: true
756+
757+
# @!attribute state
758+
# State/province code of service location, ISO 3166-2.
759+
#
760+
# @return [String, nil]
761+
required :state, String, nil?: true
762+
763+
# @!attribute street_address
764+
# Street address of service location.
765+
#
766+
# @return [String, nil]
767+
required :street_address, String, nil?: true
768+
769+
# @!method initialize(city:, country:, postal_code:, state:, street_address:)
770+
# Where the cardholder received the service, when different from the card acceptor
771+
# location. This is populated from network data elements such as Mastercard DE-122
772+
# SE1 SF9-14 and Visa F34 DS02.
773+
#
774+
# @param city [String, nil] City of service location.
775+
#
776+
# @param country [String, nil] Country code of service location, ISO 3166-1 alpha-3.
777+
#
778+
# @param postal_code [String, nil] Postal code of service location.
779+
#
780+
# @param state [String, nil] State/province code of service location, ISO 3166-2.
781+
#
782+
# @param street_address [String, nil] Street address of service location.
783+
end
784+
696785
# Status of the transaction.
697786
#
698787
# @see Lithic::Models::Transaction#status

0 commit comments

Comments
 (0)