Add missing fields

This commit is contained in:
Ali 2021-03-24 23:33:47 +04:00
parent 1fd84c653b
commit f47245585f

View File

@ -22,6 +22,8 @@ public struct BotPaymentInvoiceFields: OptionSet {
public static let email = BotPaymentInvoiceFields(rawValue: 1 << 2) public static let email = BotPaymentInvoiceFields(rawValue: 1 << 2)
public static let shippingAddress = BotPaymentInvoiceFields(rawValue: 1 << 3) public static let shippingAddress = BotPaymentInvoiceFields(rawValue: 1 << 3)
public static let flexibleShipping = BotPaymentInvoiceFields(rawValue: 1 << 4) public static let flexibleShipping = BotPaymentInvoiceFields(rawValue: 1 << 4)
public static let phoneAvailableToProvider = BotPaymentInvoiceFields(rawValue: 1 << 5)
public static let emailAvailableToProvider = BotPaymentInvoiceFields(rawValue: 1 << 6)
} }
public struct BotPaymentPrice : Equatable { public struct BotPaymentPrice : Equatable {
@ -128,6 +130,12 @@ extension BotPaymentInvoice {
if (flags & (1 << 5)) != 0 { if (flags & (1 << 5)) != 0 {
fields.insert(.flexibleShipping) fields.insert(.flexibleShipping)
} }
if (flags & (1 << 6)) != 0 {
fields.insert(.phoneAvailableToProvider)
}
if (flags & (1 << 7)) != 0 {
fields.insert(.emailAvailableToProvider)
}
self.init(isTest: (flags & (1 << 0)) != 0, requestedFields: fields, currency: currency, prices: prices.map { self.init(isTest: (flags & (1 << 0)) != 0, requestedFields: fields, currency: currency, prices: prices.map {
switch $0 { switch $0 {
case let .labeledPrice(label, amount): case let .labeledPrice(label, amount):