ReceiptItem class

Builder class to simplify adding items to a receipt card.

Constructors

ReceiptItem(Session)

Creates a new ReceiptItem.

Methods

create(Session, string, TextType)

Creates a new ReceiptItem.

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.

price(string)

Amount with currency.

quantity(string)

Number of items of given kind.

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.

tap(ICardAction | IIsCardAction)

This action will be activated when user taps on the Item bubble. Not all channels support tap actions.

text(TextType, any[])

Text field appears just below subtitle, differs from Subtitle in font styling only.

title(TextType, any[])

Title of the item.

toItem()

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

Returns

price(string)

Amount with currency.

function price(v: string)

Parameters

v

string

Returns

quantity(string)

Number of items of given kind.

function quantity(v: string)

Parameters

v

string

Returns

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

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[]

Returns

toItem()

Returns the JSON for the item.

function toItem()

Returns