The Payment Screen will show Payment Descriptions. We can capture a lot of information in Payment Descriptions using some fairly simple JScript.
This example shows 6 different Payment Types and their Descriptions.
When we print the Bill, all of this captured information is shown:
------------------------------------------------
GC201508221549307300: ($5.00) 100.00
2015-09-15 12:47:02.836 [Gift Certificate] (GC201508221549307300)
1111 1111-Celeste: ($2.50) 50.00
2015-09-15 12:47:22.280 [Customer Account] (1111 1111-Celeste)
Credit Card USD: ($5.00) 100.00
2015-09-15 12:47:30.908 [Credit Card USD] (VISA 1111)
Credit Card: ($2.50) 50.00
2015-09-15 12:47:46.681 [Credit Card] (MAST 3333)
Cash: ($1.00) 20.00
2015-09-15 12:48:03.955 [Cash]
Cash USD: ($5.00) 100.00
2015-09-15 12:48:14.019 [Cash USD]
================================================
GC201508221549307300 Balance: 200.00
************************************************
Set up a Payment Processor for Credit Card
Here we set up an Execute Script
Payment Processor for the Credit Card Payment Type.
Tickets > Payment Types > [Credit Card] > Payment Processors
The script we will fire is pay.UpdateDescription()
You can add the same
Payment Processor
to allPayment Types
to capture more information for them as well. The original screenshot at the top of this Tutorial has the samePayment Processor
assigned to everyPayment Type
.
Build the Script
Now we configure the Script.
Automation > Scripts
Name: PaymentFunctions
Handler: pay
function UpdateDescription() {
var dt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
var paymenttype = Data.Get("paymentTypeName");
var paymentinfo = dt + " [" + paymenttype + "]";
if (paymenttype=='Credit Card' || paymenttype=='Credit Card USD') {
var cctype = dlg.AskQuestion("Choose Credit Card type","Amex=AMEX,Master Card=MAST,Visa=VISA,Discover=DISC,Other=OTHR,CANCEL=CANCEL");
if (cctype=="CANCEL") {
Data.Set("canContinue",false);
dlg.ShowMessage("Payment Cancelled");
return 1;
}
var ccdigits = dlg.EditValue("Last 4 CC Digits;.{4};;ON","");
paymentinfo += " (" + cctype + " " + ccdigits + ")";
}
if (paymenttype=='Customer Account' || paymenttype=='Gift Certificate') {
var accountname = Data.Get("accountName");
paymentinfo += " (" + accountname + ")";
}
Data.Set("description", paymentinfo);
dlg.ShowMessage("Payment Processed\r"+paymentinfo);
return 0;
}
Printer Template
We use the {DESCRIPTION}
tag in the [PAYMENTS]
section of our Printer Template.
[PAYMENTS]
<J00>{PAYMENT NAME}: | {TENDERED}
[<L00>{DESCRIPTION}]