Skip to content

[CC-3981] Fix Paypage requests broken by internal keyClassMap leaking into serialized payload - #236

Open
Ryouzanpaku wants to merge 3 commits into
mainfrom
CC-3981/fix-paypage-keyclassmap-serialization
Open

[CC-3981] Fix Paypage requests broken by internal keyClassMap leaking into serialized payload#236
Ryouzanpaku wants to merge 3 commits into
mainfrom
CC-3981/fix-paypage-keyclassmap-serialization

Conversation

@Ryouzanpaku

Copy link
Copy Markdown
Contributor

Summary

  • Paypage (V2) requests were failing because the internal $keyClassMap static lookup table was being serialized into the outgoing API request body.
  • Root cause: PR Refactor expose properties to avoid catching exceptions on private properties of parent classes #206 refactored AbstractUnzerResource::exposeProperties() to select properties via ReflectionClass::getProperties(ReflectionProperty::IS_PROTECTED), which filters purely on visibility and does not exclude static properties. Paypage::$keyClassMap (protected static) was picked up and exposed alongside real instance properties.
  • Fix: exposeProperties() now skips any isStatic() property, so no static property (on any resource, present or future) can leak into a request again. Additionally tightened Paypage::$keyClassMap to private as defense-in-depth, since it is only used internally within the class.
  • Audited the rest of the SDK — no other class has a protected static property, so Paypage was the only resource affected.

Jira: CC-3981

Dependencies

None.

…eaking into serialized payload

exposeProperties() filtered properties by visibility only, so a protected
static lookup table was picked up by reflection and sent to the API.
Exclude static properties in the base class and tighten keyClassMap's
visibility to private since it is only used internally.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Ryouzanpaku
Ryouzanpaku requested a review from a team as a code owner August 6, 2026 14:31
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.

1 participant