src/Fapi/FapiClient/EndPoints/DiscountCodes.php
<?php declare(strict_types = 1);
namespace Fapi\FapiClient\EndPoints;
use Fapi\FapiClient\EndPoints\Traits\Create;
use Fapi\FapiClient\EndPoints\Traits\Delete;
use Fapi\FapiClient\EndPoints\Traits\Find;
use Fapi\FapiClient\EndPoints\Traits\FindAll;
use Fapi\FapiClient\EndPoints\Traits\Update;
use Fapi\FapiClient\Rest\FapiRestClient;
final class DiscountCodes
{
use FindAll;
use Find;
use Create;
use Update;
use Delete;
public function __construct(FapiRestClient $client)
{
$this->client = $client;
$this->path = '/discount-codes';
$this->resources = 'discount_codes';
}
/**
* @return array<mixed>
*/
public function isValid(string $code, string $path): array
{
return $this->client->getSingularResource($this->path . '/is-valid', ['code' => $code, 'form' => $path]);
}
}