1 | <?php |
||
17 | class KuaiDi100Tracker extends HttpAwareTracker |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | const TRACKING_ENDPOINT = 'http://api.kuaidi100.com/api'; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $appKey; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $carrier; |
||
33 | |||
34 | public function __construct($appKey, $carrier = null, HttpClient $httpClient = null) |
||
40 | |||
41 | /** |
||
42 | * @param string $appKey |
||
43 | */ |
||
44 | public function setAppKey($appKey) |
||
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getAppKey() |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getCarrier() |
||
64 | |||
65 | /** |
||
66 | * @param string $carrier |
||
67 | * @return KuaiDi100Tracker |
||
68 | */ |
||
69 | public function setCarrier($carrier) |
||
74 | |||
75 | /** |
||
76 | * @param string $trackingNumber |
||
77 | * @return array |
||
78 | */ |
||
79 | protected function buildQueryParameters($trackingNumber) |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function track($trackingNumber) |
||
105 | |||
106 | /** |
||
107 | * @param RequestInterface $request |
||
108 | * @param array $options |
||
109 | * @return array |
||
110 | * @codeCoverageIgnore |
||
111 | */ |
||
112 | protected function sendRequest(RequestInterface $request, array $options = []) |
||
121 | |||
122 | /** |
||
123 | * @param array $json |
||
124 | * @return Shipment |
||
125 | */ |
||
126 | protected static function buildShipment($json) |
||
142 | } |