Skip to content

Commit

Permalink
Add apis for logistics, order, returns and shop nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
minchao committed Sep 28, 2019
1 parent 2c38caf commit 0068cb0
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 9 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: php
dist: xenial
dist: bionic

php:
- 7.1
Expand All @@ -20,4 +20,9 @@ install:
- composer install --prefer-dist

script:
- composer run check
- composer run lint
- composer run test

notifications:
email:
on_success: never
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"guzzlehttp/guzzle": "^6.3"
},
"require-dev": {
"phpunit/phpunit": "^7.0",
"squizlabs/php_codesniffer": "^3.2"
"phpunit/phpunit": "^7.5",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
"psr-4": {
Expand All @@ -35,11 +35,11 @@
},
"scripts": {
"check": [
"@cs-check",
"@lint",
"@test"
],
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"lint": "phpcs",
"lint-fix": "phpcbf",
"test": "phpunit",
"coverage-html": "phpunit --coverage-html=build/coverage-html"
}
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
colors="true"
verbose="true">
<testsuites>
<testsuite>
<testsuite name="Unit">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
Expand Down
35 changes: 34 additions & 1 deletion src/Nodes/Logistics/Logistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ public function getBranch($parameters = []): ResponseData
return $this->post('/api/v1/logistics/branch/get', $parameters);
}

/**
* Use this API to get airwaybill for fulfillment orders.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
*/
public function getForderWaybill($parameters = []): ResponseData
{
return $this->post('/api/v1/logistics/forder_waybill/get_mass', $parameters);
}

/**
* Use this call to get all supported Logistic Channel.
*
Expand All @@ -52,6 +63,17 @@ public function getLogistics($parameters = []): ResponseData
return $this->post('/api/v1/logistics/channel/get', $parameters);
}

/**
* Get all the logistics info of an order to Init.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
*/
public function getLogisticInfo($parameters = []): ResponseData
{
return $this->post('/api/v1/logistics/init_info/get', $parameters);
}

/**
* Use this call to get the logistics tracking information of an order.
*
Expand Down Expand Up @@ -130,7 +152,7 @@ public function setLogisticStatus($parameters = []): ResponseData
}

/**
* User this call to set tracking number for each order in batch.
* Use this call to set tracking number for each order in batch.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
Expand All @@ -139,4 +161,15 @@ public function setTrackingNo($parameters = []): ResponseData
{
return $this->post('/api/v1/logistics/tracking_number/set_mass', $parameters);
}

/**
* Configure shop level logistics.
*
* @param array|RequestParametersInterface $parameters $parameters
* @return ResponseData
*/
public function updateShopLogistics($parameters = []): ResponseData
{
return $this->post('/api/v1/logistics/channels/update', $parameters);
}
}
45 changes: 45 additions & 0 deletions src/Nodes/Order/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,29 @@ public function getEscrowDetails($parameters = []): ResponseData
return $this->post('/api/v1/orders/my_income', $parameters);
}

/**
* Use this api to get orders' release time and escrow amount.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
*/
public function getEscrowReleasedOrders($parameters = []): ResponseData
{
return $this->post('/api/v1/orders/get_escrow_detail', $parameters);
}

/**
* Use this call to retrieve detailed information of all the fulfill orders(forder) under a single regular order
* based on ordersn.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
*/
public function getForderInfo($parameters = []): ResponseData
{
return $this->post('/api/v1/orders/forder/get', $parameters);
}

/**
* Use this call to retrieve detailed information about one or more orders based on OrderIDs.
*
Expand Down Expand Up @@ -95,4 +118,26 @@ public function rejectBuyerCancellation($parameters = []): ResponseData
{
return $this->post('/api/v1/orders/buyer_cancellation/reject', $parameters);
}

/**
* Use this API to split order into fulfillment orders.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
*/
public function splitOrder($parameters = []): ResponseData
{
return $this->post('/api/v1/orders/split', $parameters);
}

/**
* Use this API to cancel split order from the seller side.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
*/
public function undoSplitOrder($parameters = []): ResponseData
{
return $this->post('/api/v1/orders/unsplit', $parameters);
}
}
11 changes: 11 additions & 0 deletions src/Nodes/Returns/Returns.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,15 @@ public function getReturnList($parameters = []): ResponseData
{
return $this->post('/api/v1/returns/get', $parameters);
}

/**
* Use this api to get detail information of a returned order.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
*/
public function getReturnDetail($parameters = []): ResponseData
{
return $this->post('/api/v1/returns/detail', $parameters);
}
}
22 changes: 22 additions & 0 deletions src/Nodes/Shop/Shop.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@ public function getShopInfo($parameters = []): ResponseData
return $this->post('/api/v1/shop/get', $parameters);
}

/**
* Shop performance includes the indexes from "My Performance" of Seller Center.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
*/
public function performance($parameters = []): ResponseData
{
return $this->post('/api/v1/shop/performance', $parameters);
}

/**
* Only for TW whitelisted shop.Use this API to set the installment status of shop.
*
* @param array|RequestParametersInterface $parameters
* @return ResponseData
*/
public function setShopInstallmentStatus($parameters = []): ResponseData
{
return $this->post('/api/v1/shop/set_installment_status', $parameters);
}

/**
* Use this call to update information of shop.
*
Expand Down

0 comments on commit 0068cb0

Please sign in to comment.