Skip to content

Implement JsonSerializable interface on AbstractUnzerResource and ApplepaySession#235

Draft
Ryouzanpaku wants to merge 4 commits into
mainfrom
CC-3759/json-serializable-interface
Draft

Implement JsonSerializable interface on AbstractUnzerResource and ApplepaySession#235
Ryouzanpaku wants to merge 4 commits into
mainfrom
CC-3759/json-serializable-interface

Conversation

@Ryouzanpaku

@Ryouzanpaku Ryouzanpaku commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • AbstractUnzerResource now implements \JsonSerializable; jsonSerialize() returns expose() data instead of a pre-encoded string, making json_encode($resource) work correctly for all resources
  • ApplepaySession receives the same fix — implements \JsonSerializable and returns get_object_vars($this) from jsonSerialize()
  • HttpService and ApplepayAdapter updated to use json_encode($resource, ...) instead of calling jsonSerialize() directly
  • All unit tests updated accordingly

Resolves CC-3759

Breaking change: jsonSerialize() previously returned a JSON string (false|string). It now returns mixed (array or stdClass) as required by the \JsonSerializable contract. Any caller that used $resource->jsonSerialize() as a string must switch to json_encode($resource).

Dependencies

  • Merge #234 (CC-3759/keypair-protected-properties) first — that change enables Keypair properties to be included in the expose() output this PR relies on.

🤖 Generated with Claude Code

Ryouzanpaku and others added 4 commits June 16, 2026 14:22
…rmCharge and performSca.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er intent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ce and ApplepaySession.

jsonSerialize() now returns expose() data instead of a pre-encoded string,
making json_encode($resource) work correctly for all resources.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Ryouzanpaku Ryouzanpaku requested a review from a team as a code owner June 18, 2026 15:41
@Ryouzanpaku Ryouzanpaku marked this pull request as draft June 25, 2026 08:49
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