Reversal

Last updated: 2026-03-13

INTENT
se.westpay.softpos.REVERSAL

Reverse the last processed transaction through WestPay SoftPOS

HTTP Status Code Summary

CodeDescription
RESULT_OKThe operation completed. Check isSuccess in the response extras to determine if the reversal was successful.
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            // Handle successful reversal
10        } else {
11            val error = data?.getStringExtra("error")
12            // Handle failure
13        }
14    } else {
15        val error = result.data?.getStringExtra("error")
16            ?: result.data?.getStringExtra("Error")
17        // Handle cancellation
18    }
19}
20
21fun initiateReversal() {
22    val intent = Intent("se.westpay.softpos.REVERSAL").apply {
23        addCategory(Intent.CATEGORY_DEFAULT)
24    }
25    if (intent.resolveActivity(packageManager) != null) {
26        resultLauncher.launch(intent)
27    } else {
28        showError("WestPay SoftPOS is not installed")
29    }
30}
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": "Reversal",
11  "status": "Approved",
12  "time": "2025-01-06T10:35:00",
13  "denialReason": "None",
14  "error": "None",
15  "receiptDetails": "{...}"
16}