Syrve POS API SDK

Checkout Screen

Extending the functional of the cashbox screen

On the cash screen, it is possible to add buttons that can do operations using the object of the current order, and also change their state.

How does it look in Syrve POS?

For example, the «SamplePlugin: Show OK popup» button that is added by the SamplePlugin plugin from the SDK looks like this:

ButtonOnPaymentScreenView

Suppose a plugin displays a window with a message (check the article API dialogs).

ButtonOnPaymentScreenView_Click

Plugin can add a few buttons to the cash screen at once.

For example, two buttons were added by using the SamplePlugin SDK: «SamplePlugin: Show OK popup» and «SamplePlugin: Show input dialog».

ButtonsOnPaymentScreenView

It may happen that there is not enough space to add the buttons. Then in place of the buttons that doesn’t fit, the «ADDITIONAL» button will be placed.

AdditionalButtonOnPaymentScreen

If there is only one button, the «ADDITIONAL» button will not be displayed in any case.

Different plugins can add their buttons.

Pressing the «ADDITIONAL» button displays a list of all the buttons that did not fit.

ButtonsOnPaymentScreenViewPopup

How to add my extensions?

Step 1: Registration of the handler for the cash screen:
// Registering an action on the cash screen
subscription = PluginContext.Operations.AddButtonToPaymentScreen("SamplePlugin: Show ok popup", false, true, ShowOkPopupOnPaymentScreen);

The AddButtonToPaymentScreen() function takes 5 arguments to input:

The button press function takes an IOrder order object, an IViewManager instance to show windows, and the current state of the button - (Guid buttonId, string caption, bool isChecked, string iconGeometry) state.

Step 2: Description of the handler for the button to be added:
private void ShowOkPopupOnPaymentScreen((IOrder order, IOperationService os, IViewManager vm, (Guid buttonId, string caption, bool isChecked, string iconGeometry) state) info)
{ 
    info.vm.ShowOkPopup("Test window", "Message shown using SamplePlugin.");
}

Examples of realization can be found in the SDK SamplePlugin project in the ButtonsTester class.

How to update the button state?

It is possible to update the state of a previously added button at any time using the UpdatePaymentScreenButtonState() function, which takes 5 arguments as input:

To track changes on the cash screen, it is possible a subscribe to the PaymentScreenUpdated event. Event is called when adding, changing, deleting payment type, when changing payment sum, as well as when adding or deleting EInvoice. This event has 2 arguments: