1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types\Payments\Query; |
4
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
6
|
|
|
use TelegramBot\Api\Types\Payments\ArrayOfLabeledPrice; |
7
|
|
|
use TelegramBot\Api\Types\Payments\ShippingAddress; |
8
|
|
|
use TelegramBot\Api\Types\User; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Class ShippingQuery |
12
|
|
|
* This object contains information about an incoming shipping query. |
13
|
|
|
* |
14
|
|
|
* @package TelegramBot\Api\Types\Payments\Query |
15
|
|
|
*/ |
16
|
|
|
class ShippingQuery extends BaseType |
17
|
|
|
{ |
18
|
|
|
/** |
19
|
|
|
* @var array |
20
|
|
|
*/ |
21
|
|
|
static protected $requiredParams = ['id', 'from', 'invoice_payload', 'shipping_address']; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* {@inheritdoc} |
25
|
|
|
* |
26
|
|
|
* @var array |
27
|
|
|
*/ |
28
|
|
|
static protected $map = [ |
29
|
|
|
'id' => true, |
30
|
|
|
'from' => User::class, |
31
|
|
|
'invoice_payload' => true, |
32
|
|
|
'shipping_address' => ShippingAddress::class |
33
|
|
|
]; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Unique query identifier |
37
|
|
|
* |
38
|
|
|
* @var string |
39
|
|
|
*/ |
40
|
|
|
protected $id; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* User who sent the query |
44
|
|
|
* |
45
|
|
|
* @var User |
46
|
|
|
*/ |
47
|
|
|
protected $from; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Bot specified invoice payload |
51
|
|
|
* |
52
|
|
|
* @var string |
53
|
|
|
*/ |
54
|
|
|
protected $invoicePayload; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* User specified shipping address |
58
|
|
|
* |
59
|
|
|
* @var ShippingAddress |
60
|
|
|
*/ |
61
|
|
|
protected $shippingAddress; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @author MY |
65
|
|
|
* @return string |
66
|
|
|
*/ |
67
|
|
|
public function getId() |
68
|
|
|
{ |
69
|
|
|
return $this->id; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @author MY |
74
|
|
|
* @param string $id |
75
|
|
|
*/ |
76
|
|
|
public function setId($id) |
77
|
|
|
{ |
78
|
|
|
$this->id = $id; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @author MY |
83
|
|
|
* @return User |
84
|
|
|
*/ |
85
|
|
|
public function getFrom() |
86
|
|
|
{ |
87
|
|
|
return $this->from; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @author MY |
92
|
|
|
* @param User $from |
93
|
|
|
*/ |
94
|
|
|
public function setFrom($from) |
95
|
|
|
{ |
96
|
|
|
$this->from = $from; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @author MY |
101
|
|
|
* @return string |
102
|
|
|
*/ |
103
|
|
|
public function getInvoicePayload() |
104
|
|
|
{ |
105
|
|
|
return $this->invoicePayload; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @author MY |
110
|
|
|
* @param string $invoicePayload |
111
|
|
|
*/ |
112
|
|
|
public function setInvoicePayload($invoicePayload) |
113
|
|
|
{ |
114
|
|
|
$this->invoicePayload = $invoicePayload; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @author MY |
119
|
|
|
* @return ShippingAddress |
120
|
|
|
*/ |
121
|
|
|
public function getShippingAddress() |
122
|
|
|
{ |
123
|
|
|
return $this->shippingAddress; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @author MY |
128
|
|
|
* @param ShippingAddress $shippingAddress |
129
|
|
|
*/ |
130
|
|
|
public function setShippingAddress($shippingAddress) |
131
|
|
|
{ |
132
|
|
|
$this->shippingAddress = $shippingAddress; |
133
|
|
|
} |
134
|
|
|
} |
135
|
|
|
|