| Total Complexity | 1 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class LabeledPriceType |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Portion label. |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | public $label; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Price of the product in the smallest units of the currency (integer, not float/double). |
||
| 23 | * For example, for a price of US$ 1.45 pass amount = 145. |
||
| 24 | * See the exp parameter in currencies.json, |
||
| 25 | * it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). |
||
| 26 | * |
||
| 27 | * @see https://core.telegram.org/bots/payments#supported-currencies |
||
| 28 | * @see https://core.telegram.org/bots/payments/currencies.json |
||
| 29 | * |
||
| 30 | * @var int |
||
| 31 | */ |
||
| 32 | public $amount; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param string $label |
||
| 36 | * @param int $amount |
||
| 37 | */ |
||
| 38 | public static function create(string $label, int $amount) |
||
| 45 |