Skip to content

Commit f923679

Browse files
feat(api): Add OUT_OF_BAND challenge method and DECLINED status to Authorization
1 parent 50e6bbf commit f923679

17 files changed

Lines changed: 164 additions & 44 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 194
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-711671459efe47bdb250c7ac893569af9b9e1b7c60ded53a77627be76e300a02.yml
3-
openapi_spec_hash: 193dc8a880e100bb74b493de7d4703e1
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-9350b3c0a9a4fc31e1cac88e705f1ac6895108360ba8f7845a8da20db825f82e.yml
3+
openapi_spec_hash: c99714470f6321912e8022434a861897
44
config_hash: 1c5c139a2aa0d1d45c063f953a9bc803

lib/lithic/models/card_authorization.rb

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -793,16 +793,27 @@ module FleetRestrictionCode
793793

794794
# @see Lithic::Models::CardAuthorization#latest_challenge
795795
class LatestChallenge < Lithic::Internal::Type::BaseModel
796+
# @!attribute method_
797+
# The method used to deliver the challenge to the cardholder
798+
#
799+
# - `SMS` - Challenge was delivered via SMS
800+
# - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method
801+
#
802+
# @return [Symbol, Lithic::Models::CardAuthorization::LatestChallenge::Method]
803+
required :method_, enum: -> { Lithic::CardAuthorization::LatestChallenge::Method }, api_name: :method
804+
796805
# @!attribute phone_number
797-
# The phone number used for sending Authorization Challenge SMS.
806+
# The phone number used for sending the Authorization Challenge. Present only when
807+
# the challenge method is `SMS`.
798808
#
799-
# @return [String]
800-
required :phone_number, String
809+
# @return [String, nil]
810+
required :phone_number, String, nil?: true
801811

802812
# @!attribute status
803813
# The status of the Authorization Challenge
804814
#
805815
# - `COMPLETED` - Challenge was successfully completed by the cardholder
816+
# - `DECLINED` - Challenge was declined by the cardholder
806817
# - `PENDING` - Challenge is still open
807818
# - `EXPIRED` - Challenge has expired without being completed
808819
# - `ERROR` - There was an error processing the challenge
@@ -817,22 +828,41 @@ class LatestChallenge < Lithic::Internal::Type::BaseModel
817828
# @return [Time, nil]
818829
optional :completed_at, Time
819830

820-
# @!method initialize(phone_number:, status:, completed_at: nil)
831+
# @!method initialize(method_:, phone_number:, status:, completed_at: nil)
821832
# Some parameter documentations has been truncated, see
822833
# {Lithic::Models::CardAuthorization::LatestChallenge} for more details.
823834
#
824835
# The latest Authorization Challenge that was issued to the cardholder for this
825836
# merchant.
826837
#
827-
# @param phone_number [String] The phone number used for sending Authorization Challenge SMS.
838+
# @param method_ [Symbol, Lithic::Models::CardAuthorization::LatestChallenge::Method] The method used to deliver the challenge to the cardholder
839+
#
840+
# @param phone_number [String, nil] The phone number used for sending the Authorization Challenge. Present only when
828841
#
829842
# @param status [Symbol, Lithic::Models::CardAuthorization::LatestChallenge::Status] The status of the Authorization Challenge
830843
#
831844
# @param completed_at [Time] The date and time when the Authorization Challenge was completed in UTC. Present
832845

846+
# The method used to deliver the challenge to the cardholder
847+
#
848+
# - `SMS` - Challenge was delivered via SMS
849+
# - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method
850+
#
851+
# @see Lithic::Models::CardAuthorization::LatestChallenge#method_
852+
module Method
853+
extend Lithic::Internal::Type::Enum
854+
855+
SMS = :SMS
856+
OUT_OF_BAND = :OUT_OF_BAND
857+
858+
# @!method self.values
859+
# @return [Array<Symbol>]
860+
end
861+
833862
# The status of the Authorization Challenge
834863
#
835864
# - `COMPLETED` - Challenge was successfully completed by the cardholder
865+
# - `DECLINED` - Challenge was declined by the cardholder
836866
# - `PENDING` - Challenge is still open
837867
# - `EXPIRED` - Challenge has expired without being completed
838868
# - `ERROR` - There was an error processing the challenge
@@ -842,6 +872,7 @@ module Status
842872
extend Lithic::Internal::Type::Enum
843873

