diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 9a59fa5c2..0594f9d1b 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1879,6 +1879,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_payments_info_name" = "Name"; "lng_payments_info_email" = "Email"; "lng_payments_info_phone" = "Phone"; +"lng_payments_to_provider_phone_email" = "Phone and Email will be passed to {bot_name} as billing info."; +"lng_payments_to_provider_email" = "Email will be passed to {bot_name} as billing info."; +"lng_payments_to_provider_phone" = "Phone will be passed to {bot_name} as billing info."; "lng_payments_shipping_address_title" = "Shipping Information"; "lng_payments_card_title" = "New Card"; "lng_payments_card_number" = "Card Number"; diff --git a/Telegram/SourceFiles/payments/payments_form.cpp b/Telegram/SourceFiles/payments/payments_form.cpp index 660f731bc..614a81232 100644 --- a/Telegram/SourceFiles/payments/payments_form.cpp +++ b/Telegram/SourceFiles/payments/payments_form.cpp @@ -336,11 +336,16 @@ void Form::processDetails(const MTPDpayments_paymentForm &data) { .canSaveCredentials = data.is_can_save_credentials(), .passwordMissing = data.is_password_missing(), }; - if (_details.botId) { - if (const auto bot = _session->data().userLoaded(_details.botId)) { + if (const auto botId = _details.botId) { + if (const auto bot = _session->data().userLoaded(botId)) { _invoice.cover.seller = bot->name; } } + if (const auto providerId = _details.providerId) { + if (const auto bot = _session->data().userLoaded(providerId)) { + _invoice.provider = bot->name; + } + } } void Form::processDetails(const MTPDpayments_paymentReceipt &data) { diff --git a/Telegram/SourceFiles/payments/ui/payments.style b/Telegram/SourceFiles/payments/ui/payments.style index 5a7ba8214..737c7b836 100644 --- a/Telegram/SourceFiles/payments/ui/payments.style +++ b/Telegram/SourceFiles/payments/ui/payments.style @@ -89,3 +89,6 @@ paymentTipsErrorLabel: FlatLabel(defaultFlatLabel) { textFg: boxTextFgError; } paymentTipsErrorPadding: margins(22px, 6px, 22px, 0px); + +paymentsToProviderLabel: paymentsShippingPrice; +paymentsToProviderPadding: margins(28px, 6px, 28px, 6px); diff --git a/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp b/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp index 04940544e..486842957 100644 --- a/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_edit_information.cpp @@ -176,6 +176,24 @@ not_null EditInformation::setupContent() { .defaultPhone = _information.defaultPhone, }); } + const auto emailToProvider = _invoice.isEmailRequested + && _invoice.emailSentToProvider; + const auto phoneToProvider = _invoice.isPhoneRequested + && _invoice.phoneSentToProvider; + if (emailToProvider || phoneToProvider) { + inner->add( + object_ptr( + inner, + ((emailToProvider && phoneToProvider) + ? tr::lng_payments_to_provider_phone_email + : emailToProvider + ? tr::lng_payments_to_provider_email + : tr::lng_payments_to_provider_phone)( + lt_bot_name, + rpl::single(_invoice.provider)), + st::paymentsToProviderLabel), + st::paymentsToProviderPadding); + } _save = inner->add( object_ptr( inner, diff --git a/Telegram/SourceFiles/payments/ui/payments_panel_data.h b/Telegram/SourceFiles/payments/ui/payments_panel_data.h index bfd8b78fe..6df01a54d 100644 --- a/Telegram/SourceFiles/payments/ui/payments_panel_data.h +++ b/Telegram/SourceFiles/payments/ui/payments_panel_data.h @@ -52,6 +52,7 @@ struct Invoice { bool isFlexible = false; bool isTest = false; + QString provider; bool phoneSentToProvider = false; bool emailSentToProvider = false;