1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types\Payments; |
4
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class SuccessfulPayment |
9
|
|
|
* This object contains basic information about a successful payment. |
10
|
|
|
* |
11
|
|
|
* @package TelegramBot\Api\Types\Payments |
12
|
|
|
*/ |
13
|
|
View Code Duplication |
class SuccessfulPayment extends BaseType |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @var array |
17
|
|
|
*/ |
18
|
|
|
static protected $requiredParams = ['currency', 'total_amount', 'invoice_payload', 'telegram_payment_charge_id', 'provider_payment_charge_id']; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var array |
22
|
|
|
*/ |
23
|
|
|
static protected $map = [ |
24
|
|
|
'currency' => true, |
25
|
|
|
'total_amount' => true, |
26
|
|
|
'invoice_payload' => true, |
27
|
|
|
'shipping_option_id' => true, |
28
|
|
|
'order_info' => OrderInfo::class, |
29
|
|
|
'telegram_payment_charge_id' => true, |
30
|
|
|
'provider_payment_charge_id' => true |
31
|
|
|
]; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Three-letter ISO 4217 currency code |
35
|
|
|
* |
36
|
|
|
* @var string |
37
|
|
|
*/ |
38
|
|
|
protected $currency; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Total price in the smallest units of the currency |
42
|
|
|
* |
43
|
|
|
* @var integer |
44
|
|
|
*/ |
45
|
|
|
protected $totalAmount; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Bot specified invoice payload |
49
|
|
|
* |
50
|
|
|
* @var array |
51
|
|
|
*/ |
52
|
|
|
protected $invoicePayload; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Optional. Identifier of the shipping option chosen by the user |
56
|
|
|
* |
57
|
|
|
* @var string |
58
|
|
|
*/ |
59
|
|
|
protected $shippingOptionId; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Optional. Order info provided by the user |
63
|
|
|
* |
64
|
|
|
* @var OrderInfo |
65
|
|
|
*/ |
66
|
|
|
protected $orderInfo; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Telegram payment identifier |
70
|
|
|
* |
71
|
|
|
* @var string |
72
|
|
|
*/ |
73
|
|
|
protected $telegramPaymentChargeId; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Provider payment identifier |
77
|
|
|
* |
78
|
|
|
* @var string |
79
|
|
|
*/ |
80
|
|
|
protected $providerPaymentChargeId; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @author MY |
84
|
|
|
* @return string |
85
|
|
|
*/ |
86
|
|
|
public function getCurrency() |
87
|
|
|
{ |
88
|
|
|
return $this->currency; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @author MY |
93
|
|
|
* @param string $currency |
94
|
|
|
*/ |
95
|
|
|
public function setCurrency($currency) |
96
|
|
|
{ |
97
|
|
|
$this->currency = $currency; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @author MY |
102
|
|
|
* @return int |
103
|
|
|
*/ |
104
|
|
|
public function getTotalAmount() |
105
|
|
|
{ |
106
|
|
|
return $this->totalAmount; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @author MY |
111
|
|
|
* @param int $totalAmount |
112
|
|
|
*/ |
113
|
|
|
public function setTotalAmount($totalAmount) |
114
|
|
|
{ |
115
|
|
|
$this->totalAmount = $totalAmount; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @author MY |
120
|
|
|
* @return array |
121
|
|
|
*/ |
122
|
|
|
public function getInvoicePayload() |
123
|
|
|
{ |
124
|
|
|
return $this->invoicePayload; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @author MY |
129
|
|
|
* @param array $invoicePayload |
130
|
|
|
*/ |
131
|
|
|
public function setInvoicePayload($invoicePayload) |
132
|
|
|
{ |
133
|
|
|
$this->invoicePayload = $invoicePayload; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @author MY |
138
|
|
|
* @return string |
139
|
|
|
*/ |
140
|
|
|
public function getShippingOptionId() |
141
|
|
|
{ |
142
|
|
|
return $this->shippingOptionId; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* @author MY |
147
|
|
|
* @param string $shippingOptionId |
148
|
|
|
*/ |
149
|
|
|
public function setShippingOptionId($shippingOptionId) |
150
|
|
|
{ |
151
|
|
|
$this->shippingOptionId = $shippingOptionId; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @author MY |
156
|
|
|
* @return string |
157
|
|
|
*/ |
158
|
|
|
public function getTelegramPaymentChargeId() |
159
|
|
|
{ |
160
|
|
|
return $this->telegramPaymentChargeId; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @author MY |
165
|
|
|
* @param string $telegramPaymentChargeId |
166
|
|
|
*/ |
167
|
|
|
public function setTelegramPaymentChargeId($telegramPaymentChargeId) |
168
|
|
|
{ |
169
|
|
|
$this->telegramPaymentChargeId = $telegramPaymentChargeId; |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* @author MY |
174
|
|
|
* @return mixed |
175
|
|
|
*/ |
176
|
|
|
public function getProviderPaymentChargeId() |
177
|
|
|
{ |
178
|
|
|
return $this->providerPaymentChargeId; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* @author MY |
183
|
|
|
* @param mixed $providerPaymentChargeId |
184
|
|
|
*/ |
185
|
|
|
public function setProviderPaymentChargeId($providerPaymentChargeId) |
186
|
|
|
{ |
187
|
|
|
$this->providerPaymentChargeId = $providerPaymentChargeId; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* @author MY |
192
|
|
|
* @return OrderInfo |
193
|
|
|
*/ |
194
|
|
|
public function getOrderInfo() |
195
|
|
|
{ |
196
|
|
|
return $this->orderInfo; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @author MY |
201
|
|
|
* @param OrderInfo $orderInfo |
202
|
|
|
*/ |
203
|
|
|
public function setOrderInfo($orderInfo) |
204
|
|
|
{ |
205
|
|
|
$this->orderInfo = $orderInfo; |
206
|
|
|
} |
207
|
|
|
} |
208
|
|
|
|