Skip to main content

Documentation

Transaction API
Standard card transactions

// Minimal — no extra parameters
Api.startTransaction(amount, TransactionType.SALE, context);

// With parameters
HashMap<String, String> params = new HashMap<>();
params.put(Parameters.CORRELATION_ID, "order-123");
params.put(Parameters.REFERENCE_ID,   "ref-456");
params.put(Parameters.DISABLE_PRINTING, "true");

Api.startTransaction(amount, TransactionType.SALE, params, context);

Supported transaction types: SALE, REFUND, PREAUTH, TOPUP, CASHBACK, CASH_ADVANCE

Response: TRANSACTION_RESULT_ACTION or TRANSACTION_CANCELLED_ACTION

PAX A8700 — dual-display devices

On the PAX A8700 the transaction UI must be shown on the customer-facing display (display ID 1). Pass MODEL = "A8700" in the parameters map. Printing is automatically disabled on this device.

params.put(Parameters.MODEL, "A8700");
Api.startTransaction(amount, TransactionType.SALE, params, context);
MOTO transactions (manual card entry)

MOTO (Mail Order / Telephone Order) allows card details to be typed in manually — no physical card required.

HashMap<String, String> params = new HashMap<>();
params.put(Parameters.CORRELATION_ID, "order-789");

Api.startMotoTransaction(amount, TransactionType.SALE, params, context);

Supported transaction types: SALE, REFUND, PREAUTH

Response: TRANSACTION_RESULT_ACTION or TRANSACTION_CANCELLED_ACTION

Note

MOTO must be enabled in the merchant configuration (moto = true).

APM transactions (Alternative Payment Methods / Pay by Link)

APM transactions use QR codes, digital wallets, or other non-card payment methods.

HashMap<String, String> params = new HashMap<>();
params.put(Parameters.CORRELATION_ID, "order-101");

Api.startApmTransaction(amount, params, context);

Response: TRANSACTION_RESULT_ACTION or TRANSACTION_CANCELLED_ACTION

Note

APM must be enabled (payByLink = true in the Config). Contact Rapyd to configure APM for your terminal.

Card check

Verifies that a card is readable and supported by the terminal without charging the customer. Internally initiates a zero-amount PREAUTH.


HashMap<String, String> params = new HashMap<>();
params.put(Parameters.CORRELATION_ID, "check-001");

Api.startCardCheck(context, params);

Response: TRANSACTION_RESULT_ACTION — check transactionResponse for the card check outcome. Core also broadcasts ACTION_CARD_DATA during card check with raw card data.

case Messages.ACTION_CARD_DATA: {
    String cardData = intent.getStringExtra(Messages.CARD_DATA);
    String uti      = intent.getStringExtra(Messages.TRANSACTION_UTI);
    break;
}
Cancel a transaction

Cancels the active transaction. If no transaction is in progress this is a no-op.

Api.cancelTransaction(context);

Note: Cancellation is not possible while EMV chip processing is active. If the cancel could not be applied, Core broadcasts ACTION_CANCEL_TRANSACTION_FAILED.

Check if a transaction is in progress
Api.checkIfTransactionInProgress(context);

// In your receiver:
case Messages.ACTION_GET_TRANSACTION_IN_PROGRESS_RESULT: {
    boolean inProgress = intent.getBooleanExtra(
        Messages.ACTION_GET_TRANSACTION_IN_PROGRESS_RESULT, false);
    break;
}