mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-03 21:54:05 +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(
|
||||
_peer->input,
|
||||
MTP_long(prepaidId),
|
||||
invoice.creditsAmount
|
||||
invoice.giveawayCredits
|
||||
? Payments::InvoiceCreditsGiveawayToTL(invoice)
|
||||
: Payments::InvoicePremiumGiftCodeGiveawayToTL(invoice)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
|
|
|
@ -1402,7 +1402,7 @@ void CreateGiveawayBox(
|
|||
auto invoice = [&] {
|
||||
if (isPrepaidCredits) {
|
||||
return Payments::InvoicePremiumGiftCode{
|
||||
.creditsAmount = prepaid->credits,
|
||||
.giveawayCredits = prepaid->credits,
|
||||
.randomId = prepaid->id,
|
||||
.users = prepaid->quantity,
|
||||
};
|
||||
|
@ -1412,7 +1412,7 @@ void CreateGiveawayBox(
|
|||
return Payments::InvoicePremiumGiftCode{
|
||||
.currency = option.currency,
|
||||
.storeProduct = option.storeProduct,
|
||||
.creditsAmount = option.credits,
|
||||
.giveawayCredits = option.credits,
|
||||
.randomId = UniqueIdFromCreditsOption(option, peer),
|
||||
.amount = option.amount,
|
||||
.users = state->sliderValue.current(),
|
||||
|
|
|
@ -178,7 +178,7 @@ MTPinputStorePaymentPurpose InvoicePremiumGiftCodeGiveawayToTL(
|
|||
|
||||
MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL(
|
||||
const InvoicePremiumGiftCode &invoice) {
|
||||
Expects(invoice.creditsAmount.has_value());
|
||||
Expects(invoice.giveawayCredits.has_value());
|
||||
const auto &giveaway = v::get<InvoicePremiumGiftCodeGiveaway>(
|
||||
invoice.purpose);
|
||||
using Flag = MTPDinputStorePaymentStarsGiveaway::Flag;
|
||||
|
@ -199,7 +199,7 @@ MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL(
|
|||
| (giveaway.additionalPrize.isEmpty()
|
||||
? Flag()
|
||||
: Flag::f_prize_description)),
|
||||
MTP_long(*invoice.creditsAmount),
|
||||
MTP_long(*invoice.giveawayCredits),
|
||||
giveaway.boostPeer->input,
|
||||
MTP_vector_from_range(ranges::views::all(
|
||||
giveaway.additionalChannels
|
||||
|
@ -222,7 +222,7 @@ MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL(
|
|||
bool IsPremiumForStarsInvoice(const InvoiceId &id) {
|
||||
const auto giftCode = std::get_if<InvoicePremiumGiftCode>(&id.value);
|
||||
return giftCode
|
||||
&& !giftCode->creditsAmount
|
||||
&& !giftCode->giveawayCredits
|
||||
&& (giftCode->currency == ::Ui::kCreditsCurrency);
|
||||
}
|
||||
|
||||
|
@ -402,7 +402,7 @@ MTPInputInvoice Form::inputInvoice() const {
|
|||
Api::ConvertOption::SkipLocal)));
|
||||
}
|
||||
const auto &giftCode = v::get<InvoicePremiumGiftCode>(_id.value);
|
||||
if (giftCode.creditsAmount) {
|
||||
if (giftCode.giveawayCredits) {
|
||||
return MTP_inputInvoiceStars(InvoiceCreditsGiveawayToTL(giftCode));
|
||||
}
|
||||
using Flag = MTPDpremiumGiftCodeOption::Flag;
|
||||
|
|
|
@ -153,7 +153,7 @@ struct InvoicePremiumGiftCode {
|
|||
|
||||
QString currency;
|
||||
QString storeProduct;
|
||||
std::optional<uint64> creditsAmount;
|
||||
std::optional<uint64> giveawayCredits;
|
||||
uint64 randomId = 0;
|
||||
uint64 amount = 0;
|
||||
int storeQuantity = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue