diff --git a/src/Client.php b/src/Client.php index 0169488..fb606df 100644 --- a/src/Client.php +++ b/src/Client.php @@ -34,6 +34,7 @@ * @property Nodes\Order\Order order * @property Nodes\Returns\Returns returns * @property Nodes\Shop\Shop shop + * @property Nodes\Discount\Discount discount */ class Client { @@ -93,6 +94,7 @@ public function __construct(array $config = []) $this->nodes['order'] = new Nodes\Order\Order($this); $this->nodes['returns'] = new Nodes\Returns\Returns($this); $this->nodes['shop'] = new Nodes\Shop\Shop($this); + $this->nodes['discount'] = new Nodes\Discount\Discount($this); } public function __get(string $name) diff --git a/src/Nodes/Discount/Discount.php b/src/Nodes/Discount/Discount.php new file mode 100644 index 0000000..643bd8f --- /dev/null +++ b/src/Nodes/Discount/Discount.php @@ -0,0 +1,98 @@ +post('/api/v1/discount/add', $parameters); + } + + /** + * Use this api to add shop discount item. + * + * @param array|RequestParametersInterface $parameters + * @return ResponseData + */ + public function addDiscountItem($parameters = []): ResponseData + { + return $this->post('/api/v1/discount/items/add', $parameters); + } + + /** + * Use this api to delete one discount activity BEFORE it starts. + * + * @param array|RequestParametersInterface $parameters + * @return ResponseData + */ + public function deleteDiscount($parameters = []): ResponseData + { + return $this->post('/api/v1/discount/delete', $parameters); + } + + /** + * Use this api to delete items of the discount activity. + * + * @param array|RequestParametersInterface $parameters + * @return ResponseData + */ + public function deleteDiscountItem($parameters = []): ResponseData + { + return $this->post('/api/v1/discount/item/delete', $parameters); + } + + /** + * Use this api to get one shop discount activity detail. + * + * @param array|RequestParametersInterface $parameters + * @return ResponseData + */ + public function getDiscountDetail($parameters = []): ResponseData + { + return $this->post('/api/v1/discount/detail', $parameters); + } + + /** + * Use this api to get shop discount activity list. + * + * @param array|RequestParametersInterface $parameters + * @return ResponseData + */ + public function getDiscountsList($parameters = []): ResponseData + { + return $this->post('/api/v1/discounts/get', $parameters); + } + + /** + * Use this api to update one discount information + * + * @param array|RequestParametersInterface $parameters + * @return ResponseData + */ + public function updateDiscount($parameters = []): ResponseData + { + return $this->post('/api/v1/discount/update', $parameters); + } + + /** + * Use this api to update items of the discount activity. + * + * @param array|RequestParametersInterface $parameters + * @return ResponseData + */ + public function updateDiscountItems($parameters = []): ResponseData + { + return $this->post('/api/v1/discount/items/update', $parameters); + } +}