|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Zanzara\Telegram\Type\Shipping; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* This object contains basic information about an invoice. |
|
9
|
|
|
* |
|
10
|
|
|
* More on https://core.telegram.org/bots/api#invoice |
|
11
|
|
|
*/ |
|
12
|
|
|
class Invoice |
|
13
|
|
|
{ |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Product name |
|
17
|
|
|
* |
|
18
|
|
|
* @var string |
|
19
|
|
|
*/ |
|
20
|
|
|
private $title; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Product description |
|
24
|
|
|
* |
|
25
|
|
|
* @var string |
|
26
|
|
|
*/ |
|
27
|
|
|
private $description; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Unique bot deep-linking parameter that can be used to generate this invoice |
|
31
|
|
|
* |
|
32
|
|
|
* @var string |
|
33
|
|
|
*/ |
|
34
|
|
|
private $start_parameter; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Three-letter ISO 4217 currency code |
|
38
|
|
|
* |
|
39
|
|
|
* @var string |
|
40
|
|
|
*/ |
|
41
|
|
|
private $currency; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 |
|
45
|
|
|
* pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point |
|
46
|
|
|
* for each currency (2 for the majority of currencies). |
|
47
|
|
|
* |
|
48
|
|
|
* @var int |
|
49
|
|
|
*/ |
|
50
|
|
|
private $total_amount; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @return string |
|
54
|
|
|
*/ |
|
55
|
|
|
public function getTitle(): string |
|
56
|
|
|
{ |
|
57
|
|
|
return $this->title; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @param string $title |
|
62
|
|
|
*/ |
|
63
|
|
|
public function setTitle(string $title): void |
|
64
|
|
|
{ |
|
65
|
|
|
$this->title = $title; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @return string |
|
70
|
|
|
*/ |
|
71
|
|
|
public function getDescription(): string |
|
72
|
|
|
{ |
|
73
|
|
|
return $this->description; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @param string $description |
|
78
|
|
|
*/ |
|
79
|
|
|
public function setDescription(string $description): void |
|
80
|
|
|
{ |
|
81
|
|
|
$this->description = $description; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @return string |
|
86
|
|
|
*/ |
|
87
|
|
|
public function getStartParameter(): string |
|
88
|
|
|
{ |
|
89
|
|
|
return $this->start_parameter; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @param string $start_parameter |
|
94
|
|
|
*/ |
|
95
|
|
|
public function setStartParameter(string $start_parameter): void |
|
96
|
|
|
{ |
|
97
|
|
|
$this->start_parameter = $start_parameter; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* @return string |
|
102
|
|
|
*/ |
|
103
|
|
|
public function getCurrency(): string |
|
104
|
|
|
{ |
|
105
|
|
|
return $this->currency; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* @param string $currency |
|
110
|
|
|
*/ |
|
111
|
|
|
public function setCurrency(string $currency): void |
|
112
|
|
|
{ |
|
113
|
|
|
$this->currency = $currency; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @return int |
|
118
|
|
|
*/ |
|
119
|
|
|
public function getTotalAmount(): int |
|
120
|
|
|
{ |
|
121
|
|
|
return $this->total_amount; |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
/** |
|
125
|
|
|
* @param int $total_amount |
|
126
|
|
|
*/ |
|
127
|
|
|
public function setTotalAmount(int $total_amount): void |
|
128
|
|
|
{ |
|
129
|
|
|
$this->total_amount = $total_amount; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
} |