diff --git a/src/Sameday/Objects/Locker/LockerObject.php b/src/Sameday/Objects/Locker/LockerObject.php index 86b3a30..9d19a26 100644 --- a/src/Sameday/Objects/Locker/LockerObject.php +++ b/src/Sameday/Objects/Locker/LockerObject.php @@ -55,6 +55,16 @@ class LockerObject */ protected $email; + /** + * @var int 0 = doesn't support payment, 1 = supports payment + */ + protected $supportedPayment; + + /** + * @var int 0 = not visible, 1 = visible + */ + protected $clientVisible; + /** * @var BoxObject[] */ @@ -78,6 +88,8 @@ class LockerObject * @param string $long * @param string $phone * @param string $email + * @param int $supportedPayment + * @param int $clientVisible * @param BoxObject[] $boxes * @param ScheduleObject[] $schedule */ @@ -92,6 +104,8 @@ public function __construct( $long, $phone, $email, + $supportedPayment, + $clientVisible, array $boxes, array $schedule ) { @@ -105,6 +119,8 @@ public function __construct( $this->long = $long; $this->phone = $phone; $this->email = $email; + $this->supportedPayment = $supportedPayment; + $this->clientVisible = $clientVisible; $this->boxes = $boxes; $this->schedule = $schedule; } @@ -173,6 +189,22 @@ public function getEmail() return $this->email; } + /** + * @return int + */ + public function getSupportedPayment() + { + return $this->supportedPayment; + } + + /** + * @return int + */ + public function getClientVisible() + { + return $this->clientVisible; + } + /** * @return BoxObject[] */ diff --git a/src/Sameday/Responses/SamedayGetLockersResponse.php b/src/Sameday/Responses/SamedayGetLockersResponse.php index 6faf112..10ce3a8 100644 --- a/src/Sameday/Responses/SamedayGetLockersResponse.php +++ b/src/Sameday/Responses/SamedayGetLockersResponse.php @@ -52,6 +52,8 @@ public function __construct(SamedayGetLockersRequest $request, SamedayRawRespons $locker['lng'], $locker['phone'], $locker['email'], + $locker['supportedPayment'], + $locker['clientVisible'], array_map( function ($entry) { return new BoxObject( diff --git a/tests/Responses/SamedayGetLockersResponseTest.php b/tests/Responses/SamedayGetLockersResponseTest.php index 789f2a3..1168cf3 100644 --- a/tests/Responses/SamedayGetLockersResponseTest.php +++ b/tests/Responses/SamedayGetLockersResponseTest.php @@ -52,6 +52,8 @@ public function testResponse() } ], "lockerId": 2, + "supportedPayment": 1, + "clientVisible": 1, "schedule": [ { "day": 1, @@ -115,6 +117,8 @@ public function testResponse() } ], "lockerId": 1, + "supportedPayment": 0, + "clientVisible": 0, "schedule": [ { "day": 1, @@ -173,6 +177,8 @@ public function testResponse() '26.098118', '1234567890', 'foo@bar.com', + 1, + 1, [ new BoxObject('S', 15), new BoxObject('M', 9), @@ -203,6 +209,8 @@ public function testResponse() '26.124641', '0987654321', 'bar@foo.com', + 0, + 0, [ new BoxObject('S', 20), new BoxObject('M', 14),