Skip to content

Release 3.9.1 - Payment Request Product Type and Subtype to nullable#217

Merged
david-ruiz-cko merged 1 commit into
mainfrom
release/3.9.1
Jun 29, 2026
Merged

Release 3.9.1 - Payment Request Product Type and Subtype to nullable#217
david-ruiz-cko merged 1 commit into
mainfrom
release/3.9.1

Conversation

@david-ruiz-cko

Copy link
Copy Markdown
Contributor

This release the Product model to use strongly-typed enums for the type and sub_type fields and ensures that these enums serialize to lowercase strings, improving consistency and type safety. It also introduces a comprehensive test suite to verify correct serialization behavior, including handling of None values.

Model and Enum Refactoring

  • Introduced a new ItemType enum and updated the Product class to use ItemType and ProductSubType enums for the type and sub_type fields, respectively, instead of plain strings. The enums now serialize as lowercase values for consistency. (checkout_sdk/payments/payments.py, checkout_sdk/payments/payments.pyR627-R643)
  • Updated the ProductSubType enum values to be lowercase, aligning with serialization expectations. (checkout_sdk/payments/payments.py, checkout_sdk/payments/payments.pyR627-R643)

Serialization and Testing

  • Added a new test module product_serialization_test.py with tests to ensure that Product serializes type and sub_type fields as lowercase strings, supports None values, and round-trips all fields correctly. (tests/payments/product_serialization_test.py, tests/payments/product_serialization_test.pyR1-R99)

Typing Improvements

@david-ruiz-cko david-ruiz-cko requested a review from a team June 29, 2026 09:37
@david-ruiz-cko david-ruiz-cko merged commit 4626e2c into main Jun 29, 2026
4 checks passed
@david-ruiz-cko david-ruiz-cko deleted the release/3.9.1 branch June 29, 2026 09:45
@sonarqubecloud

Copy link
Copy Markdown

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