1 | <?php |
||
12 | class Jne implements CourierSystemInterface |
||
13 | { |
||
14 | /** |
||
15 | * JNE base URI. |
||
16 | */ |
||
17 | const BASE_URI = 'http://www.jne.co.id/'; |
||
18 | |||
19 | /** |
||
20 | * Search origin URI. |
||
21 | */ |
||
22 | const SEARCH_ORIGIN_URI = 'server/server_city_from.php'; |
||
23 | |||
24 | /** |
||
25 | * Search destination URI. |
||
26 | */ |
||
27 | const SEARCH_DESTINATION_URI = 'server/server_city.php'; |
||
28 | |||
29 | /** |
||
30 | * Deliver URI. |
||
31 | */ |
||
32 | const DELIVER_URI = 'getDetailFare.php'; |
||
33 | |||
34 | /** |
||
35 | * Http client instance. |
||
36 | * |
||
37 | * @var \Jne\Contracts\HttpClientInterface |
||
38 | */ |
||
39 | protected $httpClient; |
||
40 | |||
41 | /** |
||
42 | * Get http client instance. |
||
43 | * |
||
44 | * @return \Jne\Contracts\HttpClientInterface |
||
45 | */ |
||
46 | 4 | public function httpClient() |
|
54 | |||
55 | /** |
||
56 | * Search for available origin location. |
||
57 | * |
||
58 | * @param string $query |
||
59 | * |
||
60 | * @return \Jne\Contracts\Collections\LocationCollectionInterface |
||
61 | */ |
||
62 | 1 | public function searchOrigin($query) |
|
66 | |||
67 | /** |
||
68 | * Search for available destination location. |
||
69 | * |
||
70 | * @param string $query |
||
71 | * |
||
72 | * @return \Jne\Contracts\Collections\LocationCollectionInterface |
||
73 | */ |
||
74 | 1 | public function searchDestination($query) |
|
78 | |||
79 | /** |
||
80 | * Search for available location. |
||
81 | * |
||
82 | * @param string $uri |
||
83 | * @param string $query |
||
84 | * |
||
85 | * @return \Jne\Contracts\Collections\LocationCollectionInterface |
||
86 | */ |
||
87 | 2 | protected function searchLocation($uri, $query) |
|
95 | |||
96 | /** |
||
97 | * Get delivery options. |
||
98 | * |
||
99 | * @param \Jne\Contracts\Foundation\PackageInterface $package |
||
100 | * |
||
101 | * @return \Jne\Contracts\Collections\DeliveryOptionCollectionInterface |
||
102 | */ |
||
103 | 1 | public function deliveryOptions(PackageInterface $package) |
|
109 | |||
110 | /** |
||
111 | * Get delivery options parameters. |
||
112 | * |
||
113 | * @param \Jne\Contracts\Foundation\PackageInterface $package |
||
114 | * |
||
115 | * @return array |
||
116 | */ |
||
117 | 1 | protected function deliveryOptionsParams(PackageInterface $package) |
|
127 | } |
||
128 |