Passed
Push — main ( 27e66b...25b76e )
by Abbotton
12:06
created

Logistics::areaList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A Logistics::add() 0 3 1
1
<?php
2
3
namespace Abbotton\DouDian\Api;
4
5
use Illuminate\Http\Client\RequestException;
6
use Psr\SimpleCache\InvalidArgumentException;
7
8
class Logistics extends BaseRequest
9
{
10
    /**
11
     * 订单发货.
12
     *
13
     * @param  array  $params
14
     * @return array
15
     *
16
     * @throws RequestException
17
     * @throws InvalidArgumentException
18
     */
19
    public function add(array $params): array
20
    {
21
        return $this->httpPost('order/logisticsAdd', $params);
22
    }
23
24
    /**
25
     * 一个父订单可发多个物流包裹.
26
     *
27
     * @param  array  $params
28
     * @return array
29
     *
30
     * @throws RequestException
31
     * @throws InvalidArgumentException
32
     */
33
    public function addMultiPack(array $params): array
34
    {
35
        return $this->httpPost('order/logisticsAddMultiPack', $params);
36
    }
37
38
    /**
39
     * 支持多个子订单发同一个物流包裹.
40
     *
41
     * @param  array  $params
42
     * @return array
43
     *
44
     * @throws RequestException
45
     * @throws InvalidArgumentException
46
     */
47
    public function addSinglePack(array $params): array
48
    {
49
        return $this->httpPost('order/logisticsAddSinglePack', $params);
50
    }
51
52
    /**
53
     * 获取快递公司列表.
54
     *
55
     * @return array
56
     *
57
     * @throws RequestException
58
     * @throws InvalidArgumentException
59
     */
60
    public function companyList(): array
61
    {
62
        return $this->httpPost('order/logisticsCompanyList');
63
    }
64
65
    /**
66
     * 修改发货物流
67
     *
68
     * @param  array  $params
69
     * @return array
70
     *
71
     * @throws RequestException
72
     * @throws InvalidArgumentException
73
     */
74
    public function edit(array $params): array
75
    {
76
        return $this->httpPost('order/logisticsEdit', $params);
77
    }
78
79
    /**
80
     * 修改包裹里的物流信息.
81
     *
82
     * @param  array  $params
83
     * @return array
84
     *
85
     * @throws RequestException
86
     * @throws InvalidArgumentException
87
     */
88
    public function editByPack(array $params): array
89
    {
90
        return $this->httpPost('order/logisticsEditByPack', $params);
91
    }
92
93
    /**
94
     * 根据省获取全量四级地址.
95
     *
96
     * @param  array  $params
97
     * @return array
98
     *
99
     * @throws InvalidArgumentException
100
     * @throws RequestException
101
     */
102
    public function getAreasByProvince(array $params): array
103
    {
104
        return $this->httpPost('address/getAreasByProvince', $params);
105
    }
106
107
    /**
108
     * 获取四级地址全量省份信息.
109
     *
110
     * @return array
111
     *
112
     * @throws InvalidArgumentException
113
     * @throws RequestException
114
     */
115
    public function getProvince(): array
116
    {
117
        return $this->httpPost('address/getProvince');
118
    }
119
120
    /**
121
     * 顺丰新下单接口.
122
     *
123
     * @param  array  $params
124
     * @return array
125
     *
126
     * @throws InvalidArgumentException
127
     * @throws RequestException
128
     */
129
    public function createSFOrder(array $params): array
130
    {
131
        return $this->httpPost('logistics/createSFOrder', $params);
132
    }
133
134
    /**
135
     * 用于ISV/商家ERP系统 端发起取消已获取的电子面单号.
136
     *
137
     * @param  array  $params
138
     * @return array
139
     *
140
     * @throws InvalidArgumentException
141
     * @throws RequestException
142
     */
143
    public function cancelOrder(array $params): array
144
    {
145
        return $this->httpPost('logistics/cancelOrder', $params);
146
    }
147
148
    /**
149
     * 查询地址快递是否可以送达.
150
     *
151
     * @param  array  $params
152
     * @return array
153
     *
154
     * @throws InvalidArgumentException
155
     * @throws RequestException
156
     */
157
    public function getOutRange(array $params): array
158
    {
159
        return $this->httpPost('logistics/getOutRange', $params);
160
    }
161
162
    /**
163
     * 查询商家和物流商的订购关系以及物流单号使用情况.
164
     *
165
     * @param  array  $params
166
     * @return array
167
     *
168
     * @throws InvalidArgumentException
169
     * @throws RequestException
170
     */
171
    public function listShopNetsite(array $params): array
172
    {
173
        return $this->httpPost('logistics/listShopNetsite', $params);
174
    }
175
176
    /**
177
     * 商家ERP/ISV 向字节电子面单系统获取单号和打印信息.
178
     *
179
     * @param  array  $params
180
     * @return array
181
     *
182
     * @throws InvalidArgumentException
183
     * @throws RequestException
184
     */
185
    public function newCreateOrder(array $params): array
186
    {
187
        return $this->httpPost('logistics/newCreateOrder', $params);
188
    }
189
190
    /**
191
     * 更新收件人信息 以及发件人名字联系方式信息,不支持顺丰速递面单信息更新.
192
     *
193
     * @param  array  $params
194
     * @return array
195
     *
196
     * @throws InvalidArgumentException
197
     * @throws RequestException
198
     */
199
    public function updateOrder(array $params): array
200
    {
201
        return $this->httpPost('logistics/updateOrder', $params);
202
    }
203
204
    /**
205
     * 提供给isv查询运单轨迹的接口.
206
     *
207
     * @param  array  $params
208
     * @return array
209
     *
210
     * @throws InvalidArgumentException
211
     * @throws RequestException
212
     */
213
    public function trackNoRouteDetail(array $params): array
214
    {
215
        return $this->httpPost('logistics/trackNoRouteDetail', $params);
216
    }
217
218
    /**
219
     * 查询商家自定义区模板(新版).
220
     *
221
     * @param  array  $params
222
     * @return array
223
     *
224
     * @throws InvalidArgumentException
225
     * @throws RequestException
226
     */
227
    public function getCustomTemplateList(array $params): array
228
    {
229
        return $this->httpPost('logistics/getCustomTemplateList', $params);
230
    }
231
}
232