Getnet DocsGetnet Docs

Transaction Receipt Management

The Get Mini Android SDK provides all the necessary transaction data and formatting strings (literals) to generate legal receipts. While the SDK does not include a direct email/SMS delivery service, it offers a query functionality to retrieve receipt duplicates as long as they remain available on the authorization host.

Requirements

To manage receipts, ensure:

  1. The SDK is initialized and the merchant is logged in.
  2. You have the Terminal Data (RedCLSTerminalData) from the login process.
  3. For historical receipts, you need the original Transaction Identifier (identifierRTS).

Step 1: Access Receipt Data in Real-Time

When a transaction (Sale, Refund, or Pre-authorization) completes successfully, the resulting RedCLSTransactionData object contains a list of literals. These are pre-formatted strings provided by the host that your application should use to construct the receipt.

// In your transaction result handler
val txData = response.transactionData

if (txData != null) {
    // Collect literals for the receipt
    val receiptLines: List<String> = txData.literals

    // Iterate and display/print
    receiptLines.forEach { line ->
        println("Receipt Line: $line")
    }
}

For transactions involving Currency Conversion (DCC), additional literals are found in txData.dccSelectionData.literals.


Step 2: Retrieve Historical Receipt (Duplicate)

If you need to generate a receipt after the transaction has concluded (e.g., from a transaction history screen), use the RedCLSQueryManager to fetch the data.

Historical receipts can be retrieved as long as the ticket is still available on the authorization host. The SDK does not guarantee indefinite retention of receipt data on the host side.

import redcls.itpvpc.managers.RedCLSQueryManager
import redcls.itpvpc.data.RedCLSQueryTicketCloudData

val queryData = RedCLSQueryTicketCloudData(terminalData, "ORIGINAL_RTS_IDENTIFIER")

Thread {
    val response = RedCLSQueryManager.queryTicket(context, queryData)

    if (response.status == 0) {
        val historicalTx = response.transactionData
        val historicalLiterals = historicalTx.literals
        // Generate your receipt duplicate using these literals
    }
}.start()

Step 3: Handle Digital Delivery (SMS/Email)

Since the SDK is agnostic to the delivery method, your application is responsible for sending the receipt data to the customer.

  1. Generate Plain Text: Construct a plain text representation of the receipt by joining the literals with newlines.
  2. Integrate Distribution: Send this text (or a formatted HTML/PDF version) using your backend’s email or SMS service providers.
  3. Customer Consent: Capture the email or phone number in your UI before triggering the delivery from your infrastructure.

Best Practices

  • Thermal Printing: The literals are designed for standard 32/40 character width thermal printers.
  • PIN Authentication: If txData.pinAuthenticatedLiteral is present, you should display it and typically skip the signature box on the receipt.
  • Persistence: Store the identifierRTS in your local database so you can always query the “Ticket Cloud” for a duplicate without storing all the receipt lines locally.

Next Steps