After a transaction has been done, merchants might want to refund it or send another receipt to their shoppers. The Summary Screen makes this very easy for you!
Just make sure that you store the transactionIdentifer
for each
transaction in your system. You can access the transactionIdentifer
in the completed
callback of the payment method.
Show the Summary Screen
Call createSummaryViewControllerWithTransactionIdentifier
with your previously stored transactionIdentifier
:
ui.configuration.summaryFeatures = // Remove this line, if you do not want to offer refunds at all MPUMposUiConfigurationSummaryFeatureRefundTransaction | MPUMposUiConfigurationSummaryFeatureSendReceiptViaEmail; UIViewController *viewController = [ui createSummaryViewControllerWithTransactionIdentifier:@"transactionIdentifier" completed:^(UIViewController *controller) { [self dismissViewControllerAnimated:YES completion:NULL]; }]; UINavigationController *modalNav = [[UINavigationController alloc] initWithRootViewController:viewController]; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { modalNav.modalPresentationStyle = UIModalPresentationFullScreen; } else { // on iPad modalNav.modalPresentationStyle = UIModalPresentationFormSheet; } [self presentViewController:modalNav animated:YES completion:NULL];
In the Summary Screen, your merchants can then refund the transaction and email another receipt. If the transaction has already been refunded, the Summary Screen will show this accordingly.
After a transaction has been done, merchants might want to refund it or send another receipt to their shoppers. The Summary Screen makes this very easy for you!
Just make sure that you store the transactionIdentifer
for each
transaction in your system. You can access the transactionIdentifer
in the onActivityResult
callback of the payment method.
Show the Summary Screen
Call createTransactionSummaryIntent
with your previously stored transactionIdentifier
:
ui.getConfiguration().setSummaryFeatures(EnumSet.of( // Remove this line, if you do not want to offer refunds at all MposUiConfiguration.SummaryFeature.REFUND_TRANSACTION, MposUiConfiguration.SummaryFeature.SEND_RECEIPT_VIA_EMAIL) ); Intent intent = ui.createTransactionSummaryIntent("transactionIdentifier"); startActivityForResult(intent, MposUi.REQUEST_CODE_SHOW_SUMMARY);
In the Summary Screen, your merchants can then refund the transaction and email another receipt. If the transaction has already been refunded, the Summary Screen will show this accordingly.
In the onActivityResult
callback, check for a result ofRESULT_CODE_SUMMARY_CLOSED
to find out whether the Summary Screen was closed, so that you can update your own UI if required.