Skip to content

Enhance JsonSerializer to prevent escaping forward slashes in Google Pay signedMessage#303

Merged
armando-rodriguez-cko merged 1 commit into
masterfrom
bugfix/INT-1598-fix-json-serialization-enum-normalization
Mar 4, 2026
Merged

Enhance JsonSerializer to prevent escaping forward slashes in Google Pay signedMessage#303
armando-rodriguez-cko merged 1 commit into
masterfrom
bugfix/INT-1598-fix-json-serialization-enum-normalization

Conversation

@armando-rodriguez-cko
Copy link
Copy Markdown
Contributor

This pull request introduces several improvements across serialization logic and test coverage, particularly focusing on ensuring correct JSON output for Google Pay token data, improving test robustness, and handling API response inconsistencies. The most notable changes are grouped below:

Serialization improvements:

  • Updated the JsonSerializer to use the JSON_UNESCAPED_SLASHES flag, ensuring that forward slashes in JSON output (such as in Google Pay signed messages) are not escaped, which is required by the API.

Test enhancements and coverage:

  • Added a new test testSerializeGooglePayTokenDataDoesNotEscapeSlashesInSignedMessage to verify that forward slashes in the signedMessage field of GooglePayTokenData are not escaped during serialization, preventing potential API errors. [1] [2]

Test robustness and API compatibility:

  • Improved refund integration tests to ensure they retry fetching payment details until the total_refunded balance matches the expected amount, making tests more reliable against eventual consistency in the API.
  • Adjusted assertions for payment_type in payment setup tests to compare values in a case-insensitive manner, accommodating inconsistencies between API responses (lowercase) and specification (PascalCase). [1] [2]
  • Enhanced the assertResponse helper to explicitly check that array keys exist before asserting their values, and to allow 0 as a valid value for numeric fields, improving test accuracy and clarity.

@armando-rodriguez-cko armando-rodriguez-cko requested a review from a team March 4, 2026 12:40
…Pay signedMessage. Add test to verify correct serialization behavior. Update assertions in PaymentSetupsIntegrationTest to handle lowercase payment_type response from API.
@armando-rodriguez-cko armando-rodriguez-cko force-pushed the bugfix/INT-1598-fix-json-serialization-enum-normalization branch from 7e43c89 to dea1838 Compare March 4, 2026 12:51
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 4, 2026

@armando-rodriguez-cko armando-rodriguez-cko merged commit 22aad20 into master Mar 4, 2026
6 checks passed
@armando-rodriguez-cko armando-rodriguez-cko deleted the bugfix/INT-1598-fix-json-serialization-enum-normalization branch March 4, 2026 17:01
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