On This Page
Requesting a Check Transaction Status for an Offline Sale Pending Submission
This section describes how to request a check transaction status for a single offline
sale transaction before it is submitted for authorization. The transaction status
displays on the Summary screen.
Follow these steps to request a check transaction status for an offline sale pending
submission:
- Access thetransactionIdentifiervalue in theonActivityResultmethod of the original transaction.
- Retrieve the transactionsummaryIntentvalue from themposUiobject.
- Use thestartActivitymethod to initiate the Summary screen.val summaryIntent = mposUi.offlineModule.createTransactionSummaryIntent(transactionIdentifier = "transactionIdentifier") startActivityForResult(summaryIntent, MposUi.REQUEST_CODE_SHOW_SUMMARY)
- After the Summary screen is dismissed, theonActivityResultis triggered. This action returns information about the previous transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_SHOW_SUMMARY) { when (resultCode) { // Result code from a successful transaction MposUi.RESULT_CODE_APPROVED -> { val transactionIdentifier = data?.getStringExtra(MposUi.RESULT_EXTRA_TRANSACTION_IDENTIFIER) Toast.makeText(findViewById(android.R.id.content),"Transaction approved!\nIdentifier: $transactionIdentifier", Toast.LENGTH_LONG).show() } // Result code from a declined, aborted or failed transaction MposUi.RESULT_CODE_FAILED -> { Toast.makeText(findViewById(android.R.id.content), "Transaction was declined, aborted, or failed", Toast.LENGTH_LONG).show() } } } }