mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 22:27:20 +02:00
Show 'phone/email passed to provider' in payments.
This commit is contained in:
parent
7cbe158d00
commit
cd4a9d7c16
5 changed files with 32 additions and 2 deletions
|
@ -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";
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -89,3 +89,6 @@ paymentTipsErrorLabel: FlatLabel(defaultFlatLabel) {
|
|||
textFg: boxTextFgError;
|
||||
}
|
||||
paymentTipsErrorPadding: margins(22px, 6px, 22px, 0px);
|
||||
|
||||
paymentsToProviderLabel: paymentsShippingPrice;
|
||||
paymentsToProviderPadding: margins(28px, 6px, 28px, 6px);
|
||||
|
|
|
@ -176,6 +176,24 @@ not_null<RpWidget*> 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<Ui::FlatLabel>(
|
||||
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<Ui::Checkbox>(
|
||||
inner,
|
||||
|
|
|
@ -52,6 +52,7 @@ struct Invoice {
|
|||
bool isFlexible = false;
|
||||
bool isTest = false;
|
||||
|
||||
QString provider;
|
||||
bool phoneSentToProvider = false;
|
||||
bool emailSentToProvider = false;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue