Class ReceiptData
Container class for all the data required to print a receipt
Inheritance
Inherited Members
Namespace: Westpay.Epas
Assembly: EpasClientLibrary.dll
Syntax
public class ReceiptData
Fields
View SourceAmountFormatSpecifier
When amounts are converted to text the conversion will use this format specifier as the C# Decimal.ToString method's format parameter. The default is "F2", i.e. floating point with two decimal places. This can be changed to reflect the operating culture of the software.
Declaration
public string AmountFormatSpecifier
Field Value
Type | Description |
---|---|
System.String |
Outcome
The transaction outcome
Declaration
public TransactionOutcome Outcome
Field Value
Type | Description |
---|---|
TransactionOutcome |
Version
Indicates the receipt version, i.e. the merchant version or the cardholder version
Declaration
public ReceiptVersion Version
Field Value
Type | Description |
---|---|
ReceiptVersion |
Properties
View SourceAcquirerReference
The acquirer reference number
Declaration
public string AcquirerReference { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Used in the receipt header.
Authorisation
Contains data relating to the transaction authorisation.
Declaration
public ReceiptData.AuthorisationData Authorisation { get; }
Property Value
Type | Description |
---|---|
ReceiptData.AuthorisationData |
BankAgent
The name of the bank agent
Declaration
public string BankAgent { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Used in the receipt header.
Card
Contains details of the card used in the transaction.
Declaration
public ReceiptData.CardData Card { get; }
Property Value
Type | Description |
---|---|
ReceiptData.CardData |
CardholderLanguage
The cardholder language as a two-character ISO 639-1 code. Client software can use this to customise receipts.
Declaration
public string CardholderLanguage { get; }
Property Value
Type | Description |
---|---|
System.String |
DCC
Contains the DCC data, if chosen by the customer.
Declaration
public ReceiptData.DccData DCC { get; }
Property Value
Type | Description |
---|---|
ReceiptData.DccData |
EMV
Contains EMV data elements if an EMV card was used in the transaction.
Declaration
public ReceiptData.EmvData EMV { get; }
Property Value
Type | Description |
---|---|
ReceiptData.EmvData |
MerchantDetails
Contains details relating to the merchant.
Declaration
public ReceiptData.MerchantData MerchantDetails { get; }
Property Value
Type | Description |
---|---|
ReceiptData.MerchantData |
OperatorID
Contains the cashier / operator ID, which is provided originally by the ECR in the terminal’s operating parameters (see OperatorId).
Declaration
public string OperatorID { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Used in the receipt header.
TerminalID
Contains the terminal ID, which is provided originally by the ECR in the terminal’s operating parameters.
Declaration
public string TerminalID { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Used in the receipt header.
Transaction
Contains the details of the financial transaction.
Declaration
public ReceiptData.TransactionData Transaction { get; }
Property Value
Type | Description |
---|---|
ReceiptData.TransactionData |
Methods
View SourceCodeString()
Helper method to generate the code string that appears in the receipt.
Declaration
public string CodeString()
Returns
Type | Description |
---|---|
System.String |
Remarks
The code string is defined in the Cardholder and Operator Interface specification (CHAOI), section 8.3.1, where the example given is “C@1 5 000 SVB 012 12233”. The meaning of each of these elements is discussed in section 8 of the CHAOI specification.
GenerateSimpleReceipt(Int32)
Generates a formatted receipt with a fixed-width layout.
Declaration
public string GenerateSimpleReceipt(int receiptFixedWidthChars)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | receiptFixedWidthChars | Width of the receipt in characters |
Returns
Type | Description |
---|---|
System.String | A formatted string containing the receipt |
Remarks
Note! This is intended for debug and development purposes, therefore the formatting of this receipt is not modifiable. It may not be appropriate for all uses and situations. Users should satisfy themselves that the receipt is correct for all the combinations of transactions types, outcomes, and parameters before choosing to use this in a production environment.
GetTranslatedText(ReceiptData.TranslatedTextId, String)
Returns the text related to the text ID provided, translated to the cardholder's language.
Declaration
public string GetTranslatedText(ReceiptData.TranslatedTextId textId, string suffix = null)
Parameters
Type | Name | Description |
---|---|---|
ReceiptData.TranslatedTextId | textId | ID of the text to retrieve |
System.String | suffix | Optional suffix. This can be used for formatting purposes, e.g. to add ":" after a label |
Returns
Type | Description |
---|---|
System.String | Translated text, or null if there is no translation found |