Class CardReceipt

java.lang.Object
com.codename1.payment.terminal.CardReceipt

public final class CardReceipt extends Object

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.

  • 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)

      Sets getBrand().

      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)

      Sets getMaskedPan().

      Returns

      this receipt

    • getApplicationId

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

      public CardReceipt setApplicationId(String applicationId)

      Sets getApplicationId().

      Returns

      this receipt

    • getApplicationLabel

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

      public CardReceipt setApplicationLabel(String applicationLabel)

      Sets getApplicationLabel().

      Returns

      this receipt

    • getEntryMode

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

      public CardReceipt setEntryMode(CardReceipt.EntryMode entryMode)

      Sets getEntryMode().

      Returns

      this receipt

    • getVerification

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

      public CardReceipt setVerification(CardReceipt.Verification verification)

      Sets getVerification().

      Returns

      this receipt

    • getAuthorizationCode

      public String getAuthorizationCode()
      The issuer's authorization code.
    • setAuthorizationCode

      public CardReceipt setAuthorizationCode(String authorizationCode)

      Sets getAuthorizationCode().

      Returns

      this receipt

    • getTerminalId

      public String getTerminalId()
      The terminal's ID at the acquirer (the TID).
    • setTerminalId

      public CardReceipt setTerminalId(String terminalId)

      Sets getTerminalId().

      Returns

      this receipt

    • getMerchantId

      public String getMerchantId()
      The merchant's ID at the acquirer (the MID).
    • setMerchantId

      public CardReceipt setMerchantId(String merchantId)

      Sets getMerchantId().

      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)

      Sets getMerchantReceipt().

      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)

      Sets getCustomerReceipt().

      Returns

      this receipt