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
|
|
|
static protected $requiredParams = ['shipping_query_id', 'ok']; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var array |
24
|
|
|
*/ |
25
|
|
|
static protected $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 the order |
55
|
|
|
* |
56
|
|
|
* @var string |
57
|
|
|
*/ |
58
|
|
|
protected $errorMessage; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @author MY |
62
|
|
|
* @return string |
63
|
|
|
*/ |
64
|
|
|
public function getShippingQueryId() |
65
|
|
|
{ |
66
|
|
|
return $this->shippingQueryId; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @author MY |
71
|
|
|
* @param string $shippingQueryId |
72
|
|
|
*/ |
73
|
|
|
public function setShippingQueryId($shippingQueryId) |
74
|
|
|
{ |
75
|
|
|
$this->shippingQueryId = $shippingQueryId; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @author MY |
80
|
|
|
* @return bool |
81
|
|
|
*/ |
82
|
|
|
public function getOk() |
83
|
|
|
{ |
84
|
|
|
return $this->ok; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @author MY |
89
|
|
|
* @param true $ok |
90
|
|
|
*/ |
91
|
|
|
public function setOk($ok) |
92
|
|
|
{ |
93
|
|
|
$this->ok = $ok; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @author MY |
98
|
|
|
* @return array |
99
|
|
|
*/ |
100
|
|
|
public function getShippingOptions() |
101
|
|
|
{ |
102
|
|
|
return $this->shippingOptions; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @author MY |
107
|
|
|
* @param array $shippingOptions |
108
|
|
|
*/ |
109
|
|
|
public function setShippingOptions($shippingOptions) |
110
|
|
|
{ |
111
|
|
|
$this->shippingOptions = $shippingOptions; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @author MY |
116
|
|
|
* @return string |
117
|
|
|
*/ |
118
|
|
|
public function getErrorMessage() |
119
|
|
|
{ |
120
|
|
|
return $this->errorMessage; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @author MY |
125
|
|
|
* @param string $errorMessage |
126
|
|
|
*/ |
127
|
|
|
public function setErrorMessage($errorMessage) |
128
|
|
|
{ |
129
|
|
|
$this->errorMessage = $errorMessage; |
130
|
|
|
} |
131
|
|
|
} |
132
|
|
|
|