ReceiptItem class
Builder class to simplify adding items to a receipt card.
Constructors
Receipt |
Creates a new ReceiptItem. |
Methods
create(Session, string, Text |
Creates a new ReceiptItem. |
image(ICard |
Image to display on the card. Some channels may either send the image as a seperate message or simply include a link to the image. |
price(string) | Amount with currency. |
quantity(string) | Number of items of given kind. |
subtitle(Text |
Subtitle appears just below Title field, differs from Title in font styling only. On some channels may be combined with the title or text. |
tap(ICard |
This action will be activated when user taps on the Item bubble. Not all channels support tap actions. |
text(Text |
Text field appears just below subtitle, differs from Subtitle in font styling only. |
title(Text |
Title of the item. |
to |
Returns the JSON for the item. |
Constructor Details
ReceiptItem(Session)
Creates a new ReceiptItem.
new ReceiptItem(session?: Session)
Parameters
- session
- Session
(Optional) will be used to localize any text.
Method Details
create(Session, string, TextType)
Creates a new ReceiptItem.
static function create(session: Session, price: string, title?: TextType)
Parameters
- session
- Session
- price
-
string
- title
- TextType
Returns
image(ICardImage | IIsCardImage)
Image to display on the card. Some channels may either send the image as a seperate message or simply include a link to the image.
function image(img: ICardImage | IIsCardImage)
Parameters
- img
Returns
price(string)
quantity(string)
subtitle(TextType, any[])
Subtitle appears just below Title field, differs from Title in font styling only. On some channels may be combined with the title or text.
function subtitle(text: TextType, args: any[])
Parameters
- text
- TextType
- args
-
any[]
Returns
tap(ICardAction | IIsCardAction)
This action will be activated when user taps on the Item bubble. Not all channels support tap actions.
function tap(action: ICardAction | IIsCardAction)
Parameters
- action
Returns
text(TextType, any[])
Text field appears just below subtitle, differs from Subtitle in font styling only.
function text(text: TextType, args: any[])
Parameters
- text
- TextType
- args
-
any[]
Returns
title(TextType, any[])
Title of the item.
function title(text: TextType, args: any[])
Parameters
- text
- TextType
- args
-
any[]