mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-13 04:37:11 +02:00
Added api support of subscription period in credits invoices.
This commit is contained in:
parent
81bea04db0
commit
03d9fb4115
2 changed files with 4 additions and 0 deletions
|
@ -456,6 +456,8 @@ void Form::requestForm() {
|
|||
const auto amount = tlPrices.empty()
|
||||
? 0
|
||||
: tlPrices.front().data().vamount().v;
|
||||
const auto subscriptionPeriod
|
||||
= data.vinvoice().data().vsubscription_period().value_or(0);
|
||||
if (currency != ::Ui::kCreditsCurrency || !amount) {
|
||||
using Type = Error::Type;
|
||||
_updates.fire(Error{ Type::Form, u"Bad Stars Form."_q });
|
||||
|
@ -467,6 +469,7 @@ void Form::requestForm() {
|
|||
.credits = amount,
|
||||
.currency = currency,
|
||||
.amount = amount,
|
||||
.subscriptionPeriod = subscriptionPeriod,
|
||||
};
|
||||
const auto formData = CreditsFormData{
|
||||
.id = _id,
|
||||
|
|
|
@ -170,6 +170,7 @@ struct InvoiceCredits {
|
|||
uint64 amount = 0;
|
||||
bool extended = false;
|
||||
PeerId giftPeerId = PeerId(0);
|
||||
int subscriptionPeriod = 0;
|
||||
};
|
||||
|
||||
struct InvoiceStarGift {
|
||||
|
|
Loading…
Add table
Reference in a new issue