PaymentsPaymentReceipt.deserialize constructor
PaymentsPaymentReceipt.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory PaymentsPaymentReceipt.deserialize(BinaryReader reader) {
// Read [PaymentsPaymentReceipt] fields.
final flags = reader.readInt32();
final date = reader.readDateTime();
final botId = reader.readInt64();
final providerId = reader.readInt64();
final title = reader.readString();
final description = reader.readString();
final hasPhotoField = (flags & 4) != 0;
final photo = hasPhotoField ? reader.readObject() as WebDocumentBase : null;
final invoice = reader.readObject() as InvoiceBase;
final hasInfoField = (flags & 1) != 0;
final info =
hasInfoField ? reader.readObject() as PaymentRequestedInfoBase : null;
final hasShippingField = (flags & 2) != 0;
final shipping =
hasShippingField ? reader.readObject() as ShippingOptionBase : null;
final hasTipAmountField = (flags & 8) != 0;
final tipAmount = hasTipAmountField ? reader.readInt64() : null;
final currency = reader.readString();
final totalAmount = reader.readInt64();
final credentialsTitle = reader.readString();
final users = reader.readVectorObject<UserBase>();
// Construct [PaymentsPaymentReceipt] object.
final returnValue = PaymentsPaymentReceipt(
date: date,
botId: botId,
providerId: providerId,
title: title,
description: description,
photo: photo,
invoice: invoice,
info: info,
shipping: shipping,
tipAmount: tipAmount,
currency: currency,
totalAmount: totalAmount,
credentialsTitle: credentialsTitle,
users: users,
);
// Now return the deserialized [PaymentsPaymentReceipt].
return returnValue;
}