mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +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()
|
const auto amount = tlPrices.empty()
|
||||||
? 0
|
? 0
|
||||||
: tlPrices.front().data().vamount().v;
|
: tlPrices.front().data().vamount().v;
|
||||||
|
const auto subscriptionPeriod
|
||||||
|
= data.vinvoice().data().vsubscription_period().value_or(0);
|
||||||
if (currency != ::Ui::kCreditsCurrency || !amount) {
|
if (currency != ::Ui::kCreditsCurrency || !amount) {
|
||||||
using Type = Error::Type;
|
using Type = Error::Type;
|
||||||
_updates.fire(Error{ Type::Form, u"Bad Stars Form."_q });
|
_updates.fire(Error{ Type::Form, u"Bad Stars Form."_q });
|
||||||
|
@ -467,6 +469,7 @@ void Form::requestForm() {
|
||||||
.credits = amount,
|
.credits = amount,
|
||||||
.currency = currency,
|
.currency = currency,
|
||||||
.amount = amount,
|
.amount = amount,
|
||||||
|
.subscriptionPeriod = subscriptionPeriod,
|
||||||
};
|
};
|
||||||
const auto formData = CreditsFormData{
|
const auto formData = CreditsFormData{
|
||||||
.id = _id,
|
.id = _id,
|
||||||
|
|
|
@ -170,6 +170,7 @@ struct InvoiceCredits {
|
||||||
uint64 amount = 0;
|
uint64 amount = 0;
|
||||||
bool extended = false;
|
bool extended = false;
|
||||||
PeerId giftPeerId = PeerId(0);
|
PeerId giftPeerId = PeerId(0);
|
||||||
|
int subscriptionPeriod = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InvoiceStarGift {
|
struct InvoiceStarGift {
|
||||||
|
|
Loading…
Add table
Reference in a new issue