diff --git a/Telegram/SourceFiles/payments/payments_form.cpp b/Telegram/SourceFiles/payments/payments_form.cpp index 7941404c4..382226840 100644 --- a/Telegram/SourceFiles/payments/payments_form.cpp +++ b/Telegram/SourceFiles/payments/payments_form.cpp @@ -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, diff --git a/Telegram/SourceFiles/payments/payments_form.h b/Telegram/SourceFiles/payments/payments_form.h index 9b0d38d4d..d93fce51f 100644 --- a/Telegram/SourceFiles/payments/payments_form.h +++ b/Telegram/SourceFiles/payments/payments_form.h @@ -170,6 +170,7 @@ struct InvoiceCredits { uint64 amount = 0; bool extended = false; PeerId giftPeerId = PeerId(0); + int subscriptionPeriod = 0; }; struct InvoiceStarGift {