Class SendInvoice
- java.lang.Object
-
- org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod<T>
-
- org.telegram.telegrambots.meta.api.methods.BotApiMethod<Message>
-
- org.telegram.telegrambots.meta.api.methods.send.SendInvoice
-
- All Implemented Interfaces:
Validable
public class SendInvoice extends BotApiMethod<Message>
- Version:
- 1.0 Use this method to send an invoice. On success, the sent Message is returned.
- Author:
- Ruben Bermudez
-
-
Field Summary
Fields Modifier and Type Field Description static String
PATH
-
Fields inherited from class org.telegram.telegrambots.meta.api.methods.BotApiMethod
METHOD_FIELD
-
Fields inherited from class org.telegram.telegrambots.meta.api.methods.PartialBotApiMethod
OBJECT_MAPPER
-
-
Constructor Summary
Constructors Constructor Description SendInvoice()
Build an empty SendInvoice objectSendInvoice(Integer chatId, String title, String description, String payload, String providerToken, String startParameter, String currency, List<LabeledPrice> prices)
Build a SendInvoice object with empty parameters
-
Method Summary
-
-
-
Field Detail
-
PATH
public static final String PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SendInvoice
public SendInvoice()
Build an empty SendInvoice object
-
SendInvoice
public SendInvoice(Integer chatId, String title, String description, String payload, String providerToken, String startParameter, String currency, List<LabeledPrice> prices)
Build a SendInvoice object with empty parameters- Parameters:
chatId
- Unique identifier for the target private chattitle
- Product namedescription
- Product descriptionpayload
- Bot defined invoice payload, 1-128 bytes.providerToken
- Payments provider tokenstartParameter
- Unique deep-linking parameter.currency
- 3-letter ISO 4217 currency codeprices
- Price breakdown, a list of components
-
-
Method Detail
-
getChatId
public Integer getChatId()
-
setChatId
public SendInvoice setChatId(Integer chatId)
-
getTitle
public String getTitle()
-
setTitle
public SendInvoice setTitle(String title)
-
getDescription
public String getDescription()
-
setDescription
public SendInvoice setDescription(String description)
-
getPayload
public String getPayload()
-
setPayload
public SendInvoice setPayload(String payload)
-
getProviderToken
public String getProviderToken()
-
setProviderToken
public SendInvoice setProviderToken(String providerToken)
-
getStartParameter
public String getStartParameter()
-
setStartParameter
public SendInvoice setStartParameter(String startParameter)
-
getCurrency
public String getCurrency()
-
setCurrency
public SendInvoice setCurrency(String currency)
-
getPrices
public List<LabeledPrice> getPrices()
-
setPrices
public SendInvoice setPrices(List<LabeledPrice> prices)
-
getPhotoUrl
public String getPhotoUrl()
-
setPhotoUrl
public SendInvoice setPhotoUrl(String photoUrl)
-
getPhotoSize
public Integer getPhotoSize()
-
setPhotoSize
public SendInvoice setPhotoSize(Integer photoSize)
-
getPhotoWidth
public Integer getPhotoWidth()
-
setPhotoWidth
public SendInvoice setPhotoWidth(Integer photoWidth)
-
getPhotoHeight
public Integer getPhotoHeight()
-
setPhotoHeight
public SendInvoice setPhotoHeight(Integer photoHeight)
-
getNeedName
public Boolean getNeedName()
-
setNeedName
public SendInvoice setNeedName(Boolean needName)
-
getNeedPhoneNumber
public Boolean getNeedPhoneNumber()
-
setNeedPhoneNumber
public SendInvoice setNeedPhoneNumber(Boolean needPhoneNumber)
-
getNeedEmail
public Boolean getNeedEmail()
-
setNeedEmail
public SendInvoice setNeedEmail(Boolean needEmail)
-
getNeedShippingAddress
public Boolean getNeedShippingAddress()
-
setNeedShippingAddress
public SendInvoice setNeedShippingAddress(Boolean needShippingAddress)
-
getSendPhoneNumberToProvider
public Boolean getSendPhoneNumberToProvider()
-
setSendPhoneNumberToProvider
public SendInvoice setSendPhoneNumberToProvider(Boolean sendPhoneNumberToProvider)
-
getSendEmailToProvider
public Boolean getSendEmailToProvider()
-
setSendEmailToProvider
public SendInvoice setSendEmailToProvider(Boolean sendEmailToProvider)
-
getFlexible
public Boolean getFlexible()
-
setFlexible
public SendInvoice setFlexible(Boolean flexible)
-
getDisableNotification
public Boolean getDisableNotification()
-
setDisableNotification
public SendInvoice setDisableNotification(Boolean disableNotification)
-
getReplyToMessageId
public Integer getReplyToMessageId()
-
setReplyToMessageId
public SendInvoice setReplyToMessageId(Integer replyToMessageId)
-
getReplyMarkup
public InlineKeyboardMarkup getReplyMarkup()
-
setReplyMarkup
public SendInvoice setReplyMarkup(InlineKeyboardMarkup replyMarkup)
-
getProviderData
public String getProviderData()
-
setProviderData
public SendInvoice setProviderData(String providerData)
-
getMethod
public String getMethod()
Description copied from class:BotApiMethod
Getter for method path (that is the same as method name)- Specified by:
getMethod
in classBotApiMethod<Message>
- Returns:
- Method path
-
deserializeResponse
public Message deserializeResponse(String answer) throws TelegramApiRequestException
Description copied from class:PartialBotApiMethod
Deserialize a json answer to the response type to a method- Specified by:
deserializeResponse
in classPartialBotApiMethod<Message>
- Parameters:
answer
- Json answer received- Returns:
- Answer for the method
- Throws:
TelegramApiRequestException
-
validate
public void validate() throws TelegramApiValidationException
Description copied from interface:Validable
Validates that mandatory fields are filled and optional objects- Throws:
TelegramApiValidationException
- If any mandatory field is empty
-
-