【问题标题】:Missing properties/methods in ReceiptItemReceiptItem 中缺少属性/方法
【发布时间】:2018-03-09 06:32:51
【问题描述】:

我使用 MS BotFramework 创建了一个简单的机器人,它支持以下渠道:WebChatSkypeFacebook。 p>

机器人允许用户选择或搜索一些产品以添加到订单中,问题在于创建收据时传递给收据的属性。

根据Facebook Docs: Receipt Template,它接受currencypayment_method等属性,但我在MS BotFramework Docs: ReceiptItem中找不到。 p>

有什么方法可以添加这个属性?

【问题讨论】:

  • 什么语言,C# 还是 Node?​​span>

标签: facebook facebook-javascript-sdk bots botframework receipt


【解决方案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#

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-14
    • 1970-01-01
    • 1970-01-01
    • 2017-07-24
    • 2021-10-29
    • 1970-01-01
    • 1970-01-01
    • 2020-03-25
    相关资源
    最近更新 更多