On This Page
PAX All-in-One Payment Services
Use the information in this section to process PAX All-in-One Solution payment
services.
Sale
Use the information in this section to process a sale. This type of transaction combines an
authorization and a capture into a single transaction.
Follow these steps to process a sale.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .charge(BigDecimal("1.00"), Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed, theonActivityResultmethod is triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Refund
Use the information in this section to process a refund by referencing the original
transaction. You can issue refunds for either the full amount or a partial amount of
the original transaction. Stand-alone credits are also supported and can be
processed independently of a prior transaction. For more information, see Stand-Alone Credit.
Follow these steps to process a refund.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .refund("transactionIdentifier") // Specify amount and currency for partial refunds // .amountAndCurrency(BigDecimal("1.00"), Currency.EUR) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed, theonActivityResultis triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { when (resultCode) { // Result code from a successful transaction MposUi.RESULT_CODE_APPROVED -> { val transactionIdentifier = data?.getStringExtra(MposUi.RESULT_EXTRA_TRAN SACTION_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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Stand-Alone Credit
Use the information in this section to process a stand-alone credit. This type of
transaction enables you to issue a credit without referencing a previous
transaction. To complete the credit, the customer must present their payment card at
the time of processing.
When processing a stand-alone credit, there is no limit on the
credit amount because the transaction does not reference the original purchase. To
help manage risk, it is recommended to use a refund transaction whenever possible.
For more information, see Refund.
Follow these steps to process a stand-alone credit.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .refund(BigDecimal("1.00"), Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed,onActivityResultis triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Check Transaction Status
Use the information in this section to request a check transaction status. This
transaction type is used to retrieve response data for a transaction that was lost
or timed out. You can initiate a status check when you have the
transactionIdentifier
value for the transaction that you want
to query. When the check transaction status request is completed, the transaction
details are shown on the Summary screen.Follow these steps to request a check transaction status.
- Access thetransactionIdentifiervalue in theonActivityResultmethod of the original transaction.
- Retrieve the transactionsummaryIntentvalue from themposUiobject.
- Use thestartActivitymethod to initiate the Summary screen.val summaryIntent = mposUi.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) // Result code from closing the summary screen if (resultCode == MposUi.RESULT_CODE_SUMMARY_CLOSED) { // Accessing status from the transaction that was just queried val transactionStatus = mposUi.latestTransaction?.status Toast.makeText(activity, "Summary closed. Transaction status: $transactionStatus", Toast.LENGTH_SHORT).show() } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Sale with On-Reader Tipping
Use the information in this section to process a sale with on-reader tipping. At the
start of each transaction, the terminal prompts the customer to add a tip by showing
suggested tip amounts. The customer chooses or enters a tip amount on the terminal
before presenting their payment card.
Follow these steps to process a sale with on-reader tipping.
- Create aTransactionParametersobject and provide the required information for the payment.
- Create aTippingProcessStepParametersobject to configure the tipping function. The tipping options are percentage choice, tip amount, and total amount.
- Create aTransactionProcessParametersobject to add the tipping step.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .charge(BigDecimal("1.00"), Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .build() // Use to display three tipping percentage choices val tipStep = TippingProcessStepParameters.Builder() .askForPercentageChoice() // Optional to configure tipping percentages | Default values = 10, 15, 20 // .percentages(BigDecimal("10"), BigDecimal("20"), BigDecimal("30")) // Optional to show confirmation screen // .showTotalAmountConfirmationScreen(true) .build() // Use to ask for tip amount // val tipStep = TippingProcessStepParameters.Builder() // .askForTipAmount() // Optional to show confirmation screen // .showTotalAmountConfirmationScreen(true) // .build() // Use to ask for total transaction amount including tip // val tipStep = TippingProcessStepParameters.Builder() // .askForTotalAmount() // Optional to show confirmation screen // .showTotalAmountConfirmationScreen(true) // .build() val processParameters = TransactionProcessParameters.Builder() .addStep(tipStep) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters, processParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed,onActivityResultis triggered. This action returns information about the last transaction.Override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Sale with On-Receipt Tipping
Use the information in this section to process a sale with on-receipt tipping. After the original
transaction amount is pre-authorized, the customer writes the tip or total amount on the
printed receipt. A follow-on tip adjust request must be sent within 24 hours to
capture the transaction. For more information, see Tip Adjust.
By using this feature, you assume the risk of the
overcapture being declined and increased chargebacks. Only use this feature when
required. The recommendation is to process a sale with on-reader tipping whenever
possible. For more information, see Sale with On-Reader Tipping.
Sale with On-Receipt Tipping
After completing a sale with on-receipt tipping transaction, a follow-on tip adjust request
must be sent within 24 hours to capture the transaction. For more information, see Tip Adjust.
Follow these steps to process a sale with on-receipt tipping.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .charge(BigDecimal("50.00"), Currency.USD) .customIdentifier("yourReferenceForTheTransaction") .autoCapture(false) .TipAdjustable(true) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed, theonActivityResultmethod is triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Tip Adjust
Use the information in this section to process a tip adjust. This is a required follow-on
transaction after processing a sale with on-receipt tipping. The tip adjust request
must be sent within 24 hours to capture the transaction.
After the original sale transaction is pre-authorized, the customer writes the tip or
total amount on the printed receipt. The tip adjust request must be submitted with the
tip amount or with
0
, if no tip was provided. The tip adjust amount is
limited to 20% of the original transaction amount. Requests for higher amounts will be
rejected. A follow-on tip adjust request is then sent to capture the additional tip
amount. This transaction is also called an overcapture
. For more information, see Sale with On-Receipt Tipping.
Tip Adjust
Follow these steps to process a tip adjust.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .adjustTip("transactionIdentifier", BigDecimal("10.00"), Currency.USD) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed, theonActivityResultmethod is triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Token Refund
Use the information in this section to process a token refund. A token refund
transaction enables you to process a stand-alone credit against a tokenized card. To
process a credit through a token, you must have the
Token Management Service
product
enabled and an existing (saved) token from a tokenized transaction. For more
information, see .Follow these steps to process a token refund.
- Create aTransactionParametersobject and provide the required information for the payment.
- Create anaccountParametersobject and set theinstrumentIdentifierIDfrom the original transaction’s metadata as theshopperAccountIdentifier.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .refund(BigDecimal("1.00"), Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .build() val accountParameters = AccountParameters.Builder().token().cybersource().shopperAccountIdentifier("instrumentIdentifierID").build(); val transactionIntent = mposUi.createTransactionIntent(transactionParameters, null, accountParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed,onActivityResultis triggered. This action returns information about the last transaction.Override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Pre-Authorization
Use the information in this section to process a pre-authorization for an initial
amount. A pre-authorization transaction places a temporary hold on the customer's
payment card. The transaction amount can be captured at a later time.
Most authorizations expire within 5 to 7 days, as determined by the issuing bank.
When an authorization expires, your bank, the issuing bank, or payment processor
might require you to resubmit the authorization request and include a capture
request in the same message. For more information, see Capture.
To help ensure successful transaction processing, it is recommended to monitor
authorization timelines and use combined authorization and capture requests when
necessary.
Follow these steps to process a pre-authorization.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvalue from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .charge(BigDecimal("1.00"), Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .autoCapture(false) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed,onActivityResultis 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_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Incremental Authorization
Use the information in this section to process an incremental authorization. This type of transaction can
be made on a pre-authorization request to increase the authorized amount before it
is captured.
Follow these steps to process an incremental authorization.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvalue from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .incrementalAuthorization("transactionIdentifier") .amountAndCurrency(BigDecimal("1.00"), Currency.EUR) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed,onActivityResultmethod is 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_PAYMENT) { when (resultCode) { // Result code from a successful transaction MposUi.RESULT_CODE_APPROVED -> { val transactionIdentifier = data?.getStringExtra(MposUi.RESULT_EXTRA_TRAN SACTION_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() } } } }
- Get the full transaction object by retrieving thelatestTransactionvalue from the mposUi object.val transactionObject = mposUi.latestTransaction
Capture
Use the information in this section to capture a pre-authorized transaction. The
capture request references the approved pre-authorization request.
Follow these steps to process a capture.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .capture("transactionIdentifier") // Specify amount and currency for partial captures // .amountAndCurrency(BigDecimal("1.00"), Currency.EUR) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed,onActivityResultis triggered. This action returns information returns information about the last transaction.Override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { when (resultCode) { // Result code from a successful transaction MposUi.RESULT_CODE_APPROVED -> { val transactionIdentifier = data?.getStringExtra(MposUi.RESULT_EXTRA_TRAN SACTION_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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Mail Order or Telephone Order
Use the information in this section to process a mail order or telephone order (MOTO)
sale and other transactions. The payment card is not presented physically at the
terminal for a MOTO transaction because it is a card-not-present transaction.
Instructions for processing the various transaction types are shown in step 2 of the
code example.
Follow these steps to process a MOTO transaction.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() // Use for Sale .charge(BigDecimal("1.00"), Currency.EUR) // Use for Account Verification // .verification(Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") // Use for Pre-Authorization // .autoCapture(false) .workflow(new WorkflowConfiguration.Builder() .moto() // Set to false to toggle CVV as optional .cvvRequired(true) // Set to false to toggle address as optional .addressRequired(true) // Set to true to show transaction review screen .reviewRequired(false) .build()) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed,onActivityResultis triggered. This action returns information about the last transaction.Override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Account Verification
Use the information in this section to process an account verification. The account
verification transaction submits a zero-amount authorization request to validate the
payment card.
Follow these steps to process an account verification.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .verification(Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed,onActivityResultis triggered, which returns information about the last transaction.Override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Offline Transactions
Use the information in this section to process offline sale or refund transactions when
internet connectivity is unavailable.
Using offline transaction functionality involves risk. Because these
transactions are not authorized in real time, you assume responsibility for potential
issues such as failed transactions, increased fraud, and higher chargeback rates. Only
use offline transactions when necessary such as during temporary internet outages.
Whenever possible, it is recommended to process online sale transactions to ensure
secure and immediate authorization. For more information, see Sale.
Review these considerations before performing
offline transactions:
- Contactless transactions are not supported for offline sales.
- A terminal must have successfully processed at least one online transaction before it can perform offline transactions.
- Offline transactions must be submitted for authorization once internet connectivity is restored. For more information, see Submit an Offline Transactions Batch for Authorization.
Perform an Offline Sale
Use the information in this section to process an offline sale, also known as a
deferred authorization
or store-and-forward
transaction. Offline
sales can only be performed on terminals that have successfully processed at least
one online transaction. When internet connectivity is unavailable, an offline sale enables you to capture
transaction details locally. These stored transactions must be submitted for
authorization when connectivity is restored. For more information, see Submit an Offline Transactions Batch for Authorization.
Only process offline sales when required. The recommendation is
to process online sale transactions whenever possible. For more information, see
Sale.
Follow these steps to process an offline sale.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.// Use this to configure the maximum amount per offline transaction and maximum amount for an offline batch. // MposUI.offlineModule.offlineTransactionConfiguration = OfflineTransactionConfiguration( // maximumAmountPerTransaction = BigDecimal("100.00"), // maximumTotalAmountForBatch = BigDecimal("1000.00") // ) val transactionParameters = TransactionParameters.Builder() .charge(BigDecimal("1.00"), Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .build() val transactionIntent = mposUi.offlineModule.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed, theonActivityResultis triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
Refund an Offline Sale Pending Submission
Use the information in this section to process a refund for an offline sale before it is submitted
for authorization.
Follow these steps to refund an offline sale pending submission.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .refund("transactionIdentifier") .build() val transactionIntent = mposUi.offlineModule.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed, theonActivityResultis triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
Request a Check Transaction Status for an Offline Sale Pending Submission
Use the information in this section to request a check transaction status for a
single offline sale transaction before it is submitted for authorization. The
transaction status shows 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() } } } }
Retrieve a List of Offline Transactions Pending Submission
Use the information in this section to retrieve a list of stored offline transactions before they
are submitted for authorization.
Follow this step to retrieve a list of offline transactions pending submission:
- Use thequeryTransactionsfunction from themposUiobject to retrieve the list.mposUi.offlineModule.queryTransactions( filterParameters = FilterParameters.Builder().build(), includeReceipts = false, offset = 0, limit = 20 ) { _, _, _, _, transactions, mposError -> if (transactions != null && transactions.isNotEmpty()) { // Handle Success scenario } else { // Handle Error Scenario } }
Submit an Offline Transactions Batch for Authorization
Use the information in this section to submit an offline transactions batch for authorization.
After processing offline sale transactions, you must submit these transactions for
authorization. The recommendation is to submit the batch as soon as internet
connectivity is available.
Follow these steps to submit an offline transactions batch for authorization.
- Retrieve thebatchSubmissionIntentfrom themposUiobject.
- Use thestartActivitymethod to initiate the offline transactions batch submission.val batchSubmissionIntent = mposUi.offlineModule.submitOfflineTransactionBatchIntent() startActivityForResult(batchSubmissionIntent, MposUi.REQUEST_CODE_SUBMIT_BATCH)
- After the batch submission result is dismissed, theonActivityResultis triggered. This action returns information about the last batch submission.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_SUBMIT_BATCH) { when (resultCode) { // Result code from a successful batch submission MposUi.RESULT_CODE_SUBMIT_BATCH_SUCCESS -> { Toast.makeText(findViewById(android.R.id.content),"Batch submission successful", Toast.LENGTH_LONG).show() } // Result code from a failed batch submission MposUi.RESULT_CODE_SUBMIT_BATCH_FAILED -> { Toast.makeText(findViewById(android.R.id.content),"Batch submission failed", Toast.LENGTH_LONG).show() } } } }
Cashback
Use the information in this section to process a cashback transaction. This type of transaction enables a
customer to request that a specified amount of cash be given to them as part of the
transaction. A cashback transaction can be performed with or without a purchase.
Follow these steps to process a cashback.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .charge(BigDecimal("30.00"), Currency.GBP) .withCashback(BigDecimal("10.00")) .customIdentifier("yourReferenceForTheTransaction") .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed, theonActivityResultis triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Sale with Installment Details
Use the information in this section to process a sale with installment details. This type of
transaction can be used to include required installment payment details as part of
the transaction.
This transaction is available only in the Latin American & Caribbean (LAC)
region.
Follow these steps to process a sale with installment details.
- Create anInstallmentDetailsobject and set one ore more of the installment fields.// Set value of the builder to the number of installments val installmentDetails = InstallmentDetailsBuilder(5) // Set to PlanType.ISSUER_FUNDED for issuer funded plans .planType(PlanType.MERCHANT_FUNDED) .includesInterest(true) .governmentPlan(true) .build()
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .charge(BigDecimal("1.00"), Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .installmentDetails(installmentDetails) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is complete and the Summary screen is dismissed, theonActivityResultis triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom themposUiobject.val transactionObject = mposUi.latestTransaction
Sale with Payment Facilitator Details
Use the information in this section to process a sale with payment facilitator details. This
type of transaction can be used to include required payment facilitator details as
part of the transaction.
Follow these steps to process a sale with payment facilitator details.
- Create aMerchantDetailsobject and set one ore more of the payment facilitator fields.val merchantDetails = MerchantDetailsBuilder() .salesOrganizationId("12345") .subMerchantId("SM67890") .merchantDescriptor("ExampleMerchant") .build()
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .charge(BigDecimal("1.00"), Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .merchantDetails(merchantDetails) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is complete and the Summary screen is dismissed, theonActivityResultis triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom themposUiobject.val transactionObject = mposUi.latestTransaction
Sale with Tax Details
Use the information in this section to process a sale with tax details. This type of
transaction can be used to include required tax details as part of the
transaction.
Follow these steps to process a sale with tax details.
- Create aTaxDetailsobject and set one ore more of the tax fields.val taxDetails = TaxDetailsBuilder() .merchantTaxId("TaxID1234") .salesSlipNumber(12345678) .includedTaxAmount(BigDecimal("5.00")) .includedLocalTaxAmount(BigDecimal("1.00")) .includedNationalTaxAmount(BigDecimal("2.00")) .build()
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() .charge(BigDecimal("1.00"), Currency.EUR) .customIdentifier("yourReferenceForTheTransaction") .taxDetails(taxDetails) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is complete and the Summary screen is dismissed, theonActivityResultis triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom themposUiobject.val transactionObject = mposUi.latestTransaction
Electronic Benefits Transfer
Public assistance programs in the United States use Electronic Benefits Transfer (EBT)
payment cards to issue monthly food and cash benefits to eligible people. EBT cards
function like prepaid debit cards that can be used at authorized retailers. Food
benefits are issued through the Supplemental Nutrition Assistance Program (SNAP), which
helps people with low incomes purchase eligible food items.
EBT SNAP and EBT Cash Transactions
Use the information in this section to process an EBT sale and other transactions for
EBT SNAP (food benefit) and EBT cash. Instructions for processing the various
transaction types are shown in step 2 of the code example.
Follow these steps to process an EBT transaction.
- Create aTransactionParametersobject and provide the required information for the payment.
- Retrieve thetransactionIntentvariable from themposUiobject and use thestartActivitymethod to initiate the transaction flow.val transactionParameters = TransactionParameters.Builder() // Use for Sale .charge(BigDecimal("1.00"), Currency.USD) // Use for Stand-Alone Credit // .refund(BigDecimal("1.00"), Currency.USD) // Use for Cashback // .withCashback(BigDecimal("10.00")) .customIdentifier("yourReferenceForTheTransaction") .workflow(new WorkflowConfiguration.Builder() .ebt() // Set to CASH for EBT cash .category(FOOD) // Set to true for Balance Inquiry and set amount to 0 .balanceInquiry(false) // Set to true for Voucher transaction .voucher(false) .build()) .build() val transactionIntent = mposUi.createTransactionIntent(transactionParameters) startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
- After the transaction is completed and the Summary screen is dismissed, theonActivityResultmethod is triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_PAYMENT) { 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() } } } }
- Get the full transaction object by retrieving thelatestTransactionfrom the mposUi object.val transactionObject = mposUi.latestTransaction
Custom Card Read
The Custom Card Read feature enables you to obtain data from custom cards such as gift
cards, loyalty program cards, and employee cards. This service cannot be used to perform
payment functions.
Custom Card Read is supported for non-PCI cards
only. To use this service, the card type must be on your allowlist. To add a card type
to your allowlist, contact your implementation manager.
To retrieve the card data, swipe the card’s magnetic stripe through the payment device.
The custom card read-only function reads and returns the raw card identifier to your app
or point-of-sale (POS) system. You can then use the raw data within your app or POS
system.
These are examples of how you might use the Custom Card Read feature:
- Custom gift card:Use the card number to check a balance or process a payment in your private gift card network.
- Employee card:Use the card number to look up an employee's profile or account.
Custom Card Read
Follow these steps to perform a custom card read.
- Retrieve theReadCardIntentvalue from themposUiobject and use thestartActivitymethod to initiate the card read flow.val ReadCardIntent = mposUi.createReadCardIntent() startActivityForResult(ReadCardIntent, MposUi.REQUEST_CODE_READ_CARD)
- After the card read activity is completed, theonActivityResultmethod is triggered. This action returns information about the status of the card read activity and the card details.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == MposUi.REQUEST_CODE_READ_CARD) { when (resultCode) { // Result code from a successful card read MposUi.RESULT_CODE_READ_CARD_SUCCESS -> { val cardDetailsObject = (mposUi.lastExecution as ExecutionProcess.ReadCardExecutionProcess.Completed).cardDetails Toast.makeText(findViewById(android.R.id.content), "Card read successful", Toast.LENGTH_LONG).show() } // Result code from a failed card read MposUi.RESULT_CODE_READ_CARD_FAILED -> { Toast.makeText(findViewById(android.R.id.content), "Card read failed", Toast.LENGTH_LONG).show() } } } }
Print a Customer or Merchant Receipt
Follow these steps to print a customer or merchant receipt from a previous
transaction.
- Retrieve thePrintCustomerReceiptIntentfrom themposUiobject and use thestartActivitymethod to initiate the printing a receipt flow.// Use to print a customer receipt val PrintCustomerReceiptIntent = mposUi.createPrintCustomerReceiptIntent(transactionIdentifier, false) startActivityForResult(PrintCustomerReceiptIntent, MposUi.REQUEST_CODE_PRINT_CUSTOMER_RECEIPT) // Use to print a merchant receipt val PrintMerchantReceiptIntent = mposUi.createPrintMerchantReceiptIntent(transactionIdentifier, false) startActivityForResult(PrintMerchantReceiptIntent, MposUi.REQUEST_CODE_PRINT_MERCHANT_RECEIPT)
- After the printing activity is completed,onActivityResultis triggered. This action returns information about the last transaction.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) "onActivityResult: $resultCode".logDebug(TAG) val parentLayout: View = activity!!.findViewById(android.R.id.content) if (requestCode == MposUi.REQUEST_CODE_PRINT_CUSTOMER_RECEIPT || requestCode == MposUi.REQUEST_CODE_PRINT_MERCHANT_RECEIPT) { if (resultCode == MposUi.RESULT_CODE_PRINT_SUCCESS) { Snackbar.make(parentLayout, "Printing success", Snackbar.LENGTH_SHORT).show() } else if (resultCode == MposUi.RESULT_CODE_PRINT_FAILED) { Snackbar.make(parentLayout, "Printing failed", Snackbar.LENGTH_SHORT).show() } }
Email a Customer Receipt
Follow these steps to email a customer receipt from a previous transaction.
- Retrieve theSendEmailReceiptIntentvalue from themposUiobject and use thestartActivitymethod to initiate the emailing a receipt flow.val SendEmailReceiptIntent = mposUi.createSendEmailReceiptIntent(transactionIdentifier) startActivityForResult(SendEmailReceiptIntent, MposUi.REQUEST_CODE_SEND_EMAIL)
- After the emailing activity is completed,onActivityResultis triggered, which returns information about the status of the emailing activity.override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) "onActivityResult: $resultCode".logDebug(TAG) val parentLayout: View = activity!!.findViewById(android.R.id.content) if (requestCode == MposUi.REQUEST_CODE_SEND_EMAIL) { if (resultCode == MposUi.RESULT_CODE_EMAIL_SUCCESS) { Snackbar.make(parentLayout, "Receipt sent via email", Snackbar.LENGTH_SHORT).show() } else if (resultCode == MposUi.RESULT_CODE_EMAIL_FAILED) { Snackbar.make(parentLayout, "Fail while sending receipt via email", Snackbar.LENGTH_SHORT).show() } } }