rjcpereira
rjcpereira

Reputation: 953

Missing properties/methods in ReceiptItem

I've created a simple bot using MS BotFramework, it's enabled to the following channels: WebChat, Skype and Facebook.

The bot allows the user to select or search some products to add to an order, the issue is about the properties to pass to the receipt when it's created.

According to the Facebook Docs: Receipt Template, it accepts the currency, payment_method and some other properties, but I can't find them in the MS BotFramework Docs: ReceiptItem.

There is any way to add this properties?

Upvotes: 0

Views: 36

Answers (1)

Ezequiel Jadib
Ezequiel Jadib

Reputation: 14787

The ReceiptItem are going to be the items of the ReceiptCard. The ReceiptCard also have a collection of facts, which is the place to provide additional things to display to the user, for example, the payment_method.

Here is an example of how to use the facts collection:

        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")
        };

Just in case, here is the same but for C#.

Upvotes: 1

Related Questions