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; 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 //@description The chat is public, because it has an active username
publicChatTypeHasUsername = PublicChatType; publicChatTypeHasUsername = PublicChatType;
@ -2658,10 +2658,8 @@ paymentProviderOther url:string = PaymentProvider;
paymentOption title:string url:string = PaymentOption; paymentOption title:string url:string = PaymentOption;
//@description Contains information about an invoice payment form //@description Describes type of a payment form
//@id The payment form identifier
//@invoice Full information about the invoice //@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_user_id User identifier of the payment provider bot
//@payment_provider Information about the payment provider //@payment_provider Information about the payment provider
//@additional_payment_options The list of additional payment options //@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 //@saved_credentials The list of saved payment credentials
//@can_save_credentials True, if the user can choose to save 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 //@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_title Product title
//@product_description Product description //@product_description Product description
//@product_photo Product photo; may be null //@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 //@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; 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; 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 //@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; inlineQueryResultsButtonTypeStartBot parameter:string = InlineQueryResultsButtonType;
@ -6286,7 +6291,7 @@ chatBoostLink link:string is_public:Bool = ChatBoostLink;
chatBoostLinkInfo is_public:Bool chat_id:int53 = ChatBoostLinkInfo; 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 //@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; 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) { 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_); return td_api::make_object<td_api::paymentOption>(method->title_, method->url_);
}); });
promise_.set_value(make_tl_object<td_api::paymentForm>( auto type = td_api::make_object<td_api::paymentFormType>(
payment_form->form_id_, convert_invoice(std::move(payment_form->invoice_)), convert_invoice(std::move(payment_form->invoice_)),
td_->user_manager_->get_user_id_object(seller_bot_user_id, "paymentForm seller"),
td_->user_manager_->get_user_id_object(payments_provider_user_id, "paymentForm provider"), td_->user_manager_->get_user_id_object(payments_provider_user_id, "paymentForm provider"),
std::move(payment_provider), std::move(additional_payment_options), std::move(payment_provider), std::move(additional_payment_options),
convert_order_info(std::move(payment_form->saved_info_)), convert_order_info(std::move(payment_form->saved_info_)),
convert_saved_credentials(std::move(payment_form->saved_credentials_)), can_save_credentials, need_password, convert_saved_credentials(std::move(payment_form->saved_credentials_)), can_save_credentials, need_password);
payment_form->title_, get_product_description_object(payment_form->description_), promise_.set_value(td_api::make_object<td_api::paymentForm>(
get_photo_object(td_->file_manager_.get(), photo))); 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 { void on_error(Status status) final {