use of co.aurasphere.botmill.fb.event.message.MessageEvent in project fb-botmill by BotMill.
the class BuyButtonTest method defineBehaviour.
/*
* (non-Javadoc)
*
* @see co.aurasphere.botmill.fb.FbBotDefinition#defineBehavior()
*/
public void defineBehaviour() {
// loads the annotated encryption class.
ConfigurationUtils.loadEncryptedConfigurationProperties();
// loads the annotated bot.
ConfigurationUtils.loadBotDefinitions();
addActionFrame(new MessageEvent(MESSAGE_TO_SEND), new AutoReply() {
@Override
public FbBotMillResponse createResponse(MessageEnvelope envelope) {
return ReplyFactory.addGenericTemplate().addElement("A simple Button Template with a Buy Button").addButton(ButtonFactory.createBuyButton("buy_button_payload").setPaymentSummary("USD", PaymentType.FIXED_AMOUNT, "BotMill.io").addPriceLabel("A price label", "2").setTestPayment(true).addRequestedUserInfo(RequestedUserInfo.CONTACT_PHONE).build()).endElement().build(envelope);
}
});
}
Aggregations