Add class td_api::paymentFormType.

This commit is contained in:
levlam 2024-05-17 12:51:57 +03:00
parent 437f99a45e
commit 560d745f22
2 changed files with 19 additions and 13 deletions

View File

@ -1957,7 +1957,7 @@ chatNearby chat_id:int53 distance:int32 = ChatNearby;
chatsNearby users_nearby:vector<chatNearby> supergroups_nearby:vector<chatNearby> = ChatsNearby;
//@class PublicChatType @description Describes a type of public chats
//@class PublicChatType @description Describes type of public chats
//@description The chat is public, because it has an active username
publicChatTypeHasUsername = PublicChatType;
@ -2658,10 +2658,8 @@ paymentProviderOther url:string = PaymentProvider;
paymentOption title:string url:string = PaymentOption;
//@description Contains information about an invoice payment form
//@id The payment form identifier
//@description Describes type of a payment form
//@invoice Full information about the invoice
//@seller_bot_user_id User identifier of the seller bot
//@payment_provider_user_id User identifier of the payment provider bot
//@payment_provider Information about the payment provider
//@additional_payment_options The list of additional payment options
@ -2669,10 +2667,17 @@ paymentOption title:string url:string = PaymentOption;
//@saved_credentials The list of saved payment credentials
//@can_save_credentials True, if the user can choose to save credentials
//@need_password True, if the user will be able to save credentials, if sets up a 2-step verification password
paymentFormType invoice:invoice payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector<paymentOption> saved_order_info:orderInfo saved_credentials:vector<savedCredentials> can_save_credentials:Bool need_password:Bool = PaymentFormType;
//@description Contains information about an invoice payment form
//@id The payment form identifier
//@type Type of the payment form
//@seller_bot_user_id User identifier of the seller bot
//@product_title Product title
//@product_description Product description
//@product_photo Product photo; may be null
paymentForm id:int64 invoice:invoice seller_bot_user_id:int53 payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector<paymentOption> saved_order_info:orderInfo saved_credentials:vector<savedCredentials> can_save_credentials:Bool need_password:Bool product_title:string product_description:formattedText product_photo:photo = PaymentForm;
paymentForm id:int64 type:paymentFormType seller_bot_user_id:int53 product_title:string product_description:formattedText product_photo:photo = PaymentForm;
//@description Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options @order_info_id Temporary identifier of the order information @shipping_options Available shipping options
validatedOrderInfo order_info_id:string shipping_options:vector<shippingOption> = ValidatedOrderInfo;
@ -4750,7 +4755,7 @@ inlineQueryResultVideo id:string video:video title:string description:string = I
inlineQueryResultVoiceNote id:string voice_note:voiceNote title:string = InlineQueryResult;
//@class InlineQueryResultsButtonType @description Represents a type of button in results of inline query
//@class InlineQueryResultsButtonType @description Represents type of button in results of inline query
//@description Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter @parameter The parameter for the bot start message
inlineQueryResultsButtonTypeStartBot parameter:string = InlineQueryResultsButtonType;
@ -6286,7 +6291,7 @@ chatBoostLink link:string is_public:Bool = ChatBoostLink;
chatBoostLinkInfo is_public:Bool chat_id:int53 = ChatBoostLinkInfo;
//@class BlockList @description Describes a type of block list
//@class BlockList @description Describes type of block list
//@description The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions
blockListMain = BlockList;

View File

@ -480,15 +480,16 @@ class GetPaymentFormQuery final : public Td::ResultHandler {
payment_form->additional_methods_, [](const telegram_api::object_ptr<telegram_api::paymentFormMethod> &method) {
return td_api::make_object<td_api::paymentOption>(method->title_, method->url_);
});
promise_.set_value(make_tl_object<td_api::paymentForm>(
payment_form->form_id_, convert_invoice(std::move(payment_form->invoice_)),
td_->user_manager_->get_user_id_object(seller_bot_user_id, "paymentForm seller"),
auto type = td_api::make_object<td_api::paymentFormType>(
convert_invoice(std::move(payment_form->invoice_)),
td_->user_manager_->get_user_id_object(payments_provider_user_id, "paymentForm provider"),
std::move(payment_provider), std::move(additional_payment_options),
convert_order_info(std::move(payment_form->saved_info_)),
convert_saved_credentials(std::move(payment_form->saved_credentials_)), can_save_credentials, need_password,
payment_form->title_, get_product_description_object(payment_form->description_),
get_photo_object(td_->file_manager_.get(), photo)));
convert_saved_credentials(std::move(payment_form->saved_credentials_)), can_save_credentials, need_password);
promise_.set_value(td_api::make_object<td_api::paymentForm>(
payment_form->form_id_, std::move(type),
td_->user_manager_->get_user_id_object(seller_bot_user_id, "paymentForm seller"), payment_form->title_,
get_product_description_object(payment_form->description_), get_photo_object(td_->file_manager_.get(), photo)));
}
void on_error(Status status) final {