Skip to content

Commit

Permalink
Merge pull request #29 from icowan/master
Browse files Browse the repository at this point in the history
增加顺丰国际小包
  • Loading branch information
icowan authored Nov 19, 2020
2 parents 4cd1574 + 1fb0f6e commit 5251ac2
Show file tree
Hide file tree
Showing 16 changed files with 419 additions and 14 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Cross Border Express for Yii2
- 万邦物流
- 速递管家
- 易仓物流
- 顺丰国际物流

[![Latest Stable Version](https://poser.pugx.org/yiier/yii2-cross-border-express/v/stable)](https://packagist.org/packages/yiier/yii2-cross-border-express)
[![Total Downloads](https://poser.pugx.org/yiier/yii2-cross-border-express/downloads)](https://packagist.org/packages/yiier/yii2-cross-border-express)
Expand Down Expand Up @@ -101,6 +102,12 @@ $config = [
"appKey" => "",
"appToken" => "",
"host" => ""
],
'sfexpress' => [
"accesscode" => "",
"username" => "",
"checkword" => "",
"platform_code" => "",
]
],
];
Expand Down Expand Up @@ -217,3 +224,4 @@ $express->getOrderFee($orderNumber);
- [万邦接口文档](http://apidoc.wanbexpress.com/)
- [速递管家接口文档](http://lfn.rtb56.com/usercenter/manager/api_document.aspx)
- [易仓物流](http://ec.wiki.eccang.com/docs/show/2547)
- [顺丰国际物流](http://docs.uat.trackmeeasy.com/api/)
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"econea/nusoap": "^0.9.6",
"ext-json": "*",
"yiier/yii2-aliyun-oss": "*",
"ext-xml": "*"
"ext-xml": "*",
"ext-libxml": "*"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Express.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Class Express
* @method createOrder(Order $order): OrderResult
* @method getPrintUrl(string $orderNumber): string
* @method getPrintUrl(string $orderNumber, array $params = []): string
* @method getTransportsByCountryCode(string $countryCode): array
* @method getOrderFee(string $trackingNumber): OrderFee
* @method getOrderAllFee(array $query = []): OrderFee[]
Expand Down
5 changes: 3 additions & 2 deletions src/contracts/PlatformInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ public function createOrder(Order $order): OrderResult;
/**
* Get platform print url
* @param string $orderNumber
* @param array $params
* @return string
* @throws ExpressException
*/
public function getPrintUrl(string $orderNumber): string;
public function getPrintUrl(string $orderNumber, array $params = []): string;

/**
* Get platform order fee
Expand All @@ -67,4 +68,4 @@ public function getOrderFee(string $orderNumber): OrderFee;
* @return OrderFee[]
*/
public function getOrderAllFee(array $query = []): array;
}
}
2 changes: 1 addition & 1 deletion src/platforms/CourierbutlerPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function createOrder(Order $order): OrderResult
* @return string
* @throws ExpressException
*/
public function getPrintUrl(string $orderNumber): string
public function getPrintUrl(string $orderNumber, array $params = []): string
{
$this->body["serviceMethod"] = "getnewlabel";
$this->body["paramsJson"] = json_encode([
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/EccangPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function createOrder(Order $order): OrderResult
* @return string
* @throws ExpressException
*/
public function getPrintUrl(string $orderNumber): string
public function getPrintUrl(string $orderNumber, array $params = []): string
{
$req = $this->getRequestParams(
'getLabelUrl',
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/EtowerPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function createOrder(Order $order): OrderResult
* @return string
* @throws ExpressException
*/
public function getPrintUrl(string $orderNumber): string
public function getPrintUrl(string $orderNumber, array $params = []): string
{
$uri = "/services/shipper/labels";

Expand Down
2 changes: 1 addition & 1 deletion src/platforms/FeitePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function createOrder(Order $order): OrderResult
* @return string
* @throws \Exception
*/
public function getPrintUrl(string $orderNumber): string
public function getPrintUrl(string $orderNumber, array $params = []): string
{
$api = 'http://exapi.flytcloud.com/api/label/LabelProvider/GetLabelBatchExt';
$data = [
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/HualeiPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function createOrder(Order $order): OrderResult
* @param string $orderNumber
* @return string
*/
public function getPrintUrl(string $orderNumber): string
public function getPrintUrl(string $orderNumber, array $params = []): string
{
return sprintf("%s/order/FastRpt/PDF_NEW.aspx?Format=A4_EMS_BGD.frx&PrintType=lab10_10&order_id=%s&Print=1",
$this->config->get("print_host"), $orderNumber
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/JiyouPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected function auditOrder(int $orderId): string
/**
* @inheritDoc
*/
public function getPrintUrl(string $orderNumber): string
public function getPrintUrl(string $orderNumber, array $params = []): string
{
// $orderKey = "trackingNo"; // 跟踪单号(trackingNo),订单编号(orderId),客户单号(orderNo)
$orderKey = "oid"; // 跟踪单号(trackingNo),订单编号(orderId),客户单号(orderNo)
Expand Down
1 change: 1 addition & 0 deletions src/platforms/PlatformsName.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ class PlatformsName
const WANB_PLATFORM = "wanb";
const COURIERBUTLER_PLATFORM = "courierbutler";
const ECCANG_PLATFORM = "eccang";
const SFEXPRESS_PLATFORM = "sfexpress";
}
2 changes: 1 addition & 1 deletion src/platforms/SantaiPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function createOrder(Order $order): OrderResult
* @param string $orderNumber
* @return string
*/
public function getPrintUrl(string $orderNumber): string
public function getPrintUrl(string $orderNumber, array $params = []): string
{
$host = 'http://www.sendfromchina.com/api/label';
$printType = 1;
Expand Down
Loading

0 comments on commit 5251ac2

Please sign in to comment.