Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class CardReceipt

  1. Object
  2. CardReceipt

What a card receipt has to show, as the terminal reported it.

Card schemes require a printed or emailed receipt to carry the application identifier, the application label, the masked card number, how the card was read and the authorization code. Each getter answers null when the terminal did not report that field.

Some terminals compose the whole receipt themselves; those lines are in getMerchantReceipt() and getCustomerReceipt(), ready to print as they are. Print those when present – they carry everything the acquirer requires, including fields this class does not model.

Nested types

enum CardReceipt.EntryModeHow the card was read.
enum CardReceipt.VerificationHow the cardholder proved they hold the card.

Constructors

public CardReceipt()

Methods

public String getBrand()The card brand as the terminal named it, such as visa.
public CardReceipt setBrand(String brand)Sets getBrand().
public String getMaskedPan()The card number with all but the last four digits hidden, as the terminal formatted it.
public CardReceipt setMaskedPan(String maskedPan)Sets getMaskedPan().
public String getApplicationId()The EMV application identifier (AID), such as A0000000031010.
public CardReceipt setApplicationId(String applicationId)Sets getApplicationId().
public String getApplicationLabel()The EMV application label, such as VISA CREDIT.
public CardReceipt setApplicationLabel(String applicationLabel)Sets getApplicationLabel().
public CardReceipt.EntryMode getEntryMode()How the card was read; never null.
public CardReceipt setEntryMode(CardReceipt.EntryMode entryMode)Sets getEntryMode().
public CardReceipt.Verification getVerification()How the cardholder was verified; never null.
public CardReceipt setVerification(CardReceipt.Verification verification)Sets getVerification().
public String getAuthorizationCode()The issuer’s authorization code.
public CardReceipt setAuthorizationCode(String authorizationCode)Sets getAuthorizationCode().
public String getTerminalId()The terminal’s ID at the acquirer (the TID).
public CardReceipt setTerminalId(String terminalId)Sets getTerminalId().
public String getMerchantId()The merchant’s ID at the acquirer (the MID).
public CardReceipt setMerchantId(String merchantId)Sets getMerchantId().
public String[] getMerchantReceipt()The merchant’s copy of the receipt, line by line, as the terminal composed it; null when it composed none.
public CardReceipt setMerchantReceipt(String[] lines)Sets getMerchantReceipt().
public String[] getCustomerReceipt()The customer’s copy of the receipt, line by line, as the terminal composed it; null when it composed none.
public CardReceipt setCustomerReceipt(String[] lines)Sets getCustomerReceipt().

Inherited methods

Constructor details

CardReceipt

public CardReceipt()

Method details

getBrand

public String getBrand()
The card brand as the terminal named it, such as visa.

setBrand

public CardReceipt setBrand(String brand)

Returns

this receipt

getMaskedPan

public String getMaskedPan()
The card number with all but the last four digits hidden, as the terminal formatted it.

setMaskedPan

public CardReceipt setMaskedPan(String maskedPan)

Returns

this receipt

getApplicationId

public String getApplicationId()
The EMV application identifier (AID), such as A0000000031010.

setApplicationId

public CardReceipt setApplicationId(String applicationId)

Returns

this receipt

getApplicationLabel

public String getApplicationLabel()
The EMV application label, such as VISA CREDIT.

setApplicationLabel

public CardReceipt setApplicationLabel(String applicationLabel)

Returns

this receipt

getEntryMode

public CardReceipt.EntryMode getEntryMode()
How the card was read; never null.

setEntryMode

public CardReceipt setEntryMode(CardReceipt.EntryMode entryMode)

Returns

this receipt

getVerification

public CardReceipt.Verification getVerification()
How the cardholder was verified; never null.

setVerification

public CardReceipt setVerification(CardReceipt.Verification verification)

Returns

this receipt

getAuthorizationCode

public String getAuthorizationCode()
The issuer’s authorization code.

setAuthorizationCode

public CardReceipt setAuthorizationCode(String authorizationCode)

Returns

this receipt

getTerminalId

public String getTerminalId()
The terminal’s ID at the acquirer (the TID).

setTerminalId

public CardReceipt setTerminalId(String terminalId)

Returns

this receipt

getMerchantId

public String getMerchantId()
The merchant’s ID at the acquirer (the MID).

setMerchantId

public CardReceipt setMerchantId(String merchantId)

Returns

this receipt

getMerchantReceipt

public String[] getMerchantReceipt()
The merchant’s copy of the receipt, line by line, as the terminal composed it; null when it composed none.

setMerchantReceipt

public CardReceipt setMerchantReceipt(String[] lines)

Returns

this receipt

getCustomerReceipt

public String[] getCustomerReceipt()
The customer’s copy of the receipt, line by line, as the terminal composed it; null when it composed none.

setCustomerReceipt

public CardReceipt setCustomerReceipt(String[] lines)

Returns

this receipt