Last Transaction

Last updated: 2026-03-13

INTENT
se.westpay.softpos.GET_LAST_TRANSACTION

Retrieve the details of the most recently processed transaction from WestPay SoftPOS

HTTP Status Code Summary

CodeDescription
RESULT_OKThe operation completed. Check isSuccess and read the transaction extras.
RESULT_CANCELEDThe operation was cancelled or could not complete. Check the error / Error extra for the reason.
Request
kotlin
1private val resultLauncher = registerForActivityResult(
2    ActivityResultContracts.StartActivityForResult()
3) { result ->
4    if (result.resultCode == Activity.RESULT_OK) {
5        val data = result.data
6        val success = data?.getBooleanExtra("isSuccess", false) ?: false
7        if (success) {
8            val transactionId = data?.getStringExtra("transactionId")
9            val amount = data?.getStringExtra("amount")
10            val status = data?.getStringExtra("status")
11            val cardType = data?.getStringExtra("cardType")
12            val maskedCardPan = data?.getStringExtra("maskedCardPan")
13            val receiptDetails = data?.getStringExtra("receiptDetails")
14            // Handle last transaction details
15        } else {
16            val error = data?.getStringExtra("error")
17            // Handle failure or no transaction available
18        }
19    }
20}
21
22fun getLastTransaction() {
23    val intent = Intent("se.westpay.softpos.GET_LAST_TRANSACTION").apply {
24        addCategory(Intent.CATEGORY_DEFAULT)
25    }
26    if (intent.resolveActivity(packageManager) != null) {
27        resultLauncher.launch(intent)
28    } else {
29        showError("WestPay SoftPOS is not installed")
30    }
31}
Response
Response
1{
2  "isSuccess": true,
3  "amount": "100,50",
4  "currencyId": "752",
5  "transactionId": "TX123456",
6  "terminalId": "T001",
7  "acqRefNumber": 123456789,
8  "cardType": "Visa",
9  "maskedCardPan": "****1234",
10  "type": "Purchase",
11  "status": "Approved",
12  "time": "2025-01-06T10:30:00",
13  "denialReason": "None",
14  "error": "None",
15  "receiptDetails": "{...}"
16}