# Receipt Printing Specifications

Compliance rules require specific data to be printed on receipts based on the transaction type. This reference outlines the mandatory fields and formatting rules.

## 1. Standard Sale Receipt

You must print the following fields received in the notification payload:

1. **Header:** Merchant Name, Merchant Code (`comercio`), Terminal Number (`terminal`).
2. **Card Details:** Masked PAN (`tarjetaClienteRecibo`).
3. **Transaction:** Date, Time, Amount, Currency.
4. **References:** Authorization Code (`Aut`), Order/Ped ID (`Ped`).
5. **Signature Box:** Required by default unless specific exception flags are present (see below).

## 2. Card-Specific Requirements

### AMEX (American Express)

If the `marcaTarjeta` field is `8` (AMEX), you must include additional data:

* **Expiration Date:** You **must** print the card's expiration date (e.g., `Cad: 12/49`).
* **Logo:** It is recommended to print the American Express logo on the receipt header if your printer supports graphics.

## 3. EMV (Chip) Requirements

If the response contains EMV tags, they must be printed on the receipt to prove chip verification:

* **Application Label (`etiquetaApp`):** e.g., `VISA CLASSIC`
* **AID (`idapp`):** e.g., `A0000000031010`
* **Trans Num (`conttrans`):** Transaction counter.
* **Resp Code (`codrespauto`):** Authorization response code.

## 4. Exceptions: When to Skip Signature

The signature line (and the Merchant Copy of the receipt) can be omitted **only** if specific flags are present in the response.

### Conditions

* **`reciboOpcional` = `TRUE`**:
    * **Meaning:** The system indicates that printing the receipt is optional (e.g., digital receipt flow).
    * **Action:** You may skip printing **both** the Merchant and Customer copies entirely.

* **`ReciboSoloCliente` = `TRUE`**:
    * **Meaning:** The system recommends printing only the Customer copy.
    * **Action:** Do **not** print the signature box. You may optionally skip printing the Merchant Copy entirely.

* **`autenticadoPorPin` = `TRUE`**:
    * **Meaning:** The user verified the transaction via PIN.
    * **Action:** Do **not** print the signature box. Instead, print the text provided in the `Literales` object (e.g., `Literales.autenticadoPorPin`).

* **`operContactLess` = `TRUE`**:
    * **Meaning:** The card was tapped (NFC).
    * **Action:** Print the **Contactless Symbol**. If your printer does not support graphics, print the text provided in the `Literales` object or a standard text like "Op. Contactless".

## 5. Dynamic Currency Conversion (DCC)

If the transaction involved currency conversion, you must print the **exact text** provided in the `Literales` object to comply with financial regulations.

**Required Layout:**

1. **Disclaimer:** Print the `Literales.literal` block (e.g., "I accept that I have been offered a choice...").
2. **Exchange Details:** Iterate through and print the lines from `Literales.datosDCC`:
    * `linLitTrans`: "TRANSACTION CURRENCY"
    * `linLitDivisa`: Amount in Foreign Currency (e.g., `USD 16.37`)
    * `linCambio`: Exchange Rate (e.g., `1 USD = 0.85 EUR`)
    * `linMarkUp`: Markup text (e.g., `INCLUDES 2.0% MARK-UP`)

## 6. Refund Receipts

**Mandatory Requirement:**

Unlike sales, **Refund Receipts must always include a signature box** in the Customer Copy.

* **Reason:** The Merchant must sign or stamp this receipt to acknowledge to the customer that the funds have been returned.