2
0
mirror of https://github.com/tdlib/telegram-bot-api synced 2025-08-22 18:08:31 +00:00

Add transactionPartnerUser.transaction_type.

This commit is contained in:
levlam 2025-04-08 17:56:42 +03:00
parent 4c51721dff
commit 1be3aa8af8

View File

@ -4715,6 +4715,7 @@ class Client::JsonStarTransactionType final : public td::Jsonable {
} }
case td_api::starTransactionTypeBotPaidMediaSale::ID: { case td_api::starTransactionTypeBotPaidMediaSale::ID: {
auto type = static_cast<const td_api::starTransactionTypeBotPaidMediaSale *>(type_); auto type = static_cast<const td_api::starTransactionTypeBotPaidMediaSale *>(type_);
object("transaction_type", "paid_media_payment");
object("type", "user"); object("type", "user");
object("user", JsonUser(type->user_id_, client_)); object("user", JsonUser(type->user_id_, client_));
object("paid_media", td::json_array(type->media_, [client = client_](auto &media) { object("paid_media", td::json_array(type->media_, [client = client_](auto &media) {
@ -4730,6 +4731,7 @@ class Client::JsonStarTransactionType final : public td::Jsonable {
} }
case td_api::starTransactionTypeBotInvoiceSale::ID: { case td_api::starTransactionTypeBotInvoiceSale::ID: {
auto type = static_cast<const td_api::starTransactionTypeBotInvoiceSale *>(type_); auto type = static_cast<const td_api::starTransactionTypeBotInvoiceSale *>(type_);
object("transaction_type", "invoice_payment");
object("type", "user"); object("type", "user");
object("user", JsonUser(type->user_id_, client_)); object("user", JsonUser(type->user_id_, client_));
if (!type->invoice_payload_.empty()) { if (!type->invoice_payload_.empty()) {
@ -4747,6 +4749,7 @@ class Client::JsonStarTransactionType final : public td::Jsonable {
} }
case td_api::starTransactionTypeBotSubscriptionSale::ID: { case td_api::starTransactionTypeBotSubscriptionSale::ID: {
auto type = static_cast<const td_api::starTransactionTypeBotSubscriptionSale *>(type_); auto type = static_cast<const td_api::starTransactionTypeBotSubscriptionSale *>(type_);
object("transaction_type", "invoice_payment");
object("type", "user"); object("type", "user");
object("user", JsonUser(type->user_id_, client_)); object("user", JsonUser(type->user_id_, client_));
if (!type->invoice_payload_.empty()) { if (!type->invoice_payload_.empty()) {
@ -4779,6 +4782,7 @@ class Client::JsonStarTransactionType final : public td::Jsonable {
switch (type->owner_id_->get_id()) { switch (type->owner_id_->get_id()) {
case td_api::messageSenderUser::ID: { case td_api::messageSenderUser::ID: {
auto owner_id = static_cast<const td_api::messageSenderUser *>(type->owner_id_.get()); auto owner_id = static_cast<const td_api::messageSenderUser *>(type->owner_id_.get());
object("transaction_type", "gift_purchase");
object("type", "user"); object("type", "user");
object("user", JsonUser(owner_id->user_id_, client_)); object("user", JsonUser(owner_id->user_id_, client_));
break; break;
@ -4797,6 +4801,7 @@ class Client::JsonStarTransactionType final : public td::Jsonable {
} }
case td_api::starTransactionTypePremiumPurchase::ID: { case td_api::starTransactionTypePremiumPurchase::ID: {
auto type = static_cast<const td_api::starTransactionTypePremiumPurchase *>(type_); auto type = static_cast<const td_api::starTransactionTypePremiumPurchase *>(type_);
object("transaction_type", "premium_purchase");
object("type", "user"); object("type", "user");
object("user", JsonUser(type->user_id_, client_)); object("user", JsonUser(type->user_id_, client_));
object("premium_subscription_duration", type->month_count_); object("premium_subscription_duration", type->month_count_);
@ -4804,6 +4809,7 @@ class Client::JsonStarTransactionType final : public td::Jsonable {
} }
case td_api::starTransactionTypeBusinessBotTransferReceive::ID: { case td_api::starTransactionTypeBusinessBotTransferReceive::ID: {
auto type = static_cast<const td_api::starTransactionTypeBusinessBotTransferReceive *>(type_); auto type = static_cast<const td_api::starTransactionTypeBusinessBotTransferReceive *>(type_);
object("transaction_type", "business_account_transfer");
object("type", "user"); object("type", "user");
object("user", JsonUser(type->user_id_, client_)); object("user", JsonUser(type->user_id_, client_));
break; break;