From f47245585fd6d8b7df6b158bdec8218a048b6343 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Wed, 24 Mar 2021 23:33:47 +0400 Subject: [PATCH] Add missing fields --- submodules/TelegramCore/Sources/BotPaymentForm.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/submodules/TelegramCore/Sources/BotPaymentForm.swift b/submodules/TelegramCore/Sources/BotPaymentForm.swift index cdb8a9ce8a..d7448873ba 100644 --- a/submodules/TelegramCore/Sources/BotPaymentForm.swift +++ b/submodules/TelegramCore/Sources/BotPaymentForm.swift @@ -22,6 +22,8 @@ public struct BotPaymentInvoiceFields: OptionSet { public static let email = BotPaymentInvoiceFields(rawValue: 1 << 2) public static let shippingAddress = BotPaymentInvoiceFields(rawValue: 1 << 3) 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 { @@ -128,6 +130,12 @@ extension BotPaymentInvoice { if (flags & (1 << 5)) != 0 { 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 { switch $0 { case let .labeledPrice(label, amount):