ReceiptCard class
Card builder class that simplifies building receipt cards.
Constructors
Receipt |
Creates a new ReceiptCard. |
Methods
buttons(ICard |
Set of actions applicable to the current card. Not all channels support buttons and the number of allowed buttons varies by channel. |
facts(IFact[] | IIs |
Array of additional facts to display to user (shipping charges and such.) Not all facts will be displayed on all channels. |
items(IReceipt |
Array of receipt items. |
tap(ICard |
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(Text |
Title of the Card. |
to |
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
- list
-
ICardAction[] | IIsCardAction[]
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
Returns
items(IReceiptItem[] | IIsReceiptItem[])
Array of receipt items.
function items(list: IReceiptItem[] | IIsReceiptItem[])
Parameters
- list
-
IReceiptItem[] | IIsReceiptItem[]
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
- action
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()
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