|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace DalliSDK\Requests; |
|
6
|
|
|
|
|
7
|
|
|
use DalliSDK\Responses\PointResponse; |
|
8
|
|
|
use JMS\Serializer\Annotation as JMS; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Запрос списка ПВЗ |
|
12
|
|
|
* |
|
13
|
|
|
* @see https://api.dalli-service.com/v1/doc/pointsInfo |
|
14
|
|
|
* @JMS\XmlRoot("pointsInfo") |
|
15
|
|
|
*/ |
|
16
|
|
|
class PointRequest extends AbstractRequest implements RequestInterface |
|
17
|
|
|
{ |
|
18
|
|
|
public const RESPONSE_CLASS = PointResponse::class; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Может принимать значения: DS, SDEK, BOXBERRY, 5POST |
|
22
|
|
|
* |
|
23
|
|
|
* @JMS\Type("string") |
|
24
|
|
|
* @JMS\SerializedName("partner") |
|
25
|
|
|
*/ |
|
26
|
|
|
private ?string $partner = null; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* Код ФИАС. Указывается вместо города и области. Рекомендуем использовать именно его, а не текстовое название города |
|
30
|
|
|
* |
|
31
|
|
|
* @JMS\Type("string") |
|
32
|
|
|
* @JMS\SerializedName("fias") |
|
33
|
|
|
*/ |
|
34
|
|
|
private ?string $fias = null; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Область |
|
38
|
|
|
* |
|
39
|
|
|
* @JMS\Type("string") |
|
40
|
|
|
* @JMS\SerializedName("settlement") |
|
41
|
|
|
*/ |
|
42
|
|
|
private ?string $settlement = null; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Город (не рекомендуется) |
|
46
|
|
|
* |
|
47
|
|
|
* @JMS\Type("string") |
|
48
|
|
|
* @JMS\SerializedName("town") |
|
49
|
|
|
*/ |
|
50
|
|
|
private ?string $town = null; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Код ПВЗ |
|
54
|
|
|
* Параметры поиска ПВЗ не являются обязательными. Если не указан ни один параметр, то вы получите список всех ПВЗ |
|
55
|
|
|
* |
|
56
|
|
|
* @JMS\Type("string") |
|
57
|
|
|
* @JMS\SerializedName("pvzcode") |
|
58
|
|
|
*/ |
|
59
|
|
|
private ?string $pvzcode = null; |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* Индекс |
|
63
|
|
|
* |
|
64
|
|
|
* @JMS\Type("string") |
|
65
|
|
|
* @JMS\SerializedName("zipcode") |
|
66
|
|
|
*/ |
|
67
|
|
|
private ?string $zipcode = null; |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* Если 1 - принимает оплату картой, 0 - не принимает оплату картой, null - сброс фильтра |
|
71
|
|
|
* |
|
72
|
|
|
* @JMS\Type("string") |
|
73
|
|
|
* @JMS\SerializedName("acquiring") |
|
74
|
|
|
*/ |
|
75
|
|
|
private ?string $acquiring = null; |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* Если 1 -принимает оплату наличными, 0 - не принимает оплату наличными, null - сброс фильтра |
|
79
|
|
|
* |
|
80
|
|
|
* @JMS\Type("string") |
|
81
|
|
|
* @JMS\SerializedName("cash") |
|
82
|
|
|
*/ |
|
83
|
|
|
private ?string $cash = null; |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* @param string|null $town |
|
87
|
|
|
* @param string|null $partner |
|
88
|
|
|
* @param string|null $settlement |
|
89
|
|
|
* @param string|null $fias |
|
90
|
|
|
* @param string|null $zipcode |
|
91
|
|
|
*/ |
|
92
|
3 |
|
public function __construct(?string $town = null, ?string $partner = null, ?string $settlement = null, ?string $fias = null, ?string $zipcode = null) |
|
93
|
|
|
{ |
|
94
|
3 |
|
$this->town = $town; |
|
95
|
3 |
|
$this->partner = $partner; |
|
96
|
3 |
|
$this->settlement = $settlement; |
|
97
|
3 |
|
$this->fias = $fias; |
|
98
|
3 |
|
$this->zipcode = $zipcode; |
|
99
|
|
|
} |
|
100
|
|
|
|
|
101
|
|
|
/** |
|
102
|
|
|
* @return string|null |
|
103
|
|
|
*/ |
|
104
|
3 |
|
public function getTown(): ?string |
|
105
|
|
|
{ |
|
106
|
3 |
|
return $this->town; |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* @param string|null $town |
|
111
|
|
|
* |
|
112
|
|
|
* @return PointRequest |
|
113
|
|
|
*/ |
|
114
|
2 |
|
public function setTown(?string $town): PointRequest |
|
115
|
|
|
{ |
|
116
|
2 |
|
$this->town = $town; |
|
117
|
2 |
|
return $this; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* @return string|null |
|
122
|
|
|
*/ |
|
123
|
3 |
|
public function getPartner(): ?string |
|
124
|
|
|
{ |
|
125
|
3 |
|
return $this->partner; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* @param string|null $partner |
|
130
|
|
|
* |
|
131
|
|
|
* @return PointRequest |
|
132
|
|
|
*/ |
|
133
|
3 |
|
public function setPartner(?string $partner): PointRequest |
|
134
|
|
|
{ |
|
135
|
|
|
//todo add enums validation |
|
136
|
3 |
|
$this->partner = $partner; |
|
137
|
3 |
|
return $this; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* @return string|null |
|
142
|
|
|
*/ |
|
143
|
3 |
|
public function getSettlement(): ?string |
|
144
|
|
|
{ |
|
145
|
3 |
|
return $this->settlement; |
|
146
|
|
|
} |
|
147
|
|
|
|
|
148
|
|
|
/** |
|
149
|
|
|
* @param string|null $settlement |
|
150
|
|
|
* |
|
151
|
|
|
* @return PointRequest |
|
152
|
|
|
*/ |
|
153
|
2 |
|
public function setSettlement(?string $settlement): PointRequest |
|
154
|
|
|
{ |
|
155
|
2 |
|
$this->settlement = $settlement; |
|
156
|
2 |
|
return $this; |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
/** |
|
160
|
|
|
* @return string|null |
|
161
|
|
|
*/ |
|
162
|
3 |
|
public function getFias(): ?string |
|
163
|
|
|
{ |
|
164
|
3 |
|
return $this->fias; |
|
165
|
|
|
} |
|
166
|
|
|
|
|
167
|
|
|
/** |
|
168
|
|
|
* @param string|null $fias |
|
169
|
|
|
* |
|
170
|
|
|
* @return PointRequest |
|
171
|
|
|
*/ |
|
172
|
2 |
|
public function setFias(?string $fias): PointRequest |
|
173
|
|
|
{ |
|
174
|
2 |
|
$this->fias = $fias; |
|
175
|
2 |
|
return $this; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
/** |
|
179
|
|
|
* @return string|null |
|
180
|
|
|
*/ |
|
181
|
3 |
|
public function getZipcode(): ?string |
|
182
|
|
|
{ |
|
183
|
3 |
|
return $this->zipcode; |
|
184
|
|
|
} |
|
185
|
|
|
|
|
186
|
|
|
/** |
|
187
|
|
|
* @param string|null $zipcode |
|
188
|
|
|
* |
|
189
|
|
|
* @return PointRequest |
|
190
|
|
|
*/ |
|
191
|
2 |
|
public function setZipcode(?string $zipcode): PointRequest |
|
192
|
|
|
{ |
|
193
|
2 |
|
$this->zipcode = $zipcode; |
|
194
|
2 |
|
return $this; |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
/** |
|
198
|
|
|
* @return string|null |
|
199
|
|
|
*/ |
|
200
|
1 |
|
public function getPvzcode(): ?string |
|
201
|
|
|
{ |
|
202
|
1 |
|
return $this->pvzcode; |
|
203
|
|
|
} |
|
204
|
|
|
|
|
205
|
|
|
/** |
|
206
|
|
|
* @param string|null $pvzcode |
|
207
|
|
|
* |
|
208
|
|
|
* @return PointRequest |
|
209
|
|
|
*/ |
|
210
|
1 |
|
public function setPvzcode(?string $pvzcode): PointRequest |
|
211
|
|
|
{ |
|
212
|
1 |
|
$this->pvzcode = $pvzcode; |
|
213
|
1 |
|
return $this; |
|
214
|
|
|
} |
|
215
|
|
|
|
|
216
|
|
|
/** |
|
217
|
|
|
* @return string|null |
|
218
|
|
|
*/ |
|
219
|
1 |
|
public function getAcquiring(): ?string |
|
220
|
|
|
{ |
|
221
|
1 |
|
return $this->acquiring; |
|
222
|
|
|
} |
|
223
|
|
|
|
|
224
|
|
|
/** |
|
225
|
|
|
* @param string|null $acquiring |
|
226
|
|
|
* |
|
227
|
|
|
* @return $this |
|
228
|
|
|
*/ |
|
229
|
1 |
|
public function setAcquiring(?string $acquiring): PointRequest |
|
230
|
|
|
{ |
|
231
|
1 |
|
$this->acquiring = $acquiring; |
|
232
|
1 |
|
return $this; |
|
233
|
|
|
} |
|
234
|
|
|
|
|
235
|
|
|
/** |
|
236
|
|
|
* @return string|null |
|
237
|
|
|
*/ |
|
238
|
1 |
|
public function getCash(): ?string |
|
239
|
|
|
{ |
|
240
|
1 |
|
return $this->cash; |
|
241
|
|
|
} |
|
242
|
|
|
|
|
243
|
|
|
/** |
|
244
|
|
|
* @param string|null $cash |
|
245
|
|
|
* |
|
246
|
|
|
* @return $this |
|
247
|
|
|
*/ |
|
248
|
1 |
|
public function setCash(?string $cash): PointRequest |
|
249
|
|
|
{ |
|
250
|
1 |
|
$this->cash = $cash; |
|
251
|
1 |
|
return $this; |
|
252
|
|
|
} |
|
253
|
|
|
} |
|
254
|
|
|
|