Passed
Pull Request — master (#408)
by Alexander
01:43
created

SuccessfulPayment::getCurrency()   A

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 3
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
    static protected $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
    static protected $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
64
     */
65
    protected $shippingOptionId;
66
67
    /**
68
     * Optional. Order info provided by the user
69
     *
70
     * @var OrderInfo
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
     * @param string $currency
100
     */
101
    public function setCurrency($currency)
102
    {
103
        $this->currency = $currency;
104
    }
105
106
    /**
107
     * @author MY
108
     * @return int
109
     */
110
    public function getTotalAmount()
111
    {
112
        return $this->totalAmount;
113
    }
114
115
    /**
116
     * @author MY
117
     * @param int $totalAmount
118
     */
119
    public function setTotalAmount($totalAmount)
120
    {
121
        $this->totalAmount = $totalAmount;
122
    }
123
124
    /**
125
     * @author MY
126
     * @return array
127
     */
128
    public function getInvoicePayload()
129
    {
130
        return $this->invoicePayload;
131
    }
132
133
    /**
134
     * @author MY
135
     * @param array $invoicePayload
136
     */
137
    public function setInvoicePayload($invoicePayload)
138
    {
139
        $this->invoicePayload = $invoicePayload;
140
    }
141
142
    /**
143
     * @author MY
144
     * @return string
145
     */
146
    public function getShippingOptionId()
147
    {
148
        return $this->shippingOptionId;
149
    }
150
151
    /**
152
     * @author MY
153
     * @param string $shippingOptionId
154
     */
155
    public function setShippingOptionId($shippingOptionId)
156
    {
157
        $this->shippingOptionId = $shippingOptionId;
158
    }
159
160
    /**
161
     * @author MY
162
     * @return string
163
     */
164
    public function getTelegramPaymentChargeId()
165
    {
166
        return $this->telegramPaymentChargeId;
167
    }
168
169
    /**
170
     * @author MY
171
     * @param string $telegramPaymentChargeId
172
     */
173
    public function setTelegramPaymentChargeId($telegramPaymentChargeId)
174
    {
175
        $this->telegramPaymentChargeId = $telegramPaymentChargeId;
176
    }
177
178
    /**
179
     * @author MY
180
     * @return mixed
181
     */
182
    public function getProviderPaymentChargeId()
183
    {
184
        return $this->providerPaymentChargeId;
185
    }
186
187
    /**
188
     * @author MY
189
     * @param mixed $providerPaymentChargeId
190
     */
191
    public function setProviderPaymentChargeId($providerPaymentChargeId)
192
    {
193
        $this->providerPaymentChargeId = $providerPaymentChargeId;
194
    }
195
196
    /**
197
     * @author MY
198
     * @return OrderInfo
199
     */
200
    public function getOrderInfo()
201
    {
202
        return $this->orderInfo;
203
    }
204
205
    /**
206
     * @author MY
207
     * @param OrderInfo $orderInfo
208
     */
209
    public function setOrderInfo($orderInfo)
210
    {
211
        $this->orderInfo = $orderInfo;
212
    }
213
}
214