mirror of
https://github.com/opdavies/glassboxx-sdk-php.git
synced 2025-02-17 22:50:48 +00:00
Add CustomerRequestInterface
This commit is contained in:
parent
0426632a08
commit
e83c6e59e4
3 changed files with 20 additions and 7 deletions
|
@ -7,19 +7,14 @@ namespace Opdavies\Glassboxx\Request;
|
|||
use Opdavies\Glassboxx\Traits\UsesAuthTokenTrait;
|
||||
use Opdavies\Glassboxx\ValueObject\CustomerInterface;
|
||||
|
||||
final class CustomerRequest extends AbstractRequest
|
||||
final class CustomerRequest extends AbstractRequest implements CustomerRequestInterface
|
||||
{
|
||||
use UsesAuthTokenTrait;
|
||||
|
||||
public const ENDPOINT = '/glassboxxorder/customCustomer';
|
||||
|
||||
/** @var string */
|
||||
protected $authToken;
|
||||
|
||||
/** @var CustomerInterface */
|
||||
protected $customer;
|
||||
|
||||
public function forCustomer(CustomerInterface $customer): self
|
||||
public function forCustomer(CustomerInterface $customer): AbstractRequest
|
||||
{
|
||||
$this->customer = $customer;
|
||||
|
||||
|
|
16
src/Glassboxx/Request/CustomerRequestInterface.php
Normal file
16
src/Glassboxx/Request/CustomerRequestInterface.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Opdavies\Glassboxx\Request;
|
||||
|
||||
use Opdavies\Glassboxx\ValueObject\CustomerInterface;
|
||||
|
||||
interface CustomerRequestInterface
|
||||
{
|
||||
public const ENDPOINT = '/glassboxxorder/customCustomer';
|
||||
|
||||
public function forCustomer(CustomerInterface $customer): AbstractRequest;
|
||||
|
||||
public function execute(): string;
|
||||
}
|
|
@ -6,6 +6,8 @@ namespace Opdavies\Glassboxx\Traits;
|
|||
|
||||
trait UsesAuthTokenTrait
|
||||
{
|
||||
protected $authToken;
|
||||
|
||||
public function withAuthToken(string $authToken): self
|
||||
{
|
||||
$this->authToken = $authToken;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue