diff --git a/src/Factory.php b/src/Factory.php index c57528c..1d00264 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -6,6 +6,7 @@ use Palpalani\BayRewards\Resources\CreateActivityResource; use Palpalani\BayRewards\Resources\CustomerResource; use Palpalani\BayRewards\Resources\PointsResource; +use Palpalani\BayRewards\Resources\StoreFeatureResource; use Palpalani\BayRewards\Resources\StoreResource; use Saloon\Http\Connector; @@ -52,4 +53,9 @@ public function allCustomers(): CustomerResource { return new CustomerResource($this); } + + public function getStoreFeatures(): StoreFeatureResource + { + return new StoreFeatureResource($this); + } } diff --git a/src/Requests/Store/GetStoreFeaturesRequest.php b/src/Requests/Store/GetStoreFeaturesRequest.php new file mode 100644 index 0000000..e0b324e --- /dev/null +++ b/src/Requests/Store/GetStoreFeaturesRequest.php @@ -0,0 +1,44 @@ + 'application/json', + 'Accept' => 'application/json', + 'Store-Access-Token' => $this->access_token, + ]; + } + + public function createDtoFromResponse(Response $response): Store + { + return GetStoreFeaturesResponse::make($response); + } +} diff --git a/src/Resources/StoreFeatureResource.php b/src/Resources/StoreFeatureResource.php new file mode 100644 index 0000000..57f50f3 --- /dev/null +++ b/src/Resources/StoreFeatureResource.php @@ -0,0 +1,17 @@ +connector->send(new GetStoreFeaturesRequest($access_token, $data))->dto(); + } +} diff --git a/src/Responses/Store/GetStoreFeaturesResponse.php b/src/Responses/Store/GetStoreFeaturesResponse.php new file mode 100644 index 0000000..7ad5481 --- /dev/null +++ b/src/Responses/Store/GetStoreFeaturesResponse.php @@ -0,0 +1,20 @@ +json(); + + return new Store(...$data); + } +}