Skip to content

Commit 7da6f44

Browse files
feat(api): add psd2_context field and types to three_ds_authentication
1 parent 14889db commit 7da6f44

2 files changed

Lines changed: 65 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 217
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-6acbf033ded2c03ed5d5c64b6bea9f3250323bf7879a11e9c545aa30e65b3cca.yml
3-
openapi_spec_hash: c6007083223ccff12c5c15bc9e531b41
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-e1085922e2d7ee4ce3122f1d9dfe675877f5551a591630592cfea38bd6fea9ed.yml
3+
openapi_spec_hash: e9ca63bde70f9e3953e0a135e7daf185
44
config_hash: b314c3c5c82a483d1a7812b31b1d1fc4

src/lithic/types/three_ds_authentication.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"App",
1818
"Browser",
1919
"ChallengeMetadata",
20+
"Psd2Context",
2021
"Transaction",
2122
]
2223

@@ -401,6 +402,61 @@ class ChallengeMetadata(BaseModel):
401402
"""The phone number used for delivering the OTP. Relevant only for SMS_OTP method."""
402403

403404

405+
class Psd2Context(BaseModel):
406+
"""PSD2/SCA context for EEA and UK transactions.
407+
408+
Present when Lithic determines the transaction is in scope for PSD2 Strong Customer Authentication. Absent for out-of-scope transactions.
409+
"""
410+
411+
acquirer_exemption: Optional[
412+
Literal[
413+
"NONE",
414+
"TRANSACTION_RISK_ANALYSIS",
415+
"LOW_VALUE",
416+
"RECURRING_PAYMENT",
417+
"MERCHANT_INITIATED_TRANSACTION",
418+
"TRUSTED_BENEFICIARY",
419+
"STRONG_CUSTOMER_AUTHENTICATION_DELEGATION",
420+
"SECURE_CORPORATE_PAYMENT",
421+
"AUTHENTICATION_OUTAGE_EXCEPTION",
422+
"BUNDLED",
423+
]
424+
] = None
425+
"""SCA exemption declared by the acquirer in the 3DS authentication request.
426+
427+
- `NONE` - No exemption claimed
428+
- `TRANSACTION_RISK_ANALYSIS` - Transaction Risk Analysis (TRA) exemption;
429+
acquirer asserts low fraud risk
430+
- `LOW_VALUE` - Low-value payment exemption; transaction is below the EUR 30
431+
threshold
432+
- `RECURRING_PAYMENT` - Recurring payment with a fixed amount to the same payee
433+
- `MERCHANT_INITIATED_TRANSACTION` - Merchant-initiated transaction (MIT);
434+
cardholder not present
435+
- `TRUSTED_BENEFICIARY` - Trusted beneficiary; merchant is on cardholder's
436+
whitelist
437+
- `STRONG_CUSTOMER_AUTHENTICATION_DELEGATION` - SCA already performed by a
438+
delegated third-party authenticator
439+
- `SECURE_CORPORATE_PAYMENT` - Secure corporate payment using a dedicated
440+
corporate card or process
441+
- `AUTHENTICATION_OUTAGE_EXCEPTION` - Authentication outage exception;
442+
scheme-level fallback during ACS downtime
443+
- `BUNDLED` - Mastercard only; bundled exemption code where the exact exemption
444+
type cannot be distinguished
445+
"""
446+
447+
lithic_exemption_validation: Optional[Literal["ACCEPTED", "REJECTED", "NOT_VALIDATED"]] = None
448+
"""Lithic's validation of the acquirer-declared exemption.
449+
450+
Absent when no acquirer exemption was declared.
451+
452+
- `ACCEPTED` - Lithic signals support the acquirer's claim
453+
- `REJECTED` - Lithic signals contradict the claim, or a required signal is
454+
missing
455+
- `NOT_VALIDATED` - Exemption was declared but Lithic has no basis to evaluate
456+
it; treated as `REJECTED` for challenge purposes
457+
"""
458+
459+
404460
class Transaction(BaseModel):
405461
"""
406462
Object containing data about the e-commerce transaction for which the merchant is requesting authentication.
@@ -593,6 +649,13 @@ class ThreeDSAuthentication(BaseModel):
593649
(e.g. in-flight customer decisioning request).
594650
"""
595651

652+
psd2_context: Optional[Psd2Context] = None
653+
"""PSD2/SCA context for EEA and UK transactions.
654+
655+
Present when Lithic determines the transaction is in scope for PSD2 Strong
656+
Customer Authentication. Absent for out-of-scope transactions.
657+
"""
658+
596659
three_ri_request_type: Optional[
597660
Literal[
598661
"ACCOUNT_VERIFICATION",

0 commit comments

Comments
 (0)