ReceiptCard class

Card builder class that simplifies building receipt cards.

Constructors

ReceiptCard(Session)

Creates a new ReceiptCard.

Methods

buttons(ICardAction[] | IIsCardAction[])

Set of actions applicable to the current card. Not all channels support buttons and the number of allowed buttons varies by channel.

facts(IFact[] | IIsFact[])

Array of additional facts to display to user (shipping charges and such.) Not all facts will be displayed on all channels.

items(IReceiptItem[] | IIsReceiptItem[])

Array of receipt items.

tap(ICardAction | IIsCardAction)

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

tax(string)

Total amount of TAX paid (or should be paid.)

title(TextType, any[])

Title of the Card.

toAttachment()

Returns the JSON for the card.

total(string)

Total amount of money paid (or should be paid.)

vat(string)

Total amount of VAT paid (or should be paid.)

Constructor Details

ReceiptCard(Session)

Creates a new ReceiptCard.

new ReceiptCard(session?: Session)

Parameters

session
Session

(Optional) will be used to localize any text.

Method Details

buttons(ICardAction[] | IIsCardAction[])

Set of actions applicable to the current card. Not all channels support buttons and the number of allowed buttons varies by channel.

function buttons(list: ICardAction[] | IIsCardAction[])

Parameters

Returns

facts(IFact[] | IIsFact[])

Array of additional facts to display to user (shipping charges and such.) Not all facts will be displayed on all channels.

function facts(list: IFact[] | IIsFact[])

Parameters

list

IFact[] | IIsFact[]

Returns

items(IReceiptItem[] | IIsReceiptItem[])

Array of receipt items.

function items(list: IReceiptItem[] | IIsReceiptItem[])

Parameters

Returns

tap(ICardAction | IIsCardAction)

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

function tap(action: ICardAction | IIsCardAction)

Parameters

Returns

tax(string)

Total amount of TAX paid (or should be paid.)

function tax(v: string)

Parameters

v

string

Returns

title(TextType, any[])

Title of the Card.

function title(text: TextType, args: any[])

Parameters

text
TextType
args

any[]

Returns

toAttachment()

Returns the JSON for the card.

function toAttachment()

Returns

total(string)

Total amount of money paid (or should be paid.)

function total(v: string)

Parameters

v

string

Returns

vat(string)

Total amount of VAT paid (or should be paid.)

function vat(v: string)

Parameters

v

string

Returns