Skip to content

jsonSerialize() returns empty array for Braintree\Result\Successful #358

@jmauzyk

Description

@jmauzyk

Currently, when calling jsonSerialize() on Braintree\Result\Successful, it returns an empty array. This is because the method simply returns the $_attributes property, which doesn't contain any data for a Successful object.

This wasn't an issue for us previously, since our application's JSON helper would manually generate an array when serializing Successful results for JSON encoding. However, since the implementation of \JsonSerializable in v6.32.0, our application now uses a different code pathway, resulting in an empty array being returned where we need to receive a serialized representation of the Successful result.

Could you clarify whether returning an empty array from Braintree\Result\Successful::jsonSerialize() is the intended behavior? This would help us determine whether to implement our own serialization or if there are plans to add serialization support to the Successful result class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions