1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types\Payments\Query; |
4
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
6
|
|
|
use TelegramBot\Api\Types\Payments\ArrayOfLabeledPrice; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class AnswerShippingQuery |
10
|
|
|
* If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, |
11
|
|
|
* the Bot API will send an Update with a shipping_query field to the bot |
12
|
|
|
* |
13
|
|
|
* @package TelegramBot\Api\Types\Payments\Query |
14
|
|
|
*/ |
15
|
|
|
class AnswerShippingQuery extends BaseType |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* @var array |
19
|
|
|
*/ |
20
|
|
|
protected static $requiredParams = ['shipping_query_id', 'ok']; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var array |
24
|
|
|
*/ |
25
|
|
|
protected static $map = [ |
26
|
|
|
'shipping_query_id' => true, |
27
|
|
|
'ok' => true, |
28
|
|
|
'shipping_options' => ArrayOfLabeledPrice::class, |
29
|
|
|
'error_message' => true, |
30
|
|
|
]; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Unique identifier for the query to be answered |
34
|
|
|
* |
35
|
|
|
* @var string |
36
|
|
|
*/ |
37
|
|
|
protected $shippingQueryId; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Specify True if delivery to the specified address is possible and False if there are any problems |
41
|
|
|
* |
42
|
|
|
* @var true |
43
|
|
|
*/ |
44
|
|
|
protected $ok; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Required if ok is True. A JSON-serialized array of available shipping options. |
48
|
|
|
* |
49
|
|
|
* @var array |
50
|
|
|
*/ |
51
|
|
|
protected $shippingOptions; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Required if ok is False. Error message in human readable form that explains why it is impossible to complete |
55
|
|
|
* the order |
56
|
|
|
* |
57
|
|
|
* @var string |
58
|
|
|
*/ |
59
|
|
|
protected $errorMessage; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @author MY |
63
|
|
|
* @return string |
64
|
|
|
*/ |
65
|
|
|
public function getShippingQueryId() |
66
|
|
|
{ |
67
|
|
|
return $this->shippingQueryId; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @author MY |
72
|
|
|
* |
73
|
|
|
* @param string $shippingQueryId |
74
|
|
|
* |
75
|
|
|
* @return void |
76
|
|
|
*/ |
77
|
|
|
public function setShippingQueryId($shippingQueryId) |
78
|
|
|
{ |
79
|
|
|
$this->shippingQueryId = $shippingQueryId; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @author MY |
84
|
|
|
* @return bool |
85
|
|
|
*/ |
86
|
|
|
public function getOk() |
87
|
|
|
{ |
88
|
|
|
return $this->ok; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @author MY |
93
|
|
|
* |
94
|
|
|
* @param true $ok |
95
|
|
|
* |
96
|
|
|
* @return void |
97
|
|
|
*/ |
98
|
|
|
public function setOk($ok) |
99
|
|
|
{ |
100
|
|
|
$this->ok = $ok; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @author MY |
105
|
|
|
* @return array |
106
|
|
|
*/ |
107
|
|
|
public function getShippingOptions() |
108
|
|
|
{ |
109
|
|
|
return $this->shippingOptions; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @author MY |
114
|
|
|
* |
115
|
|
|
* @param array $shippingOptions |
116
|
|
|
* |
117
|
|
|
* @return void |
118
|
|
|
*/ |
119
|
|
|
public function setShippingOptions($shippingOptions) |
120
|
|
|
{ |
121
|
|
|
$this->shippingOptions = $shippingOptions; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @author MY |
126
|
|
|
* @return string |
127
|
|
|
*/ |
128
|
|
|
public function getErrorMessage() |
129
|
|
|
{ |
130
|
|
|
return $this->errorMessage; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @author MY |
135
|
|
|
* |
136
|
|
|
* @param string $errorMessage |
137
|
|
|
* |
138
|
|
|
* @return void |
139
|
|
|
*/ |
140
|
|
|
public function setErrorMessage($errorMessage) |
141
|
|
|
{ |
142
|
|
|
$this->errorMessage = $errorMessage; |
143
|
|
|
} |
144
|
|
|
} |
145
|
|
|
|