Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

ReceiptCardScorable.cs 1.9 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  1. namespace TestBot.Scorables
  2. {
  3. using System.Collections.Generic;
  4. using Microsoft.Bot.Builder.Dialogs.Internals;
  5. using Microsoft.Bot.Connector;
  6. public class ReceiptCardScorable : RichCardScorable
  7. {
  8. public ReceiptCardScorable(IBotToUser botToUser, IBotData botData) : base(botToUser, botData)
  9. {
  10. }
  11. public override string Trigger
  12. {
  13. get
  14. {
  15. return "Receipt";
  16. }
  17. }
  18. protected override IList<Attachment> GetCardAttachments()
  19. {
  20. return new List<Attachment>
  21. {
  22. new ReceiptCard
  23. {
  24. Title = "John Doe",
  25. Facts = new List<Fact> { new Fact("Order Number", "1234"), new Fact("Payment Method", "VISA 5555-****") },
  26. Items = new List<ReceiptItem>
  27. {
  28. new ReceiptItem("Data Transfer", price: "$ 38.45", quantity: "368", image: new CardImage(url: "https://github.com/amido/azure-vector-icons/raw/master/renders/traffic-manager.png")),
  29. new ReceiptItem("App Service", price: "$ 45.00", quantity: "720", image: new CardImage(url: "https://github.com/amido/azure-vector-icons/raw/master/renders/cloud-service.png")),
  30. },
  31. Tax = "$ 7.50",
  32. Total = "$ 90.95",
  33. Buttons = new List<CardAction>
  34. {
  35. new CardAction(
  36. ActionTypes.OpenUrl,
  37. "More information",
  38. "https://account.windowsazure.com/content/6.10.1.38-.8225.160809-1618/aux-pre/images/offer-icon-freetrial.png",
  39. "https://azure.microsoft.com/en-us/pricing/")
  40. }
  41. }.ToAttachment()
  42. };
  43. }
  44. }
  45. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...