feature/INT-1667 - ChallengeIndicator/SessionChallengeIndicator enum alignment - #224
Conversation
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 5 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 5 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
|
Release 3.12.0 bundles two changes: the new Address Document Verification endpoints (#223, INT-1665) and the sessions enum alignment with the API spec (#224, INT-1667). ## Address Document Verification (Adv) endpoints Implements the Adv family from swagger 2026-07-16: `POST`/`GET /address-document-verifications`, anonymize, attempts (create, list, get) and pdf-report. Reuses the identity-verification scope. * New `AddressDocumentVerificationClient` with 7 methods. (`checkout_sdk/identities/addressdocumentverification/addressdocumentverification_client.py`) * New `AddressDocumentVerificationRequest` and `AddressDocumentVerificationAttemptRequest` models. (`checkout_sdk/identities/addressdocumentverification/addressdocumentverification.py`) * Exposed on `CheckoutApi` via the identity API client. (`checkout_sdk/checkout_api.py`) * Client tests under `tests/identities/addressdocumentverification/`. ## Enum and API spec alignment for sessions * Updated the `SessionChallengeIndicator` and `ChallengeIndicator` enums to clearly document and enforce their distinct value sets, separating the exemption values for `/sessions` from the four-value set used in payments endpoints. (`checkout_sdk/common/enums.py`, `checkout_sdk/sessions/sessions.py`) * Corrected the `ThreeDsMethodCompletion` enum to use uppercase values (`'Y'`, `'N'`, `'U'`) as required by the API. * Expanded the `SessionScheme` enum with the missing `'discover'` and `'upi'` values. * Replaced the incorrect single-value `ShippingIndicator` enum with all seven spec-compliant values, making `MerchantRiskInfo.shipping_indicator` usable. ### Test coverage and guardrails * `tests/sessions/challenge_indicator_serialization_test.py` verifies the enums expose the correct values, serialize as expected, and that exemption values are not accepted where unsupported. * `tests/sessions/session_request_serialization_test.py` ensures all `SessionRequest` attributes serialize correctly, including defaults and nested objects. * `tests/sessions/sessions_enums_test.py` systematically checks that all session enums match the API spec, with the correct casing and full value coverage.



This pull request introduces comprehensive improvements to the enums and their usage in the sessions and payments modules, ensuring strict alignment with the Checkout.com API specification. It also adds robust test coverage to verify correct enum values, serialization, and default behaviors, guarding against subtle regressions and integration issues.
Enum and API Spec Alignment:
SessionChallengeIndicatorandChallengeIndicatorenums to clearly document and enforce their distinct value sets, separating exemption values for/sessionsfrom the four-value set used in payments endpoints. [1] [2]ThreeDsMethodCompletionenum to use uppercase values ('Y','N','U') as required by the API.SessionSchemeenum with additional values ('discover','upi') to match the API.ShippingIndicatorenum with all seven spec-compliant values, ensuring compatibility withMerchantRiskInfo.shipping_indicator.Test Coverage and Guardrails:
challenge_indicator_serialization_test.pyto verify that the enums expose the correct values, serialize as expected, and that exemption values are not accepted where not supported.session_request_serialization_test.pyto ensure allSessionRequestattributes are serialized correctly, including defaults and nested objects.sessions_enums_test.pyto systematically check that all session enums match the API spec, have the correct casing, and cover all required values.