Transaction Requests

Last updated: 2026-03-13

Available Operations

OperationIntent ActionDescription
Purchasese.westpay.softpos.PURCHASEProcess a contactless card payment.
Refundse.westpay.softpos.REFUNDRefund a previous payment.
Reversalse.westpay.softpos.REVERSALReverse the last processed transaction.

Common Response Extras

All transaction intents return the following extras on RESULT_OK:

ExtraTypeDescription
isSuccessbooleantrue if the transaction was approved.
amountstringTransaction amount (comma decimal separator, e.g. "100,50").
currencyIdstringISO 4217 numeric currency code.
transactionIdstringUnique transaction identifier.
terminalIdstringID of the terminal that processed the transaction.
acqRefNumberlongAcquirer reference number.
cardTypestringCard network name (e.g. Visa, Mastercard).
maskedCardPanstringMasked card number (e.g. ****1234).
typestringTransaction type (e.g. Purchase, Refund).
statusstringTransaction status. See Error Handling.
timestringTransaction timestamp.
denialReasonstringDenial reason if the transaction failed. See Error Handling.
errorstringError code. See Error Handling.
receiptDetailsstringJSON string containing receipt data for printing.

Receipt Details

The receiptDetails extra is a JSON string containing fields such as:

json
{
  "acqRef": 123456789,
  "terminalId": "T001",
  "transactionDateTime": "2025-01-06T10:30:00",
  "formattedAmount": "100,50 SEK",
  "card": "****1234",
  "paymentNetwork": "Visa",
  "txnStatus": "Approved",
  "transactionType": "Purchase"
}

Parse it safely with a try-catch block:

kotlin
fun parseReceiptDetails(jsonString: String?): ReceiptDetails? {
    return try {
        jsonString?.let { Gson().fromJson(it, ReceiptDetails::class.java) }
    } catch (e: Exception) {
        Log.e("SoftPOS", "Error parsing receipt details", e)
        null
    }
}