mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Renamed creditsAmount in invoice for premium gift with represented name.
This commit is contained in:
parent
9491cff1df
commit
0d8ae7bb37
4 changed files with 8 additions and 8 deletions
|
@ -529,7 +529,7 @@ rpl::producer<rpl::no_value, QString> PremiumGiftCodeOptions::applyPrepaid(
|
||||||
_api.request(MTPpayments_LaunchPrepaidGiveaway(
|
_api.request(MTPpayments_LaunchPrepaidGiveaway(
|
||||||
_peer->input,
|
_peer->input,
|
||||||
MTP_long(prepaidId),
|
MTP_long(prepaidId),
|
||||||
invoice.creditsAmount
|
invoice.giveawayCredits
|
||||||
? Payments::InvoiceCreditsGiveawayToTL(invoice)
|
? Payments::InvoiceCreditsGiveawayToTL(invoice)
|
||||||
: Payments::InvoicePremiumGiftCodeGiveawayToTL(invoice)
|
: Payments::InvoicePremiumGiftCodeGiveawayToTL(invoice)
|
||||||
)).done([=](const MTPUpdates &result) {
|
)).done([=](const MTPUpdates &result) {
|
||||||
|
|
|
@ -1402,7 +1402,7 @@ void CreateGiveawayBox(
|
||||||
auto invoice = [&] {
|
auto invoice = [&] {
|
||||||
if (isPrepaidCredits) {
|
if (isPrepaidCredits) {
|
||||||
return Payments::InvoicePremiumGiftCode{
|
return Payments::InvoicePremiumGiftCode{
|
||||||
.creditsAmount = prepaid->credits,
|
.giveawayCredits = prepaid->credits,
|
||||||
.randomId = prepaid->id,
|
.randomId = prepaid->id,
|
||||||
.users = prepaid->quantity,
|
.users = prepaid->quantity,
|
||||||
};
|
};
|
||||||
|
@ -1412,7 +1412,7 @@ void CreateGiveawayBox(
|
||||||
return Payments::InvoicePremiumGiftCode{
|
return Payments::InvoicePremiumGiftCode{
|
||||||
.currency = option.currency,
|
.currency = option.currency,
|
||||||
.storeProduct = option.storeProduct,
|
.storeProduct = option.storeProduct,
|
||||||
.creditsAmount = option.credits,
|
.giveawayCredits = option.credits,
|
||||||
.randomId = UniqueIdFromCreditsOption(option, peer),
|
.randomId = UniqueIdFromCreditsOption(option, peer),
|
||||||
.amount = option.amount,
|
.amount = option.amount,
|
||||||
.users = state->sliderValue.current(),
|
.users = state->sliderValue.current(),
|
||||||
|
|
|
@ -178,7 +178,7 @@ MTPinputStorePaymentPurpose InvoicePremiumGiftCodeGiveawayToTL(
|
||||||
|
|
||||||
MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL(
|
MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL(
|
||||||
const InvoicePremiumGiftCode &invoice) {
|
const InvoicePremiumGiftCode &invoice) {
|
||||||
Expects(invoice.creditsAmount.has_value());
|
Expects(invoice.giveawayCredits.has_value());
|
||||||
const auto &giveaway = v::get<InvoicePremiumGiftCodeGiveaway>(
|
const auto &giveaway = v::get<InvoicePremiumGiftCodeGiveaway>(
|
||||||
invoice.purpose);
|
invoice.purpose);
|
||||||
using Flag = MTPDinputStorePaymentStarsGiveaway::Flag;
|
using Flag = MTPDinputStorePaymentStarsGiveaway::Flag;
|
||||||
|
@ -199,7 +199,7 @@ MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL(
|
||||||
| (giveaway.additionalPrize.isEmpty()
|
| (giveaway.additionalPrize.isEmpty()
|
||||||
? Flag()
|
? Flag()
|
||||||
: Flag::f_prize_description)),
|
: Flag::f_prize_description)),
|
||||||
MTP_long(*invoice.creditsAmount),
|
MTP_long(*invoice.giveawayCredits),
|
||||||
giveaway.boostPeer->input,
|
giveaway.boostPeer->input,
|
||||||
MTP_vector_from_range(ranges::views::all(
|
MTP_vector_from_range(ranges::views::all(
|
||||||
giveaway.additionalChannels
|
giveaway.additionalChannels
|
||||||
|
@ -222,7 +222,7 @@ MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL(
|
||||||
bool IsPremiumForStarsInvoice(const InvoiceId &id) {
|
bool IsPremiumForStarsInvoice(const InvoiceId &id) {
|
||||||
const auto giftCode = std::get_if<InvoicePremiumGiftCode>(&id.value);
|
const auto giftCode = std::get_if<InvoicePremiumGiftCode>(&id.value);
|
||||||
return giftCode
|
return giftCode
|
||||||
&& !giftCode->creditsAmount
|
&& !giftCode->giveawayCredits
|
||||||
&& (giftCode->currency == ::Ui::kCreditsCurrency);
|
&& (giftCode->currency == ::Ui::kCreditsCurrency);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ MTPInputInvoice Form::inputInvoice() const {
|
||||||
Api::ConvertOption::SkipLocal)));
|
Api::ConvertOption::SkipLocal)));
|
||||||
}
|
}
|
||||||
const auto &giftCode = v::get<InvoicePremiumGiftCode>(_id.value);
|
const auto &giftCode = v::get<InvoicePremiumGiftCode>(_id.value);
|
||||||
if (giftCode.creditsAmount) {
|
if (giftCode.giveawayCredits) {
|
||||||
return MTP_inputInvoiceStars(InvoiceCreditsGiveawayToTL(giftCode));
|
return MTP_inputInvoiceStars(InvoiceCreditsGiveawayToTL(giftCode));
|
||||||
}
|
}
|
||||||
using Flag = MTPDpremiumGiftCodeOption::Flag;
|
using Flag = MTPDpremiumGiftCodeOption::Flag;
|
||||||
|
|
|
@ -153,7 +153,7 @@ struct InvoicePremiumGiftCode {
|
||||||
|
|
||||||
QString currency;
|
QString currency;
|
||||||
QString storeProduct;
|
QString storeProduct;
|
||||||
std::optional<uint64> creditsAmount;
|
std::optional<uint64> giveawayCredits;
|
||||||
uint64 randomId = 0;
|
uint64 randomId = 0;
|
||||||
uint64 amount = 0;
|
uint64 amount = 0;
|
||||||
int storeQuantity = 0;
|
int storeQuantity = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue