-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ken-ywk/master
Add Discount
- Loading branch information
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
|
||
namespace Shopee\Nodes\Discount; | ||
|
||
use Shopee\Nodes\NodeAbstract; | ||
use Shopee\RequestParametersInterface; | ||
use Shopee\ResponseData; | ||
|
||
class Discount extends NodeAbstract | ||
{ | ||
/** | ||
* Use this api to add shop discount activity. | ||
* | ||
* @param array|RequestParametersInterface $parameters | ||
* @return ResponseData | ||
*/ | ||
public function addDiscount($parameters = []): ResponseData | ||
{ | ||
return $this->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); | ||
} | ||
} |