SiteKiosk Documentation
One Step Back

ReceiptSettings Object




The ReceiptSettings Object provides configuration values for payment receipts.


Members Table

    The following table lists the members provided by the ReceiptSettings object.

    Members
    PropertiesDescription
    ConditionWhen the receipt should be send.
    IsEnabledWhether receipts are enabled.
    PrinterNameReceives the receipt printers name.
    TemplateTextReceives the template text with variables.
    TypeGets the receipt type.

Remarks
    None.
Examples
    The following example illustrates how to handle simple receipt printing and mailing.

    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    SiteCash = SiteKiosk.Plugins("SiteCash");
    
    ONINPAYMENT = 1;
    ONSESSIONEND = 2;
    
    PRINT = 1;
    SEND_EMAIL = 2;
    
    if (SiteCash.ReceiptSettings.IsEnabled)
    {
        switch (SiteCash.ReceiptSettings.Condition)
        {
            case ONINPAYMENT:
                SiteCash.OnInpayment = OfferReceipt;
                break;
            case ONSESSIONEND:
                SiteCash.OnSessionEnd = OfferReceipt;
                break;
        }
    }
    
    function OfferReceipt()
    {
        var text = SiteCash.Macromap.Expand(
            SiteCash.ReceiptSettings.TemplateText);
    
        switch (SiteCash.ReceiptSettings.Type)
        {
            case PRINT:
                if (confirm("Do you want to print a receipt?"))
                {
                    var printer = SiteKiosk.Printer.FindPrinter(
                        SiteCash.ReceiptSettings.PrinterName);
                    if (printer)
                    {
                        printer.PrintDocument("Arial", 80, text,
                            "", "", false);
                    }
                }
                break;
            case SEND_EMAIL:
                if (confirm("Do you want to send a email receipt?"))
                {
                    var email = SiteKiosk.Email.CreateJob(true);
                    email.PlainBody = text;
                    email.AddRecipient("someone@examle.com");
                    email.Send();
                }
                break;
        }
    }
    </SCRIPT>
    

Applies to
    SiteKiosk v7.2 (and later versions).

Back to topVolver arriba

© 1997-2011 PROVISIO - Aventura, EEUU - Muenster, Alemania
Sitekiosk.es - Grupo24®, Madrid, España -