我使用MS BotFramework创建了一个简单的机器人,它启用了以下渠道: WebChat , Skype 和 Facebook < /强>
机器人允许用户选择或搜索某些产品以添加到订单中,问题是关于在创建收据时传递给收据的属性。
根据Facebook Docs: Receipt Template,它接受货币, payment_method 和其他一些属性,但我无法在{{}中找到它们3}}
有什么办法可以添加这些属性吗?
答案 0 :(得分:1)
ReceiptItem
将成为ReceiptCard的项目。 ReceiptCard
还有一个facts的集合,可以向用户显示其他内容,例如 payment_method 。
Here是如何使用facts
集合的示例:
var receiptCard = new ReceiptCard
{
Title = Resources.RootDialog_Receipt_Title,
Facts = new List<Fact>
{
new Fact(Resources.RootDialog_Receipt_OrderID, order.OrderID),
new Fact(Resources.RootDialog_Receipt_PaymentMethod, creditCardOffuscated)
},
Items = new List<ReceiptItem>
{
new ReceiptItem(
title: order.FlowerCategoryName,
subtitle: order.Bouquet.Name,
price: order.Bouquet.Price.ToString("C"),
image: new CardImage(order.Bouquet.ImageUrl)),
},
Total = order.Bouquet.Price.ToString("C")
};
以防万一,这里的情况与C#
相同。