Here is the entire piece of code, when F7 is pressed, this imitates the Pay screen in the Point of Sale and adds a .0035 fee when the customer uses credit. The issue is, if the customer presses cacel on the Pax pinpad, the fee remains on the Invoice screen and say they want to use a different card? Then the clerk presses the CREDIT button again, now the customer has been charged the fee TWICE.
So this end code I am having issues with removes the .0035 service fee from the invoice...the code directly below works fine IF the customer cancels the payment on the credit card machine, but if the payment goes thru without invoking the 'Payment processor Error' part, my F7 key does not work again, like its not 'returning' to the top of the code, still waiting on the (winWait) part of the code to execute.
Code: Select all
; Service Fee - Credit
+F7::
SetTitleMatchMode, 3
; Customer presses Credit Debit button
; +F7;;
; Initiate Pay screen
Send, !p
; Copy contents from total amount in Pay Applet
Send, ^{Ins}
; Cancel back to Invoice Screen
Send, !n
; Send ItemNum into 'Scan Barcode Now...' - 1236
Send, 1236{Enter}
; THANK YOU
; Has tagalong 1234 SERVICE FEE .035
; Paste 0.035 in the Pay Applet in the Quantity
Send, 0.035
Send, !o
; Paste Amount from contents copied from the Pay Applet in the Price
Send, ^v
Send, !o
; Press OK on Enter Price Service Fee applet
; Initiate Credit Debit applet, directly
Send, !p
; WinActivate, Cash Register Express
Send, !r!r
Sleep, 1000
WinWait, Payment Processor Error
IfWinExist, Payment Processor Error
{
WinActivate, Payment Processor Error
Send, !o!n{Up}{Del}
Return
}
Else
Return
This is why I attempted to add this loop, but it never initiates...
Code: Select all
; Service Fee - Credit
+F7::
SetTitleMatchMode, 1
; Customer presses Credit Debit button
; Initiate Pay screen
Send, !p
; Copy contents from total amount in Pay Applet
Send, ^{Ins}
; Cancel back to Invoice Screen
Send, !n
; Send ItemNum into 'Scan Barcode Now...' - 1236
Send, 1236{Enter}
; THANK YOU
; Has tagalong 1234 SERVICE FEE .035
; Paste 0.035 in the Pay Applet in the Quantity
Send, 0.035
Send, !o
; Paste Amount from contents copied from the Pay Applet in the Price
Send, ^v
Send, !o
; Press OK on Enter Price Service Fee applet
; Initiate Credit Debit applet, directly
Send, !p
; WinActivate, Cash Register Express
Send, !r!r
loop
{
if WinExist("Payment Processor Error")
{
WinActivate, Payment Processor Error
Send, !o!n{Up}{Del}
break
}
else if WinExist("Cash Register Express")
{
WinActivate, Cash Register Express
break
}
sleep 100
}
return
I hope that gives the full scope of what I am attempting to accomplish and can now get some insight on fixing this.
Thanks again