From 4665ea28544cdf8dfa5ac91f184997291ba038a8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 5 May 2022 10:01:15 +0400 Subject: [PATCH] Update API scheme on layer 142. --- Telegram/Resources/tl/api.tl | 14 ++++++++++---- Telegram/SourceFiles/payments/payments_form.cpp | 9 +++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Telegram/Resources/tl/api.tl b/Telegram/Resources/tl/api.tl index 9d5dbca5c..5da94956c 100644 --- a/Telegram/Resources/tl/api.tl +++ b/Telegram/Resources/tl/api.tl @@ -844,7 +844,7 @@ inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile; -payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm; +payments.paymentForm#b0133b37 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true test:flags.6?true form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm; payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo; @@ -1376,6 +1376,11 @@ attachMenuPeerTypePM#f146d31f = AttachMenuPeerType; attachMenuPeerTypeChat#509113f = AttachMenuPeerType; attachMenuPeerTypeBroadcast#7bfbdefc = AttachMenuPeerType; +inputInvoiceMessage#c5b56859 peer:InputPeer msg_id:int = InputInvoice; +inputInvoiceSlug#c326caef slug:string = InputInvoice; + +payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1770,13 +1775,14 @@ bots.getBotMenuButton#9c60eb28 user_id:InputUser = BotMenuButton; bots.setBotBroadcastDefaultAdminRights#788464e1 admin_rights:ChatAdminRights = Bool; bots.setBotGroupDefaultAdminRights#925ec9ea admin_rights:ChatAdminRights = Bool; -payments.getPaymentForm#8a333c8d flags:# peer:InputPeer msg_id:int theme_params:flags.0?DataJSON = payments.PaymentForm; +payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm; payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt; -payments.validateRequestedInfo#db103170 flags:# save:flags.0?true peer:InputPeer msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo; -payments.sendPaymentForm#30c3bc9d flags:# form_id:long peer:InputPeer msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult; +payments.validateRequestedInfo#b6c8f12b flags:# save:flags.0?true invoice:InputInvoice info:PaymentRequestedInfo = payments.ValidatedRequestedInfo; +payments.sendPaymentForm#2d03522f flags:# form_id:long invoice:InputInvoice requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult; payments.getSavedInfo#227d824b = payments.SavedInfo; payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool; payments.getBankCardData#2e79d779 number:string = payments.BankCardData; +payments.exportInvoice#fa7b08fd user_id:InputUser invoice_media:InputMedia = payments.ExportedInvoice; stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true animated:flags.1?true videos:flags.4?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector software:flags.3?string = messages.StickerSet; stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet; diff --git a/Telegram/SourceFiles/payments/payments_form.cpp b/Telegram/SourceFiles/payments/payments_form.cpp index a8fd127ff..0f853c892 100644 --- a/Telegram/SourceFiles/payments/payments_form.cpp +++ b/Telegram/SourceFiles/payments/payments_form.cpp @@ -241,8 +241,7 @@ void Form::requestForm() { showProgress(); _api.request(MTPpayments_GetPaymentForm( MTP_flags(MTPpayments_GetPaymentForm::Flag::f_theme_params), - _peer->input, - MTP_int(_msgId), + MTP_inputInvoiceMessage(_peer->input, MTP_int(_msgId)), MTP_dataJSON(MTP_bytes(Window::Theme::WebViewParams().json)) )).done([=](const MTPpayments_PaymentForm &result) { hideProgress(); @@ -554,8 +553,7 @@ void Form::submit() { : Flag::f_shipping_option_id) | (_invoice.tipsMax > 0 ? Flag::f_tip_amount : Flag(0))), MTP_long(_details.formId), - _peer->input, - MTP_int(_msgId), + MTP_inputInvoiceMessage(_peer->input, MTP_int(_msgId)), MTP_string(_requestedInformationId), MTP_string(_shippingOptions.selectedId), (_paymentMethod.newCredentials @@ -626,8 +624,7 @@ void Form::validateInformation(const Ui::RequestedInformation &information) { using Flag = MTPpayments_ValidateRequestedInfo::Flag; _validateRequestId = _api.request(MTPpayments_ValidateRequestedInfo( MTP_flags(information.save ? Flag::f_save : Flag(0)), - _peer->input, - MTP_int(_msgId), + MTP_inputInvoiceMessage(_peer->input, MTP_int(_msgId)), Serialize(information) )).done([=](const MTPpayments_ValidatedRequestedInfo &result) { hideProgress();