final Uri CONTENT_URI = Uri.parse("content://com.mypos.providers.LastTransactionProvider/last_transaction");

Cursor cursor = getContentResolver().query(
    CONTENT_URI,
    new String[] { // projection parameters you want to receive in response. Choose only the needed ones
        "amount",
        "currency",
        "reference_number",
        "reference_number_type",
        "operator_code",
        "response_code",
        "stan",
        "date_time",
        "authorization_code",
        "card_brand",
        "transaction_approved",
        "cvm",
        "transaction_type",
        "rrn"
    },
    null,
    null,
    null
);

if (cursor == null)
    return; // there is no last transaction recorded
    
cursor.moveToFirst();

double amount               = cursor.getDouble(cursor.getColumnIndex("amount"));
String currency             = cursor.getString(cursor.getColumnIndex("currency"));
String referenceNumber      = cursor.getString(cursor.getColumnIndex("reference_number"));
int referenceNumberType     = cursor.getInt(cursor.getColumnIndex("reference_number_type"));
String operatorCode         = cursor.getString(cursor.getColumnIndex("operator_code"));
String responseCode         = cursor.getString(cursor.getColumnIndex("response_code"));
String stan                 = cursor.getString(cursor.getColumnIndex("stan"));
String dateTime             = cursor.getString(cursor.getColumnIndex("date_time"));
String authorizationCode    = cursor.getString(cursor.getColumnIndex("authorization_code"));
String cardBrand            = cursor.getString(cursor.getColumnIndex("card_brand"));
boolean transactionApproved = cursor.getInt(cursor.getColumnIndex("transaction_approved")) == 1;
String cvm                  = cursor.getString(cursor.getColumnIndex("cvm"));
String transactionType      = cursor.getString(cursor.getColumnIndex("transaction_type"));
String rrn                  = cursor.getString(cursor.getColumnIndex("rrn"));

if(!cursor.isClosed())
    cursor.close();

 

Response

When a transaction has finished, an Intent with the following data is returned to the calling Activity:

  • reference_number - Internal myPOS reference number for the transaction

  • rrn - Retrieval Reference Number (RRN) is a unique identifier assigned by an acquirer to an authorization.
  • cardholder_name - Emboss name on the card

  • date_time - Date and time of the transaction formatted as YYMMDDHHmmss

  • pan - Obfuscated PAN, e.g. "XXXX-XXXX-XXXX-8008"

  • pan_hash - a hash of the PAN

  • status (int) - one of the constants in the TransactionProcessingResult class

  • status_text - a textual representation of the status

  • card_brand - MASTERCARD, MAESTRO, VISA, VISA ELECTRON, VPAY, JCB, PAYPASS, PAYWAVE, UNIONPAY, BANCONTACT

  • card_entry_mode – method of presenting the card:

    • ENTRY_MODE_MAGSTR – mag stripe transaction
    • ENTRY_MODE_EMV – chip transaction
    • ENTRY_MODE_CONTACTLESS – contactless mag stripe transaction
    • ENTRY_MODE_CONTACTLESS_MCHIP – contactless chip transaction
    • ENTRY_MODE_MANUAL – Manual Key Entry (MO/TO) transaction
  • response_code - response code returned by issuer. Values, different from "00", represent the reason for a declined transaction

  • authorization_code - authorization code returned by issuer

  • signature_required (boolean) - true : signature row must be present on receipt , false : signature row must not be present on receipt

  • TSI - Transaction Status Indicator

  • TVR - Terminal Verification Result

  • AID - Application Identifier (card)

  • STAN - System Trace Audit Number (unique number of transaction by TID)

  • CVM - Cardholder Verification Method (P – PIN, S – Signature , N – NO CVM)

  • application_name - Application Label, read from the card chip

  • transaction_approved (boolean) - – true : approved, false : declined

  • dcc_available (boolean) - Dynamic currency conversion (DCC) available

  • amount_dcc (double) - Dynamic currency conversion (DCC) amount

  • currency_dcc - Dynamic currency conversion (DCC) currency

  • exchange_rate (double) - Dynamic currency conversion (DCC) exchange rate

  • TID - Terminal id

  • update_pending (boolean) - New update is available

  • resp_code - Payment request response code. Values, different from "00", represent the reason for a declined transaction

  • expire_date - Payment request expire date

  • merchant_data - Bundle with data from your myPOS profile used for printing the receipts. It contains:

    • billing_descriptor - merchant billing descriptor
    • address_line1 - merchant address line 1
    • address_line2 - merchant address line 2
    • MID - Merchant ID
    • custom_receipt_row1 - custom receipt footer row 1
    • custom_receipt_row2 - custom receipt footer row 2
  • installment_data - Bundle with data if user paid in installments. It contains:

    • number (int) - selected number of installments
    • interest_rate (double) - installment interest rate
    • fee (double) - installment fee
    • annual_percentage_rate (double) - installment annual percantage rate
    • total_amount (double) - installments total amount
    • first_installment_amount (double) - first installment amount
    • subsequent_installment_amount (double) - subsequent installment amount

Note 1: Unless noted, extras in the bundle are Strings.

Note 2: Depending on the card and transaction type, some of the extras are not always present.