SuccessfulPayment::getProviderPaymentChargeId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 1
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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
class SuccessfulPayment extends BaseType
14
{
15
    /**
16
     * @var array
17
     */
18
    protected static $requiredParams = [
19
        'currency',
20
        'total_amount',
21
        'invoice_payload',
22
        'telegram_payment_charge_id',
23
        'provider_payment_charge_id'
24
    ];
25
26
    /**
27
     * @var array
28
     */
29
    protected static $map = [
30
        'currency' => true,
31
        'total_amount' => true,
32
        'invoice_payload' => true,
33
        'shipping_option_id' => true,
34
        'order_info' => OrderInfo::class,
35
        'telegram_payment_charge_id' => true,
36
        'provider_payment_charge_id' => true
37
    ];
38
39
    /**
40
     * Three-letter ISO 4217 currency code
41
     *
42
     * @var string
43
     */
44
    protected $currency;
45
46
    /**
47
     * Total price in the smallest units of the currency
48
     *
49
     * @var integer
50
     */
51
    protected $totalAmount;
52
53
    /**
54
     * Bot specified invoice payload
55
     *
56
     * @var array
57
     */
58
    protected $invoicePayload;
59
60
    /**
61
     * Optional. Identifier of the shipping option chosen by the user
62
     *
63
     * @var string|null
64
     */
65
    protected $shippingOptionId;
66
67
    /**
68
     * Optional. Order info provided by the user
69
     *
70
     * @var OrderInfo|null
71
     */
72
    protected $orderInfo;
73
74
    /**
75
     * Telegram payment identifier
76
     *
77
     * @var string
78
     */
79
    protected $telegramPaymentChargeId;
80
81
    /**
82
     * Provider payment identifier
83
     *
84
     * @var string
85
     */
86
    protected $providerPaymentChargeId;
87
88
    /**
89
     * @author MY
90
     * @return string
91
     */
92
    public function getCurrency()
93
    {
94
        return $this->currency;
95
    }
96
97
    /**
98
     * @author MY
99
     *
100
     * @param string $currency
101
     *
102
     * @return void
103
     */
104
    public function setCurrency($currency)
105
    {
106
        $this->currency = $currency;
107
    }
108
109
    /**
110
     * @author MY
111
     * @return int
112
     */
113
    public function getTotalAmount()
114
    {
115
        return $this->totalAmount;
116
    }
117
118
    /**
119
     * @author MY
120
     *
121
     * @param int $totalAmount
122
     *
123
     * @return void
124
     */
125
    public function setTotalAmount($totalAmount)
126
    {
127
        $this->totalAmount = $totalAmount;
128
    }
129
130
    /**
131
     * @author MY
132
     * @return array
133
     */
134
    public function getInvoicePayload()
135
    {
136
        return $this->invoicePayload;
137
    }
138
139
    /**
140
     * @author MY
141
     *
142
     * @param array $invoicePayload
143
     *
144
     * @return void
145
     */
146
    public function setInvoicePayload($invoicePayload)
147
    {
148
        $this->invoicePayload = $invoicePayload;
149
    }
150
151
    /**
152
     * @author MY
153
     *
154
     * @return null|string
155
     */
156
    public function getShippingOptionId()
157
    {
158
        return $this->shippingOptionId;
159
    }
160
161
    /**
162
     * @author MY
163
     *
164
     * @param string $shippingOptionId
165
     *
166
     * @return void
167
     */
168
    public function setShippingOptionId($shippingOptionId)
169
    {
170
        $this->shippingOptionId = $shippingOptionId;
171
    }
172
173
    /**
174
     * @author MY
175
     * @return string
176
     */
177
    public function getTelegramPaymentChargeId()
178
    {
179
        return $this->telegramPaymentChargeId;
180
    }
181
182
    /**
183
     * @author MY
184
     *
185
     * @param string $telegramPaymentChargeId
186
     *
187
     * @return void
188
     */
189
    public function setTelegramPaymentChargeId($telegramPaymentChargeId)
190
    {
191
        $this->telegramPaymentChargeId = $telegramPaymentChargeId;
192
    }
193
194
    /**
195
     * @author MY
196
     * @return mixed
197
     */
198
    public function getProviderPaymentChargeId()
199
    {
200
        return $this->providerPaymentChargeId;
201
    }
202
203
    /**
204
     * @author MY
205
     *
206
     * @param mixed $providerPaymentChargeId
207
     *
208
     * @return void
209
     */
210
    public function setProviderPaymentChargeId($providerPaymentChargeId)
211
    {
212
        $this->providerPaymentChargeId = $providerPaymentChargeId;
213
    }
214
215
    /**
216
     * @author MY
217
     *
218
     * @return OrderInfo|null
219
     */
220
    public function getOrderInfo()
221
    {
222
        return $this->orderInfo;
223
    }
224
225
    /**
226
     * @author MY
227
     *
228
     * @param OrderInfo $orderInfo
229
     *
230
     * @return void
231
     */
232
    public function setOrderInfo($orderInfo)
233
    {
234
        $this->orderInfo = $orderInfo;
235
    }
236
}
237