Skip to content

feature/INT-1667 - ChallengeIndicator/SessionChallengeIndicator enum alignment - #224

Merged
david-ruiz-cko merged 2 commits into
mainfrom
feature/INT-1667
Aug 6, 2026
Merged

feature/INT-1667 - ChallengeIndicator/SessionChallengeIndicator enum alignment#224
david-ruiz-cko merged 2 commits into
mainfrom
feature/INT-1667

Conversation

@david-ruiz-cko

Copy link
Copy Markdown
Contributor

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:

  • Updated the SessionChallengeIndicator and ChallengeIndicator enums to clearly document and enforce their distinct value sets, separating exemption values for /sessions from the four-value set used in payments endpoints. [1] [2]
  • Corrected the ThreeDsMethodCompletion enum to use uppercase values ('Y', 'N', 'U') as required by the API.
  • Expanded the SessionScheme enum with additional values ('discover', 'upi') to match the API.
  • Replaced the incorrect single-value ShippingIndicator enum with all seven spec-compliant values, ensuring compatibility with MerchantRiskInfo.shipping_indicator.

Test Coverage and Guardrails:

  • Added challenge_indicator_serialization_test.py to verify that the enums expose the correct values, serialize as expected, and that exemption values are not accepted where not supported.
  • Added session_request_serialization_test.py to ensure all SessionRequest attributes are serialized correctly, including defaults and nested objects.
  • Added sessions_enums_test.py to systematically check that all session enums match the API spec, have the correct casing, and cover all required values.

@david-ruiz-cko
david-ruiz-cko requested a review from a team August 4, 2026 07:45
@agent-wall-e

agent-wall-e Bot commented Aug 4, 2026

Copy link
Copy Markdown

🔴 Risk Classification: MAJOR

Approval route: AI Review + Human Approval Required
Rollback controls: Change-freeze window + documented rollback plan

Classification reasons

  • security_sensitive_path:checkout_sdk/sessions/sessions.py
  • security_sensitive_path:tests/sessions/challenge_indicator_serialization_test.py
  • security_sensitive_path:tests/sessions/session_request_serialization_test.py
  • security_sensitive_path:tests/sessions/sessions_enums_test.py

Operational gates

  • ✅ jira_ticket (INT-1667)
  • ✅ independent_review

Files analysed: 5


wall-e 2026.06.19-02 · policy 376219bc71e6…

@agent-wall-e

agent-wall-e Bot commented Aug 4, 2026

Copy link
Copy Markdown
🔬 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.

Reason code Kind Clause Meaning
security_sensitive_pathcheckout_sdk/sessions/sessions.py classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_pathtests/sessions/challenge_indicator_serialization_test.py classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_pathtests/sessions/session_request_serialization_test.py classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_pathtests/sessions/sessions_enums_test.py classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@agent-wall-e

agent-wall-e Bot commented Aug 4, 2026

Copy link
Copy Markdown

🔴 Risk Classification: MAJOR

Approval route: AI Review + Human Approval Required
Rollback controls: Change-freeze window + documented rollback plan

Classification reasons

  • security_sensitive_path:checkout_sdk/sessions/sessions.py
  • security_sensitive_path:tests/sessions/challenge_indicator_serialization_test.py
  • security_sensitive_path:tests/sessions/session_request_serialization_test.py
  • security_sensitive_path:tests/sessions/sessions_enums_test.py

Operational gates

  • ✅ jira_ticket (INT-1667)
  • ✅ independent_review

Files analysed: 5


wall-e 2026.06.19-02 · policy 376219bc71e6…

@agent-wall-e

agent-wall-e Bot commented Aug 4, 2026

Copy link
Copy Markdown
🔬 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.

Reason code Kind Clause Meaning
security_sensitive_pathcheckout_sdk/sessions/sessions.py classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_pathtests/sessions/challenge_indicator_serialization_test.py classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_pathtests/sessions/session_request_serialization_test.py classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_pathtests/sessions/sessions_enums_test.py classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@david-ruiz-cko
david-ruiz-cko merged commit fe37dda into main Aug 6, 2026
5 of 6 checks passed
@david-ruiz-cko
david-ruiz-cko deleted the feature/INT-1667 branch August 6, 2026 08:14
david-ruiz-cko added a commit that referenced this pull request Aug 6, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants