Skip to content

feature/INT-1637 - Payment Request Product Type and Subtype to nullable#216

Merged
david-ruiz-cko merged 3 commits into
mainfrom
feature/INT-1637
Jun 29, 2026
Merged

feature/INT-1637 - Payment Request Product Type and Subtype to nullable#216
david-ruiz-cko merged 3 commits into
mainfrom
feature/INT-1637

Conversation

@david-ruiz-cko

Copy link
Copy Markdown
Contributor

This pull request updates 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 08:57
@david-ruiz-cko david-ruiz-cko changed the title Updated Payments Product Type and SubType + tests feature/INT-1637 - Payment Request Product Type and Subtype to nullable Jun 29, 2026
@david-ruiz-cko david-ruiz-cko merged commit aefed2f into main Jun 29, 2026
4 checks passed
@david-ruiz-cko david-ruiz-cko deleted the feature/INT-1637 branch June 29, 2026 09:35
@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