mollie-api-php icon indicating copy to clipboard operation
mollie-api-php copied to clipboard

fix: make TransferParty data accessible for debugging

Open Naoray opened this issue 2 weeks ago • 0 comments

When executing the following code

$request = new CreateConnectBalanceTransferRequest(
  amount: new Money("EUR", 100),
  category: "test",
  description: "test",
  destination: new TransferParty("test", "test"),
  source: new TransferParty("test", "bla")
);

$client->debugRequest(die: true)->send($request);

prior to this change we would get a dump of the following (notice destination and source are empty).

[
  "request" => "Mollie\Api\Http\Requests\CreateConnectBalanceTransferRequest"
  "method" => "POST"
  "uri" => "https://api.mollie.com/v2/connect/balance-transfers"
  "headers" => array:7 [...]
  "body" => "{"amount":{"currency":"EUR","value":"100"},"description":"test","source":{},"destination":{},"category":"test"}"
]

With this change TransferParty props are set to public as all the other props of all other Mollie\Api\Http\Data classes and therefore get included in the debug var_dump.

Naoray avatar Dec 23 '25 11:12 Naoray