Reporting

Last updated: 2026-03-13

Available Operations

OperationIntent ActionDescription
Transaction Historyse.westpay.softpos.VIEW_HISTORYRetrieve a list of transactions for a date range.
Last Transactionse.westpay.softpos.GET_LAST_TRANSACTIONGet the details of the most recently processed transaction.

Notes

  • Date ranges for transaction history must use the yyyy-MM-dd format.
  • Transaction history response is returned as a JSON string in the txnHistoryResponse extra.
  • The last transaction response uses the same extras as a standard transaction result.

Parsing Transaction History

The txnHistoryResponse extra is a JSON string with the following structure:

json
{
  "status": "OK",
  "transactionList": [
    {
      "acqRef": 123456789,
      "terminalId": "T001",
      "transactionDateTime": "2025-01-06T10:30:00",
      "formattedAmount": "100,50 SEK",
      "card": "****1234",
      "paymentNetwork": "Visa",
      "txnStatus": "Approved",
      "transactionType": "Purchase"
    }
  ],
  "transactionSummary": {
    "totalPurchaseAmount": 100.50,
    "totalRefundAmount": 0.00
  }
}

Parse it safely with a try-catch block:

kotlin
fun handleTransactionHistoryResult(data: Intent?) {
    val historyJson = data?.getStringExtra("txnHistoryResponse")
    try {
        val history = Gson().fromJson(historyJson, TransactionHistoryResponse::class.java)
        history?.transactionList?.forEach { transaction ->
            // Process each transaction
        }
        history?.transactionSummary?.let { summary ->
            Log.d("Summary", "Total Purchases: ${summary.totalPurchaseAmount}")
        }
    } catch (e: Exception) {
        Log.e("SoftPOS", "Error parsing transaction history", e)
    }
}