Option | Behavior Description |
---|---|
DISPLAY_INDEFINITELY | Summary screen displays indefinitely. This is the default behavior. |
CLOSE_AFTER_TIMEOUT | Summary screen closes after 5 seconds. |
SKIP_SUMMARY_SCREEN | Summary screen does not display. |
val configuration = UiConfiguration(resultDisplayBehavior = UiConfiguration.ResultDisplayBehavior.CLOSE_AFTER_TIMEOUT) mposUi.configuration = configuration
UiConfiguration configuration = new UiConfiguration.Builder() .resultDisplayBehavior(UiConfiguration.ResultDisplayBehavior.CLOSE_AFTER_TIMEOUT) .build(); mposUi.setConfiguration(configuration);
Feature | Behavior Description |
---|---|
CAPTURE_TRANSACTION | Capture —Enables the merchant to capture pre-authorized transactions that have not been captured or refunded. |
PRINT_CUSTOMER_RECEIPT | Print customer receipt —Enables the merchant to print the customer receipt. |
PRINT_MERCHANT_RECEIPT | Print merchant receipt —Enables the merchant to print the merchant receipt. |
REFUND_TRANSACTION | Refund —Enables the merchant to process a refund transaction for pre-authorized and captured transactions that have not been refunded. |
SEND_RECEIPT_VIA_EMAIL | Send via email —Enables the merchant to send the customer a receipt through email. |
val configuration = UiConfiguration( summaryFeatures = setOf( SummaryFeature.CAPTURE_TRANSACTION, SummaryFeature.PRINT_CUSTOMER_RECEIPT, SummaryFeature.PRINT_MERCHANT_RECEIPT, SummaryFeature.REFUND_TRANSACTION, SummaryFeature.SEND_RECEIPT_VIA_EMAIL ) ) mposUi.configuration = configuration
UiConfiguration configuration = new UiConfiguration.Builder() .summaryFeatures( EnumSet.of( UiConfiguration.SummaryFeature.SEND_RECEIPT_VIA_EMAIL, UiConfiguration.SummaryFeature.PRINT_CUSTOMER_RECEIPT, UiConfiguration.SummaryFeature.PRINT_MERCHANT_RECEIPT, UiConfiguration.SummaryFeature.REFUND_TRANSACTION, UiConfiguration.SummaryFeature.CAPTURE_TRANSACTION ) ) .build(); mposUi.setConfiguration(configuration);
val configuration = UiConfiguration(defaultSummaryFeature = SummaryFeature.CAPTURE_TRANSACTION) mposUi.configuration = configuration
UiConfiguration configuration = new UiConfiguration.Builder() .defaultSummaryFeature(SummaryFeature.CAPTURE_TRANSACTION) .build(); mposUi.setConfiguration(configuration);
val summaryIntent = mposUi.createTransactionSummaryIntent(transactionIdentifier = "transactionIdentifier") startActivityForResult(summaryIntent, MposUi.REQUEST_CODE_SHOW_SUMMARY)
Intent summaryIntent = mposUi.createTransactionSummaryIntent("transactionIdentifier"); startActivityForResult(summaryIntent, MposUi.REQUEST_CODE_SHOW_SUMMARY);
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() } } } }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == MposUi.REQUEST_CODE_SHOW_SUMMARY) { if (resultCode == MposUi.RESULT_CODE_APPROVED) { // Transaction was approved String transactionIdentifier = data.getStringExtra(MposUi.RESULT_EXTRA_TRANSACTION_IDENTIFIER); Toast.makeText(this, "Transaction approved, identifier: " + transactionIdentifier, Toast.LENGTH_LONG).show(); } else { // Card was declined, or transaction was aborted, or failed // (e.g. no internet or accessory not found) Toast.makeText(this, "Transaction was declined, aborted, or failed", Toast.LENGTH_LONG).show(); } } }
val filter = FilterParameters.Builder() .customIdentifier("my-custom-transaction-id") .build() val includeReceipts = true // Defines if the transaction objects should have receipt information embedded. val offset = 0 // Specifies the offset of the first transaction to return. val limit = 20 //Specifies the maximum number of transactions to return. mposUi.transactionModule.queryTransactions(filter, includeReceipts, offset, limit) { filterParameters, includeReceipts, offset, limit, transactions, error -> run { if (error != null) { // Handle query error } else { // Get the list of matching transactions accessing transactions property } } }
FilterParameters filter = new FilterParameters.Builder() .customIdentifier("my-custom-transaction-id") .build(); Boolean includeReceipts = true; // Defines if the transaction objects should have receipt information embedded. Integer offset = 0; // Specifies the offset of the first transaction to return. Integer limit = 20; //Specifies the maximum number of transactions to return. mposUi.getTransactionModule().queryTransactions(filter, includeReceipts, offset, limit, new QueryTransactionsListener() { @Override public void onCompleted(FilterParameters filterParameters, boolean b, int i, int i1, List<Transaction> list, MposError mposError) { if (mposError != null) { // Handle query error } else { // Get the list of matching transactions accessing list property } } });