How can I get protected values of an object of eway response?

122 views Asked by At

When I try to get Customer info by TokenCustomerID in my eway sdk.It return a object .Please find object screenshot.

I want to access data from this object, but how ? enter image description here

Thanks in advance.

1

There are 1 answers

0
John C On BEST ANSWER

The eWAY PHP SDK uses traits to implement many features, including the get/set functionality - these can be found in HasAttributesTrait

This means you can access the properties directly even though they are labelled as protected when you dump the object:

$response = $client->queryCustomer(917758625852);
$tokenCustomerID = $response->Customers[0]->TokenCustomerID;