844874
COMPLETED = :COMPLETED
875+
DECLINED = :DECLINED
845876
PENDING = :PENDING
846877
EXPIRED = :EXPIRED
847878
ERROR = :ERROR

lib/lithic/models/card_authorization_challenge_response_webhook_event.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ module ChallengeMethod
8181
extend Lithic::Internal::Type::Enum
8282

8383
SMS = :SMS
84+
OUT_OF_BAND = :OUT_OF_BAND
8485

8586
# @!method self.values
8687
# @return [Array<Symbol>]

lib/lithic/models/event.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class Event < Lithic::Internal::Type::BaseModel
3737
# during card authorization. The card program should issue its own challenge to
3838
# the cardholder and then respond via
3939
# [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge).
40-
# - card_authorization.challenge_response: Occurs when a cardholder responds to an
41-
# SMS challenge during card authorization.
40+
# - card_authorization.challenge_response: Occurs when a cardholder responds to a
41+
# challenge during card authorization.
4242
# - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial
4343
# data is processed for a transaction event.
4444
# - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial
@@ -164,8 +164,8 @@ class Event < Lithic::Internal::Type::BaseModel
164164
# during card authorization. The card program should issue its own challenge to
165165
# the cardholder and then respond via
166166
# [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge).
167-
# - card_authorization.challenge_response: Occurs when a cardholder responds to an
168-
# SMS challenge during card authorization.
167+
# - card_authorization.challenge_response: Occurs when a cardholder responds to a
168+
# challenge during card authorization.
169169
# - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial
170170
# data is processed for a transaction event.
171171
# - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial

lib/lithic/models/event_list_params.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class EventListParams < Lithic::Internal::Type::BaseModel
9191
# during card authorization. The card program should issue its own challenge to
9292
# the cardholder and then respond via
9393
# [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge).
94-
# - card_authorization.challenge_response: Occurs when a cardholder responds to an
95-
# SMS challenge during card authorization.
94+
# - card_authorization.challenge_response: Occurs when a cardholder responds to a
95+
# challenge during card authorization.
9696
# - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial
9797
# data is processed for a transaction event.
9898
# - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial

lib/lithic/models/event_subscription.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ class EventSubscription < Lithic::Internal::Type::BaseModel
6464
# during card authorization. The card program should issue its own challenge to
6565
# the cardholder and then respond via
6666
# [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge).
67-
# - card_authorization.challenge_response: Occurs when a cardholder responds to an
68-
# SMS challenge during card authorization.
67+
# - card_authorization.challenge_response: Occurs when a cardholder responds to a
68+
# challenge during card authorization.
6969
# - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial
7070
# data is processed for a transaction event.
7171
# - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial

lib/lithic/models/events/subscription_create_params.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class SubscriptionCreateParams < Lithic::Internal::Type::BaseModel
6666
# during card authorization. The card program should issue its own challenge to
6767
# the cardholder and then respond via
6868
# [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge).
69-
# - card_authorization.challenge_response: Occurs when a cardholder responds to an
70-
# SMS challenge during card authorization.
69+
# - card_authorization.challenge_response: Occurs when a cardholder responds to a
70+
# challenge during card authorization.
7171
# - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial
7272
# data is processed for a transaction event.
7373
# - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial

lib/lithic/models/events/subscription_update_params.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class SubscriptionUpdateParams < Lithic::Internal::Type::BaseModel
7373
# during card authorization. The card program should issue its own challenge to
7474
# the cardholder and then respond via
7575
# [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge).
76-
# - card_authorization.challenge_response: Occurs when a cardholder responds to an
77-
# SMS challenge during card authorization.
76+
# - card_authorization.challenge_response: Occurs when a cardholder responds to a
77+
# challenge during card authorization.
7878
# - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial
7979
# data is processed for a transaction event.
8080
# - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial

rbi/lithic/models/card_authorization.rbi

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,13 +1381,26 @@ module Lithic
13811381
)
13821382
end
13831383

1384-
# The phone number used for sending Authorization Challenge SMS.
1385-
sig { returns(String) }
1384+
# The method used to deliver the challenge to the cardholder
1385+
#
1386+
# - `SMS` - Challenge was delivered via SMS
1387+
# - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method
1388+
sig do
1389+
returns(
1390+
Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol
1391+
)
1392+
end
1393+
attr_accessor :method_
1394+
1395+
# The phone number used for sending the Authorization Challenge. Present only when
1396+
# the challenge method is `SMS`.
1397+
sig { returns(T.nilable(String)) }
13861398
attr_accessor :phone_number
13871399

