Completed
Push — master ( 989005...ce143f )
by Camilo
04:43
created

PreCheckoutQuery   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 58
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A mapSubObjects() 0 9 2
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Types;
6
7
use unreal4u\TelegramAPI\Abstracts\TelegramTypes;
8
9
/**
10
 * This object contains information about an incoming pre-checkout query
11
 *
12
 * Objects defined as-is may 2017
13
 *
14
 * @see https://core.telegram.org/bots/api#shippingquery
15
 */
16
class PreCheckoutQuery extends TelegramTypes
17
{
18
    /**
19
     * Unique query identifier
20
     * @var string
21
     */
22
    public $id = '';
23
24
    /**
25
     * User who sent the query
26
     * @var User
27
     */
28
    public $from;
29
30
    /**
31
     * Three-letter ISO 4217 currency code
32
     * @see https://core.telegram.org/bots/payments#supported-currencies
33
     * @var string
34
     */
35
    public $currency = '';
36
37
    /**
38
     * Total price in the smallest units of the currency (integer, not float/double). For example, for a price of
39
     * US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the
40
     * decimal point for each currency (2 for the majority of currencies).
41
     * @see https://core.telegram.org/bots/payments/currencies.json
42
     * @var int
43
     */
44
    public $total_amount = 0;
45
46
    /**
47
     * Bot specified invoice payload
48
     * @var string
49
     */
50
    public $invoice_payload = '';
51
52
    /**
53
     * Optional. Identifier of the shipping option chosen by the user
54
     * @var string
55
     */
56
    public $shipping_option_id = '';
57
58
    /**
59
     * Optional. Order info provided by the user
60
     * @var OrderInfo
61
     */
62
    public $order_info;
63
64
    protected function mapSubObjects(string $key, array $data): TelegramTypes
65
    {
66
        switch ($key) {
67
            case 'order_info':
68
                return new OrderInfo($data, $this->logger);
69
        }
70
71
        return parent::mapSubObjects($key, $data);
72
    }
73
}
74