summaryrefslogtreecommitdiffstats
path: root/Telegram/SourceFiles/payments/payments_form.cpp
diff options
context:
space:
mode:
authorJohn Preston <johnprestonmail@gmail.com>2022-05-30 17:08:26 +0400
committerJohn Preston <johnprestonmail@gmail.com>2022-06-01 11:59:14 +0400
commitb7259615a71b3209a9748aa0636a31bf42be1a9a (patch)
tree1e5ef2fe47f55398eb311052c87563498cb5775c /Telegram/SourceFiles/payments/payments_form.cpp
parent8e6825771ef31c37002fc876bf4305e7986470b5 (diff)
Request terms acceptance for recurring payments.
Diffstat (limited to 'Telegram/SourceFiles/payments/payments_form.cpp')
-rw-r--r--Telegram/SourceFiles/payments/payments_form.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Telegram/SourceFiles/payments/payments_form.cpp b/Telegram/SourceFiles/payments/payments_form.cpp
index aa032df6e2..3b2411fdd3 100644
--- a/Telegram/SourceFiles/payments/payments_form.cpp
+++ b/Telegram/SourceFiles/payments/payments_form.cpp
@@ -368,9 +368,13 @@ void Form::processInvoice(const MTPDinvoice &data) {
.isPhoneRequested = data.is_phone_requested(),
.isEmailRequested = data.is_email_requested(),
.isShippingAddressRequested = data.is_shipping_address_requested(),
+ .isRecurring = data.is_recurring(),
.isFlexible = data.is_flexible(),
.isTest = data.is_test(),
+ .recurringTermsUrl = qs(
+ data.vrecurring_terms_url().value_or_empty()),
+
.phoneSentToProvider = data.is_phone_to_provider(),
.emailSentToProvider = data.is_email_to_provider(),
};
@@ -403,6 +407,7 @@ void Form::processDetails(const MTPDpayments_paymentForm &data) {
if (const auto botId = _details.botId) {
if (const auto bot = _session->data().userLoaded(botId)) {
_invoice.cover.seller = bot->name;
+ _details.termsBotUsername = bot->username;
}
}
if (const auto providerId = _details.providerId) {
@@ -938,6 +943,10 @@ void Form::setTips(int64 value) {
_invoice.tipsSelected = std::min(value, _invoice.tipsMax);
}
+void Form::acceptTerms() {
+ _details.termsAccepted = true;
+}
+
void Form::trustBot() {
_session->local().markBotTrustedPayment(_details.botId);
}