13881400
# The status of the Authorization Challenge
13891401
#
13901402
# - `COMPLETED` - Challenge was successfully completed by the cardholder
1403+
# - `DECLINED` - Challenge was declined by the cardholder
13911404
# - `PENDING` - Challenge is still open
13921405
# - `EXPIRED` - Challenge has expired without being completed
13931406
# - `ERROR` - There was an error processing the challenge
@@ -1410,18 +1423,27 @@ module Lithic
14101423
# merchant.
14111424
sig do
14121425
params(
1413-
phone_number: String,
1426+
method_:
1427+
Lithic::CardAuthorization::LatestChallenge::Method::OrSymbol,
1428+
phone_number: T.nilable(String),
14141429
status:
14151430
Lithic::CardAuthorization::LatestChallenge::Status::OrSymbol,
14161431
completed_at: Time
14171432
).returns(T.attached_class)
14181433
end
14191434
def self.new(
1420-
# The phone number used for sending Authorization Challenge SMS.
1435+
# The method used to deliver the challenge to the cardholder
1436+
#
1437+
# - `SMS` - Challenge was delivered via SMS
1438+
# - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method
1439+
method_:,
1440+
# The phone number used for sending the Authorization Challenge. Present only when
1441+
# the challenge method is `SMS`.
14211442
phone_number:,
14221443
# The status of the Authorization Challenge
14231444
#
14241445
# - `COMPLETED` - Challenge was successfully completed by the cardholder
1446+
# - `DECLINED` - Challenge was declined by the cardholder
14251447
# - `PENDING` - Challenge is still open
14261448
# - `EXPIRED` - Challenge has expired without being completed
14271449
# - `ERROR` - There was an error processing the challenge
@@ -1435,7 +1457,9 @@ module Lithic
14351457
sig do
14361458
override.returns(
14371459
{
1438-
phone_number: String,
1460+
method_:
1461+
Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol,
1462+
phone_number: T.nilable(String),
14391463
status:
14401464
Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol,
14411465
completed_at: Time
@@ -1445,9 +1469,45 @@ module Lithic
14451469
def to_hash
14461470
end
14471471

1472+
# The method used to deliver the challenge to the cardholder
1473+
#
1474+
# - `SMS` - Challenge was delivered via SMS
1475+
# - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method
1476+
module Method
1477+
extend Lithic::Internal::Type::Enum
1478+
1479+
TaggedSymbol =
1480+
T.type_alias do
1481+
T.all(Symbol, Lithic::CardAuthorization::LatestChallenge::Method)
1482+
end
1483+
OrSymbol = T.type_alias { T.any(Symbol, String) }
1484+
1485+
SMS =
1486+
T.let(
1487+
:SMS,
1488+
Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol
1489+
)
1490+
OUT_OF_BAND =
1491+
T.let(
1492+
:OUT_OF_BAND,
1493+
Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol
1494+
)
1495+
1496+
sig do
1497+
override.returns(
1498+
T::Array[
1499+
Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol
1500+
]
1501+
)
1502+
end
1503+
def self.values
1504+
end
1505+
end
1506+
14481507
# The status of the Authorization Challenge
14491508
#
14501509
# - `COMPLETED` - Challenge was successfully completed by the cardholder
1510+
# - `DECLINED` - Challenge was declined by the cardholder
14511511
# - `PENDING` - Challenge is still open
14521512
# - `EXPIRED` - Challenge has expired without being completed
14531513
# - `ERROR` - There was an error processing the challenge
@@ -1465,6 +1525,11 @@ module Lithic
14651525
:COMPLETED,
14661526
Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol
14671527
)
1528+
DECLINED =
1529+
T.let(
1530+
:DECLINED,
1531+
Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol
1532+
)
14681533
PENDING =
14691534
T.let(
14701535
:PENDING,

rbi/lithic/models/card_authorization_challenge_response_webhook_event.rbi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ module Lithic
124124
:SMS,
125125
Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol
126126
)
127+
OUT_OF_BAND =
128+
T.let(
129+
:OUT_OF_BAND,
130+
Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol
131+
)
127132

128133
sig do
129134
override.returns(

0 commit comments

Comments
 (0)