From 3314cd5fc21261b2ef3c5112d7d70e483aaa5175 Mon Sep 17 00:00:00 2001 From: Indra Gunanda Date: Fri, 30 Oct 2020 13:59:46 +0700 Subject: [PATCH] Create Custom Node (#23) * Custom node for consume Custom API on Shopee API v1 * Get merchant connected to partner id * !Fix PSR-12 Style & add nodes to Client Constructor Co-authored-by: Indra --- src/Client.php | 1 + src/Nodes/Custom/Custom.php | 23 +++++++++++++++++++++++ src/Nodes/Shop/Shop.php | 11 +++++++++++ 3 files changed, 35 insertions(+) create mode 100644 src/Nodes/Custom/Custom.php diff --git a/src/Client.php b/src/Client.php index d93e205..c5af139 100644 --- a/src/Client.php +++ b/src/Client.php @@ -96,6 +96,7 @@ public function __construct(array $config = []) $this->nodes['returns'] = new Nodes\Returns\Returns($this); $this->nodes['shop'] = new Nodes\Shop\Shop($this); $this->nodes['shopCategory'] = new Nodes\ShopCategory\ShopCategory($this); + $this->nodes['custom'] = new Nodes\Custom\Custom($this); $this->nodes['discount'] = new Nodes\Discount\Discount($this); } diff --git a/src/Nodes/Custom/Custom.php b/src/Nodes/Custom/Custom.php new file mode 100644 index 0000000..0329a1a --- /dev/null +++ b/src/Nodes/Custom/Custom.php @@ -0,0 +1,23 @@ +post($url, $parameters); + } +} diff --git a/src/Nodes/Shop/Shop.php b/src/Nodes/Shop/Shop.php index 55c7b4f..6e7e430 100644 --- a/src/Nodes/Shop/Shop.php +++ b/src/Nodes/Shop/Shop.php @@ -51,4 +51,15 @@ public function updateShopInfo($parameters = []): ResponseData { return $this->post('/api/v1/shop/update', $parameters); } + + /** + * Use this call to get basic info of shops which have authorized to the partner. + * + * @param array|RequestParametersInterface $parameters + * @return ResponseData + */ + public function getShopsByPartner($parameters = []): ResponseData + { + return $this->post('/api/v1/shop/get_partner_shop', $parameters); + } }