Skip to content

Commit

Permalink
Add Discount
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken committed Nov 30, 2018
1 parent 951abd4 commit a901c3a
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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)
Expand Down
98 changes: 98 additions & 0 deletions src/Nodes/Discount/Discount.php
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);
}
}

0 comments on commit a901c3a

Please sign in to comment.