tgbotxx  1.1.6.9
Telegram Bot C++ Library
tgbotxx::Invoice Struct Reference

This object contains basic information about an invoice. https://core.telegram.org/bots/api#invoice. More...

#include <Invoice.hpp>

Public Member Functions

 Invoice ()=default
 
 Invoice (const nl::json &json)
 
nl::json toJson () const
 Serializes this object to JSON. More...
 
void fromJson (const nl::json &json)
 Deserializes this object from JSON. More...
 

Public Attributes

std::string title
 Product name. More...
 
std::string description
 Product description. More...
 
std::string startParameter
 Unique bot deep-linking parameter that can be used to generate this invoice. More...
 
std::string currency
 Three-letter ISO 4217 currency code https://core.telegram.org/bots/payments#supported-currencies . More...
 
std::int32_t totalAmount {}
 Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). https://core.telegram.org/bots/payments/currencies.json . More...
 

Detailed Description

This object contains basic information about an invoice. https://core.telegram.org/bots/api#invoice.

Definition at line 7 of file Invoice.hpp.

Constructor & Destructor Documentation

◆ Invoice() [1/2]

tgbotxx::Invoice::Invoice ( )
default

◆ Invoice() [2/2]

tgbotxx::Invoice::Invoice ( const nl::json &  json)
inlineexplicit

Definition at line 9 of file Invoice.hpp.

Member Function Documentation

◆ fromJson()

void tgbotxx::Invoice::fromJson ( const nl::json &  json)
inline

Deserializes this object from JSON.

Definition at line 46 of file Invoice.hpp.

◆ toJson()

nl::json tgbotxx::Invoice::toJson ( ) const
inline

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 35 of file Invoice.hpp.

Member Data Documentation

◆ currency

std::string tgbotxx::Invoice::currency

Three-letter ISO 4217 currency code https://core.telegram.org/bots/payments#supported-currencies .

Definition at line 24 of file Invoice.hpp.

◆ description

std::string tgbotxx::Invoice::description

Product description.

Definition at line 17 of file Invoice.hpp.

◆ startParameter

std::string tgbotxx::Invoice::startParameter

Unique bot deep-linking parameter that can be used to generate this invoice.

Definition at line 20 of file Invoice.hpp.

◆ title

std::string tgbotxx::Invoice::title

Product name.

Definition at line 14 of file Invoice.hpp.

◆ totalAmount

std::int32_t tgbotxx::Invoice::totalAmount {}

Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). https://core.telegram.org/bots/payments/currencies.json .

Definition at line 30 of file Invoice.hpp.


The documentation for this struct was generated from the following file: