A display request lets you show information on the display of the payment terminal outside of a payment flow. You can:
Abort a previous Display only when it is still shown and the next operation presents its own terminal UI, such as a financial operation or NFC Tag. Wait for the Abort to complete before starting that operation. Print, Transmit, and further Display updates do not require this step. See Device Display & Interaction for details.
Content or reference of the message.
Information to display, print or store.
Message format.
Content or reference of the message.
Destination of the message.
Number of seconds the message has to be displayed.
Flag to request a message response. Android and C# use a Boolean; iOS uses a string.
Unique identification of the partner that is the recipient of the message exchange.
For example, the POS SN
Result of the requested transaction.
Detail of the response.
Additional information to be logged for further examination.
When you receive the terminal result through the SDK callback interface and DisplayResult.response = SUCC, you can obtain additional details to support your business requirements.
The following fields are defined, and the availability of each field depends on the capabilities provided by the payment application.
The outputResultList is a collection or array that stores multiple results generated by a process, function, or operation.
Information to display, print or store.
Gives reponse for each peripheral.
Result of the requested transaction.
Detail of the response.
Additional information to be logged for further examination.
Message format.
DISP: Standard display interface.
| Scenario | Format | Content |
|---|---|---|
| Shopping cart | SREF | JSON data for the shoppingCart template |
| XHTML content | HTML | Supported XHTML content |
Use SREF with the fixed shoppingCart template identifier. Replace the cart values while preserving the field names and JSON structure.
ActionMessageParam displayContentParam = ActionMessageParam.newBuilder()
.format(OutputFormat3Code.SREF)
.messageContent("{\"refId\":\"shoppingCart\",\"data\":{\"received\":\"$1.00\",\"discount\":\"$2.00\",\"change\":\"$0.00\",\"actualHarvest\":\"$1.00\",\"details\":[{\"number\":\"1\",\"name\":\"Strawberry Cheese Cake\",\"price\":\"$1.00\",\"qty\":\"1\",\"subTotal\":\"$1.00\"},{\"number\":\"2\",\"name\":\"Chocolate Mousse Cake\",\"price\":\"$1.00\",\"qty\":\"1\",\"subTotal\":\"$1.00\"}]}}")
.messageDestination(UserInterface4Code.MDSP) //Merchant display
.minimumDisplayTime(15L) // 15 seconds
.responseRequiredFlag(true)
.build();
DisplayParam displayParam = DisplayParam.newBuilder()
.addDisplayContent(displayContentParam)
.build();
RetailerManager.getInstance()
.provideDeviceService()
.newDisplayExchange(displayParam)
.startAsyncExchange(new Exchange.RetailerSDKCallback<DisplayResult>() {
@Override
public void onError(int code, String msg) {
Log.e(TAG, "failed: " + code + ", " + msg);
}
@Override
public void onResult(DisplayResult result) {
Log.i(TAG, "result: " + GsonUtils.toJson(result));
}
});using System;
using PayExplorerConnect;
public void HandleDisplayError(int code, string message)
{
Console.WriteLine($"Error: {code}, Message: {message}");
}
public void HandleDisplayResult(DisplayResult result)
{
Console.WriteLine($"Response: {result.Response}");
}
public string StartDisplay()
{
// Replace the sample cart data and display settings for your scenario.
string shoppingCartContent =
"{\"refId\":\"shoppingCart\",\"data\":{\"received\":\"$1.00\"," +
"\"discount\":\"$2.00\"," +
"\"change\":\"$0.00\"," +
"\"actualHarvest\":\"$1.00\"," +
"\"details\":[{\"number\":\"1\",\"name\":\"Strawberry Cheese Cake\",\"price\":\"$1.00\"," +
"\"qty\":\"1\"," +
"\"subTotal\":\"$1.00\"}," +
"{\"number\":\"2\",\"name\":\"Chocolate Mousse Cake\",\"price\":\"$1.00\"," +
"\"qty\":\"1\"," +
"\"subTotal\":\"$1.00\"}]}}";
ActionMessageParam content = new ActionMessageParam.Builder()
.Format(OutputFormatCode.SREF)
.MessageContent(shoppingCartContent)
.MessageDestination(ReceiptOutputTarget.MDSP) //Merchant display
.MinimumDisplayTime(15) // 15 seconds
.ResponseRequiredFlag(true)
.Build();
DisplayParam param = new DisplayParam.Builder()
.AddDisplayContent(content)
.Build();
string exchangeId = RetailerManager
.ProvideDeviceService()
.NewDisplayExchange(param)
.StartAsyncExchange(HandleDisplayResult, HandleDisplayError);
return exchangeId;
}#import <PayExplorerConnect/RetailerManager.h>
#import <PayExplorerConnect/DisplayParam+Builder.h>
ActionMessageParam *messageParam = [ActionMessageParam makeWithBuilder:^(ActionMessageParamBuilder *builder) {
builder.format(OutputFormatCodeSREF);
builder.informationQualifier(InformationQualifyCodeDISP);
builder.messageContent(@"{\"refId\":\"shoppingCart\",\"data\":{\"received\":\"$1.00\",\"discount\":\"$2.00\",\"change\":\"$0.00\",\"actualHarvest\":\"$1.00\",\"details\":[{\"number\":\"1\",\"name\":\"Strawberry Cheese Cake\",\"price\":\"$1.00\",\"qty\":\"1\",\"subTotal\":\"$1.00\"},{\"number\":\"2\",\"name\":\"Chocolate Mousse Cake\",\"price\":\"$1.00\",\"qty\":\"1\",\"subTotal\":\"$1.00\"}]}}");
builder.messageDestination(ReceiptOutputTargetMDSP);
builder.responseRequiredFlag(@"true");
}];
DisplayParam *params = [DisplayParam makeWithBuilder:^(DisplayParamBuilder *builder) {
builder.addDisplayContent(messageParam);
}];
[[RetailerManager sharedManager] display:params block:^(NSString *exchangeId) {
// Save the exchange ID to track this request.
} result:^(id result, NSInteger errcode, NSString *msg) {
if (errcode != 0 && result == nil) {
// Handle request error.
return;
}
DisplayResult *displayResult = (DisplayResult *)result;
// Handle display result.
}];The following examples use HTML to display supported XHTML content.
ActionMessageParam displayContentParam = ActionMessageParam.newBuilder()
.format(OutputFormat3Code.HTML)
.messageContent("<html><body><h1>Display test</h1></body></html>")
.messageDestination(UserInterface4Code.CDSP) //Cardholder display
.minimumDisplayTime(15L) // 15 seconds
.responseRequiredFlag(true)
.build();
DisplayParam displayParam = DisplayParam.newBuilder()
.addDisplayContent(displayContentParam)
.build();
RetailerManager.provideDeviceService()
.newDisplayExchange(displayParam)
.startAsyncExchange(new Exchange.RetailerSDKCallback<DisplayResult>() {
@Override
public void onError(int code, String msg) {
Log.e(TAG, "failed: " + code + ", " + msg);
}
@Override
public void onResult(DisplayResult result) {
Log.i(TAG, "result: " + GsonUtils.toJson(result));
}
});using System;
using PayExplorerConnect;
public void HandleDisplayError(int code, string message)
{
Console.WriteLine($"Error: {code}, Message: {message}");
}
public void HandleDisplayResult(DisplayResult result)
{
Console.WriteLine($"Response: {result.Response}");
}
public string StartDisplay()
{
// Replace the display content and settings for your target screen.
ActionMessageParam content = new ActionMessageParam.Builder()
.Format(OutputFormatCode.HTML)
.MessageContent("<html><body><h1>Display test</h1></body></html>")
.MessageDestination(ReceiptOutputTarget.CDSP) //Cardholder display
.MinimumDisplayTime(15) // 15 seconds
.ResponseRequiredFlag(true)
.Build();
DisplayParam param = new DisplayParam.Builder()
.AddDisplayContent(content)
.Build();
string exchangeId = RetailerManager
.ProvideDeviceService()
.NewDisplayExchange(param)
.StartAsyncExchange(HandleDisplayResult, HandleDisplayError);
return exchangeId;
}#import <PayExplorerConnect/RetailerManager.h>
#import <PayExplorerConnect/DisplayParam+Builder.h>
ActionMessageParam *displayContent = [ActionMessageParam makeWithBuilder:^(ActionMessageParamBuilder *builder) {
builder.format(OutputFormatCodeHTML);
builder.messageContent(@"<html><body><h1>Display test</h1></body></html>");
builder.messageDestination(ReceiptOutputTargetCDSP);
builder.minimumDisplayTime(15);
builder.responseRequiredFlag(@"true");
}];
DisplayParam *params = [DisplayParam makeWithBuilder:^(DisplayParamBuilder *builder) {
builder.addDisplayContent(displayContent);
}];
[[RetailerManager sharedManager] display:params block:^(NSString *exchangeId) {
// Save the exchange ID to track this request.
} result:^(id result, NSInteger errcode, NSString *msg) {
if (errcode != 0 && result == nil) {
// Handle request error.
return;
}
DisplayResult *displayResult = (DisplayResult *)result;
// Handle display result.
}];