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