Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supportedPayment and clientVisible to LockerObject #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/Sameday/Objects/Locker/LockerObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
*/
Expand All @@ -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
*/
Expand All @@ -92,6 +104,8 @@ public function __construct(
$long,
$phone,
$email,
$supportedPayment,
$clientVisible,
array $boxes,
array $schedule
) {
Expand All @@ -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;
}
Expand Down Expand Up @@ -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[]
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Sameday/Responses/SamedayGetLockersResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 8 additions & 0 deletions tests/Responses/SamedayGetLockersResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public function testResponse()
}
],
"lockerId": 2,
"supportedPayment": 1,
"clientVisible": 1,
"schedule": [
{
"day": 1,
Expand Down Expand Up @@ -115,6 +117,8 @@ public function testResponse()
}
],
"lockerId": 1,
"supportedPayment": 0,
"clientVisible": 0,
"schedule": [
{
"day": 1,
Expand Down Expand Up @@ -173,6 +177,8 @@ public function testResponse()
'26.098118',
'1234567890',
'[email protected]',
1,
1,
[
new BoxObject('S', 15),
new BoxObject('M', 9),
Expand Down Expand Up @@ -203,6 +209,8 @@ public function testResponse()
'26.124641',
'0987654321',
'[email protected]',
0,
0,
[
new BoxObject('S', 20),
new BoxObject('M', 14),
Expand Down