tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
tgbotxx::StarTransaction Struct Reference

Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control. https://core.telegram.org/bots/api#startransaction. More...

#include <StarTransaction.hpp>

Public Member Functions

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

Public Attributes

std::string id
 Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.
 
std::int64_t amount {}
 Integer amount of Telegram Stars transferred by the transaction.
 
std::int32_t nanostarAmount {}
 Optional. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999.
 
std::time_t date {}
 Date the transaction was created in Unix time.
 
Ptr< TransactionPartnersource
 Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions.
 
Ptr< TransactionPartnerreceiver
 Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions.
 

Detailed Description

Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control. https://core.telegram.org/bots/api#startransaction.

Definition at line 13 of file StarTransaction.hpp.

Constructor & Destructor Documentation

◆ StarTransaction() [1/2]

tgbotxx::StarTransaction::StarTransaction ( )
default

◆ StarTransaction() [2/2]

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

Definition at line 15 of file StarTransaction.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 53 of file StarTransaction.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 41 of file StarTransaction.hpp.

Member Data Documentation

◆ amount

std::int64_t tgbotxx::StarTransaction::amount {}

Integer amount of Telegram Stars transferred by the transaction.

Definition at line 25 of file StarTransaction.hpp.

◆ date

std::time_t tgbotxx::StarTransaction::date {}

Date the transaction was created in Unix time.

Definition at line 31 of file StarTransaction.hpp.

◆ id

std::string tgbotxx::StarTransaction::id

Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.

Definition at line 22 of file StarTransaction.hpp.

◆ nanostarAmount

std::int32_t tgbotxx::StarTransaction::nanostarAmount {}

Optional. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999.

Definition at line 28 of file StarTransaction.hpp.

◆ receiver

Ptr<TransactionPartner> tgbotxx::StarTransaction::receiver

Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions.

Definition at line 37 of file StarTransaction.hpp.

◆ source

Ptr<TransactionPartner> tgbotxx::StarTransaction::source

Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions.

Definition at line 34 of file StarTransaction.hpp.


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