Smartpoint Cloud Connector Events
Events include:
Example for subscribing to events
QUEUE_TERMINAL_ENTRY: Sends a message every time a terminal response is queued and the action '@orion/terminals-helper/QUEUE_TERMINAL_ENTRY' is triggered by the SPC SDK
Event received:
{
type: 'event';
operation: 'QUEUE_TERMINAL_ENTRY';
result: {
cryptic: 'SON/C30655';
}
}
RECEIVE_TERMINAL_RESPONSE: Sends an message every time a terminal response is retrieved and the action '@orion/terminals-helper/RECEIVE_TERMINAL_RESPONSE' is triggered by the SPC SDK
Event received:
{
success: true;
type: 'event';
operation: 'RECEIVE_TERMINAL_RESPONSE';
result: {
cryptic: 'SON/C30655';
}
}
REPLACE_CURRENT_TERMINAL_ID: Sends an message every time there is a replacement of the current terminal id';
Event received:
{
operation: "REPLACE_CURRENT_TERMINAL_ID",
operationType: "event",
result: {
terminalId: "99CD722B-D899-4C0C-838E-4193D037A93A",
windowNumber: 2
},
}
REQUEST_STOREFRONT_SEARCH: Sends an message every time there is a Storefront search';
Event received:
{
operation: "REQUEST_STOREFRONT_SEARCH",
operationType: "event",
result: {
request: {}
},
}
REQUEST_STOREFRONT_SEARCH_SUCCESS: Sends an message every time there is a successful Storefront search';
Event received:
{
operation: "REQUEST_STOREFRONT_SEARCH_SUCCESS",
operationType: "event",
result: {
request: { "request content" },
success: true
},
}
REQUEST_STOREFRONT_SEARCH_ERROR: Sends an message every time there is a failed Storeftont search';
Event received:
{
operation: "REQUEST_STOREFRONT_SEARCH_ERROR",
operationType: "event",
result: {
request: { "request content" },
success: false
},
}
RETRIEVE_PNR_SUCCESS: Sends an message every time the a PNR is retrieved and the action '@pos-web/plugin-pnr-retrieve-api-connection/RETRIEVE_PNR_SUCCESS';
Event received:
{
success: true;
type: 'event';
operation: 'RETRIEVE_PNR_SUCCESS';
result: {
recordLocator: 'A12345';
}
}
SIGN_ON_COMPLETED: Sends an message every time a sign on is completed on a host connection';
Event received:
{
success: true
type: "event"
operation: "SIGN_ON_COMPLETED"
result: {
hostConnectionId: "A12345",
response: "SIGN-ON COMPLETE/ABCDE/27MAR/PR - NOT AUTHORISED - GALILEO\n(C)1989-2019 TRAVELPORT. ALL RIGHTS RESERVED\nLAST SIGN-ON AT 0609 ON 27MAR19 FROM 4A2393 MADOU\nPLEASE ENTER YOUR BUSINESS EMAIL >STD/C123456/*EM·\n---------------------------------------------------------- \nAD 1 TEST SIGN-ON MESSAGE. THIS IS SCHEDULED \nIN DC AND MIGRATED OVER TO OPEN AD STREAM >SV1· \n---------------------------------------------------------- \nAD 2 TEST SIGN-ON MESSAGE. THIS IS SCHEDULED \nIN DC AND MIGRATED OVER TO OPEN AD STREAM >SV2· \n>"
}
}
SIGN_OFF_COMPLETED: Sends an message every time a sign off is completed on a host connection';
Event received:
{
success: true;
type: 'event';
operation: 'SIGN_OFF_COMPLETED';
result: {
hostConnectionId: 'A12345';
}
}
NEW_PCC: Sends an message every time there is a PCC emulation on a host connection';
Event received:
{
success: true
type: "event"
operation: "NEW_PCC"
result: {
hostConnectionId: "A12345",
pcc: "XB7"
}
}
SET_CONNECTION_CURRENT_AREA: Sends a message every time there is a workarea change on a host connection
Event received:
{
success: true;
type: 'event';
operation: 'SET_CONNECTION_CURRENT_AREA';
result: {
currentArea: 'A';
}
}
SEARCH_PROFILES: Sends a message every time a search profiles action is triggered
-
SEARCH_PROFILES_REQUEST
-
SEARCH_PROFILES_SUCCESS
-
SEARCH_PROFILES_ERROR
The result and the error wouldn't be shared with the webview.
Event received:
{
operation: string;
result: {
businessTitle: string | undefined;
pcc: string;
profileType: string;
travelerTitle: string | undefined;
}
success: boolean;
}
{
operation: 'SEARCH_PROFILES_REQUEST';
result: {
businessTitle: undefined;
pcc: 'XB7';
profileType: 'TRAVELER';
travelerTitle: 'Mr';
}
success: true;
}
{
operation: 'SEARCH_PROFILES_SUCCESS';
result: {
businessTitle: undefined;
pcc: 'XB7';
profileType: 'TRAVELER';
travelerTitle: 'Mr';
}
success: true;
}
{
operation: 'SEARCH_PROFILES_ERROR';
result: {
businessTitle: 'test';
pcc: 'XB7';
profileType: 'BUSINESS';
travelerTitle: undefined;
}
success: false;
}
MOVE_PROFILE_TO_PNR: Sends a message every time a move profiles action is triggered
-
MOVE_PROFILE_TO_PNR_REQUEST
-
MOVE_PROFILE_TO_PNR_SUCCESS
-
MOVE_PROFILE_TO_PNR_ERROR
The result and the error wouldn't be shared with the webview.
Event received:
{
operation: string;
result: {
profileId: string;
linesToMove: number[];
refreshPNR: boolean | undefined;
};
success: boolean;
}
{
operation: 'MOVE_PROFILE_TO_PNR_REQUEST';
result: {
profileId: 'profileId';
linesToMove: [];
}
success: true;
}
{
operation: 'MOVE_PROFILE_TO_PNR_SUCCESS';
result: {
profileId: 'profileId';
linesToMove: [];
refreshPNR: true;
}
success: true;
}
{
operation: 'MOVE_PROFILE_TO_PNR_ERROR';
result: {
profileId: 'profileId';
linesToMove: [];
}
success: false;
}
SUBMIT_CURRENT_PANEL: Sends a message every time a submit current panel action is triggered
Event received:
{
operation: 'SUBMIT_CURRENT_PANEL';
result: {
}
success: true;
}
SUBMIT_HOTEL_RETAIL_SEARCH_FORM: Sends a message every time a submit hotel retail search form action is triggered
Event received:
{
operation: 'SUBMIT_HOTEL_RETAIL_SEARCH_FORM';
result: {
}
success: true;
}
BOOK_AND_TICKET_FLIGHT_SELL: Sends a message every time a book and ticket flight sell action is triggered
Event received:
{
operation: 'BOOK_AND_TICKET_FLIGHT_SELL';
result: {
}
success: true;
}
BOOK_FLIGHT_SELL: Sends a message every time a book flight sell action is triggered
Event received:
{
operation: 'BOOK_FLIGHT_SELL';
result: {
}
success: true;
}
Example
/// <summary>
/// Subscribe to events
/// </summary>
private void SubscribeToEvents()
{
await webView.EnsureCoreWebView2Async(null);
webView.CoreWebView2.WebMessageReceived += CoreWebView2_WebMessageReceived;
}
/// <summary>
/// Receive message from webview
/// </summary>
/// <param name="sender">The webview</param>
/// <param name="e">The web message received event</param>
private async void CoreWebView2_WebMessageReceived(object? sender, CoreWebView2WebMessageReceivedEventArgs e)
{
dynamic message = JsonConvert.DeserializeObject(e.WebMessageAsJson);
// Message received:
// {
// success": true
// type: "event"
// operation: "@orion/terminals-helper/RECEIVE_TERMINAL_RESPONSE"
// result: {
// ""cryptic"": ""SON/C30655""
// }
// }
if (message.type == "event" && message.operation.Contains("RECEIVE_TERMINAL_RESPONSE"))
{
Console.WriteLine("Terminal command sent: " + message.result.cryptic);
}
}