mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-05 09:05:14 +00:00
Support additional payment methods.
This commit is contained in:
@@ -318,6 +318,9 @@ void Form::processForm(const MTPDpayments_paymentForm &data) {
|
||||
processSavedCredentials(data);
|
||||
});
|
||||
}
|
||||
if (const auto additional = data.vadditional_methods()) {
|
||||
processAdditionalPaymentMethods(additional->v);
|
||||
}
|
||||
fillPaymentMethodInformation();
|
||||
_updates.fire(FormReady{});
|
||||
}
|
||||
@@ -470,6 +473,18 @@ void Form::processSavedCredentials(
|
||||
refreshPaymentMethodDetails();
|
||||
}
|
||||
|
||||
void Form::processAdditionalPaymentMethods(
|
||||
const QVector<MTPPaymentFormMethod> &list) {
|
||||
_paymentMethod.ui.additionalMethods = ranges::views::all(
|
||||
list
|
||||
) | ranges::views::transform([](const MTPPaymentFormMethod &method) {
|
||||
return Ui::PaymentMethodAdditional{
|
||||
.title = qs(method.data().vtitle()),
|
||||
.url = qs(method.data().vurl()),
|
||||
};
|
||||
}) | ranges::to_vector;
|
||||
}
|
||||
|
||||
void Form::refreshPaymentMethodDetails() {
|
||||
const auto &saved = _paymentMethod.savedCredentials;
|
||||
const auto &entered = _paymentMethod.newCredentials;
|
||||
|
Reference in New Issue
Block a user