mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Update API scheme on layer 181.
This commit is contained in:
parent
d1e914fb30
commit
5ee2bca616
3 changed files with 47 additions and 1 deletions
|
@ -910,6 +910,7 @@ payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;
|
|||
payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;
|
||||
|
||||
payments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
|
||||
payments.paymentReceiptStars#dabbf83a flags:# date:int bot_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice currency:string total_amount:long transaction_id:string users:Vector<User> = payments.PaymentReceipt;
|
||||
|
||||
payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;
|
||||
|
||||
|
@ -1802,7 +1803,7 @@ starsTransactionPeer#d80da15d peer:Peer = StarsTransactionPeer;
|
|||
|
||||
starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;
|
||||
|
||||
starsTransaction#5f6b790c id:string stars:long date:int peer:StarsTransactionPeer = StarsTransaction;
|
||||
starsTransaction#cc7079b2 flags:# id:string stars:long date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument = StarsTransaction;
|
||||
|
||||
payments.starsStatus#8cf4ee60 flags:# balance:long history:Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;
|
||||
|
||||
|
@ -2350,6 +2351,7 @@ payments.getStarsTopupOptions#c00ec7d3 = Vector<StarsTopupOption>;
|
|||
payments.getStarsStatus#104fcfa7 peer:InputPeer = payments.StarsStatus;
|
||||
payments.getStarsTransactions#673ac2f9 flags:# inbound:flags.0?true outbound:flags.1?true peer:InputPeer offset:string = payments.StarsStatus;
|
||||
payments.sendStarsForm#2bb731d flags:# form_id:long invoice:InputInvoice = payments.PaymentResult;
|
||||
payments.refundStarsCharge#f090bbec user_id:InputUser msg_id:int charge_id:string = Updates;
|
||||
|
||||
stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
|
||||
stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet;
|
||||
|
|
|
@ -471,6 +471,17 @@ void Form::processReceipt(const MTPDpayments_paymentReceipt &data) {
|
|||
_updates.fire(FormReady{});
|
||||
}
|
||||
|
||||
void Form::processReceipt(const MTPDpayments_paymentReceiptStars &data) {
|
||||
_session->data().processUsers(data.vusers());
|
||||
|
||||
data.vinvoice().match([&](const auto &data) {
|
||||
processInvoice(data);
|
||||
});
|
||||
processDetails(data);
|
||||
fillPaymentMethodInformation();
|
||||
_updates.fire(FormReady{});
|
||||
}
|
||||
|
||||
void Form::processInvoice(const MTPDinvoice &data) {
|
||||
const auto suggested = data.vsuggested_tip_amounts().value_or_empty();
|
||||
_invoice = Ui::Invoice{
|
||||
|
@ -586,6 +597,37 @@ void Form::processDetails(const MTPDpayments_paymentReceipt &data) {
|
|||
}
|
||||
}
|
||||
|
||||
void Form::processDetails(const MTPDpayments_paymentReceiptStars &data) {
|
||||
_invoice.receipt = Ui::Receipt{
|
||||
.date = data.vdate().v,
|
||||
.totalAmount = ParsePriceAmount(data.vtotal_amount().v),
|
||||
.currency = qs(data.vcurrency()),
|
||||
.paid = true,
|
||||
};
|
||||
_details = FormDetails{
|
||||
.botId = data.vbot_id().v,
|
||||
};
|
||||
if (_invoice.cover.title.isEmpty()
|
||||
&& _invoice.cover.description.empty()
|
||||
&& _invoice.cover.thumbnail.isNull()
|
||||
&& !_thumbnailLoadProcess) {
|
||||
_invoice.cover = Ui::Cover{
|
||||
.title = qs(data.vtitle()),
|
||||
.description = { qs(data.vdescription()) },
|
||||
};
|
||||
if (const auto web = data.vphoto()) {
|
||||
if (const auto photo = _session->data().photoFromWeb(*web, {})) {
|
||||
loadThumbnail(photo);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_details.botId) {
|
||||
if (const auto bot = _session->data().userLoaded(_details.botId)) {
|
||||
_invoice.cover.seller = bot->name();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Form::processSavedInformation(const MTPDpaymentRequestedInfo &data) {
|
||||
const auto address = data.vshipping_address();
|
||||
_savedInformation = _information = Ui::RequestedInformation{
|
||||
|
|
|
@ -301,9 +301,11 @@ private:
|
|||
void requestReceipt();
|
||||
void processForm(const MTPpayments_PaymentForm &result);
|
||||
void processReceipt(const MTPDpayments_paymentReceipt &data);
|
||||
void processReceipt(const MTPDpayments_paymentReceiptStars &data);
|
||||
void processInvoice(const MTPDinvoice &data);
|
||||
void processDetails(const MTPpayments_PaymentForm &result);
|
||||
void processDetails(const MTPDpayments_paymentReceipt &data);
|
||||
void processDetails(const MTPDpayments_paymentReceiptStars &data);
|
||||
void processSavedInformation(const MTPDpaymentRequestedInfo &data);
|
||||
void processAdditionalPaymentMethods(
|
||||
const QVector<MTPPaymentFormMethod> &list);
|
||||
|
|
Loading…
Add table
Reference in a new issue