From 03fdafd54f7d0e3174bd50fedfe22ec882d51daf Mon Sep 17 00:00:00 2001 From: Vladimir Date: Sun, 7 Jun 2020 15:28:55 +0300 Subject: [PATCH] added SEND_PHONE_NUMBER_TO_PROVIDER and SEND_EMAIL_TO_PROVIDER fields and methods for them --- .../meta/api/methods/send/SendInvoice.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendInvoice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendInvoice.java index 8a137112..873b9854 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendInvoice.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendInvoice.java @@ -39,6 +39,8 @@ public class SendInvoice extends BotApiMethod { private static final String NEED_PHONE_NUMBER_FIELD = "need_phone_number"; private static final String NEED_EMAIL_FIELD = "need_email"; private static final String NEED_SHIPPING_ADDRESS_FIELD = "need_shipping_address"; + private static final String SEND_PHONE_NUMBER_TO_PROVIDER_FIELD = "send_phone_number_to_provider"; + private static final String SEND_EMAIL_TO_PROVIDER_FIELD = "send_email_to_provider"; private static final String IS_FLEXIBLE_FIELD = "is_flexible"; private static final String DISABLE_NOTIFICATION_FIELD = "disable_notification"; private static final String REPLY_TO_MESSAGE_ID_FIELD = "reply_to_message_id"; @@ -87,6 +89,11 @@ public class SendInvoice extends BotApiMethod { private Boolean disableNotification; ///< Optional. Sends the message silently. Users will receive a notification with no sound. @JsonProperty(REPLY_TO_MESSAGE_ID_FIELD) private Integer replyToMessageId; ///< Optional. If the message is a reply, ID of the original message + + @JsonProperty(SEND_PHONE_NUMBER_TO_PROVIDER_FIELD) + private boolean sendPhoneNumberToProvider; ///< Optional. Pass True, if user's phone number should be sent to provider + @JsonProperty(SEND_EMAIL_TO_PROVIDER_FIELD) + private boolean sendEmailToProvider; ///< Optional. Pass True, if user's email address should be sent to provider /** * Optional. A JSON-serialized object for an inline keyboard. * @@ -102,8 +109,7 @@ public class SendInvoice extends BotApiMethod { @JsonProperty(PROVIDER_DATA_FIELD) private String providerData; - - /** + /** * Build an empty SendInvoice object */ public SendInvoice() { @@ -277,6 +283,20 @@ public class SendInvoice extends BotApiMethod { return this; } + public Boolean getSendPhoneNumberToProvider() { return sendPhoneNumberToProvider; } + + public SendInvoice setSendPhoneNumberToProvider(Boolean sendPhoneNumberToProvider) { + this.sendPhoneNumberToProvider = sendPhoneNumberToProvider; + return this; + } + + public Boolean getSendEmailToProvider() { return sendEmailToProvider; } + + public SendInvoice setSendEmailToProvider(Boolean sendEmailToProvider) { + this.sendEmailToProvider = sendEmailToProvider; + return this; + } + public Boolean getFlexible() { return isFlexible; } @@ -396,6 +416,8 @@ public class SendInvoice extends BotApiMethod { ", needPhoneNumber=" + needPhoneNumber + ", needEmail=" + needEmail + ", needShippingAddress=" + needShippingAddress + + ", sendPhoneNumberToProvider=" + sendPhoneNumberToProvider + + ", sendEmailToProvider=" + sendEmailToProvider + ", isFlexible=" + isFlexible + ", disableNotification=" + disableNotification + ", replyToMessageId=" + replyToMessageId +