public class ReceiptTemplateBuilder extends TemplateBaseBuilder
messageBuildergetRecipienteventKind, getLocationMessage, safeGetMessage, safeGetPostbackPayload, safeGetQuickReplyPayload, safeGetRecipient, safeGetRecipientId, safeGetSender, safeGetSenderId, validatepublic ReceiptTemplateBuilder setMerchantName(String merchantName)
merchantName - the merchant name to set.public ReceiptTemplateBuilder setTimestamp(String timestamp)
timestamp - the timestamp to set.public ReceiptTemplateBuilder setOrderUrl(String orderUrl)
orderUrl - the URL of order to set.public ReceiptTemplateBuilder addElement(ReceiptTemplateElement element)
ReceiptTemplateElement to this template. This field can't
be empty. The elements must be at most 100 and the sorting is not
guaranteed.element - the element to add.public ReceiptTemplateElementBuilder addElement(String title)
ReceiptTemplateElement to this template. This field can't
be empty. The elements must be at most 100 and the sorting is not
guaranteed.title - the title of the item. This field is mandatory and can't be
empty or null.ReceiptTemplateElementBuilder for building the element.public ReceiptTemplateBuilder setAddress(Address address)
address - the address to set.public AddressBuilder setAddress()
AddressBuilder to build the address.public ReceiptTemplateBuilder setSummary(Summary summary)
Summary. This field is required and can't be
null.summary - the summary to set.public ReceiptTemplateBuilder setSummary(BigDecimal subtotal, BigDecimal shippingCost, BigDecimal totalTax, BigDecimal totalCost)
Summary. This field is required and can't be
null. These numbers should be valid and well formatted decimal numbers,
using '.' (dot) as the decimal separator. Note that most currencies only
accept up to 2 decimal places.subtotal - the subtotal.shippingCost - the cost of the shipping.totalTax - the total tax.totalCost - the total cost.public ReceiptTemplateBuilder addAdjustment(Adjustment adjustment)
Adjustment to this builder. Adjustments allow a way to
insert adjusted pricing (e.g., sales). Adjustments are optional.adjustment - the adjustment to add.public ReceiptTemplateBuilder addAdjustment(String name, BigDecimal amount)
Adjustment to this builder. Adjustments allow a way to
insert adjusted pricing (e.g., sales). Adjustments are optional.name - the name of the adjustment.amount - the amount of the adjustment.public ReceiptTemplateBuilder addQuickReply(String title, String payload)
QuickReply to the current object.title - the quick reply button label. It can't be empty.payload - the payload sent back when the button is pressed. It can't be
empty.public ReceiptTemplateBuilder addQuickReply(QuickReply reply)
QuickReply to the current object.reply - a quick reply object.public FbBotMillResponse build(MessageEnvelope envelope)
FbBotMillResponse that the bot should return. Creates a response containing a Receipt Template.envelope - a MessageEnvelope object representing the incoming
message.FbBotMillResponse of this bot.public String toString()
toString in class TemplateBaseBuilderCopyright © 2017 BotMill. All rights reserved.