Initial POS QR payment

This commit is contained in:
Kenta420 2024-09-26 14:52:51 +07:00
parent 6317a68847
commit b13556e425
2 changed files with 262 additions and 103 deletions

View file

@ -313,11 +313,28 @@
__CMD "CLEAR_TIME_BLINK_DISPLAY" 0 "-" "-" __CMD "CLEAR_TIME_BLINK_DISPLAY" 0 "-" "-"
Var WaitPOSStatus = 0
;new payment coffee-payment ;new payment coffee-payment
If New_Payment = 1 Then If New_Payment = 1 Then
SAVELOG "NEW-PAYMENT NEW-PAYMENT NEW-PAYMENT NEW-PAYMENT NEW-PAYMENT NEW-PAYMENT " SAVELOG "NEW-PAYMENT NEW-PAYMENT NEW-PAYMENT NEW-PAYMENT NEW-PAYMENT NEW-PAYMENT "
Var Seeker.ORDER_ID = "" Var Seeker.ORDER_ID = ""
GenHashWithTimeStamp Seeker.ORDER_ID GenHashWithTimeStamp Seeker.ORDER_ID
Var param1 = Seeker.ORDER_ID
Var param2 = Seeker.showname
STRCONTAIN "size" Seeker.showname SizeFromSheet
If SizeFromSheet = "true" Then
SPLIT Seeker.showname "###" 1 PureName
Var param2 = PureName
EndIf
Var WaitPOSStatus = 1
Var TimeWaitPOSStatus = 0
Var POS_SELL_STATUS = "-"
GetPOSStatus param1 param2
EndIf EndIf
</EventOpen> </EventOpen>
@ -397,88 +414,110 @@
DEBUGVAR ToppingDetailNext DEBUGVAR ToppingDetailNext
If CountStepPackPayment = CountStepForCupFlagDelay Then If WaitPOSStatus = 1 Then
If Seeker = "curr" Then
Var Seeker.ExtendData = ExtendDataCurr
Var Seeker.PayDetail2 = ToppingDetailCurr
Else
Var Seeker.ExtendData = ExtendDataNext
Var Seeker.PayDetail2 = ToppingDetailNext
EndIf
DEBUGVAR Seeker
DEBUGVAR Seeker.ExtendData
If GetPayInfoFlag = 0 Then If TimeWaitPOSStatus < 10 Then
SaveLog "RoadShow test" Var TimeWaitPOSStatus = TimeWaitPOSStatus + 1
If RoadShow = "false" Then
;CoinVending ON If POS_SELL_STATUS = "READY" Then
Var WaitPOSStatus = 0
EndIf
Else
If POS_SELL_STATUS = "READY" Then
Var WaitPOSStatus = 0
Else
Open "ROOT/taobin_project/xml/pos_fail.xml"
EndIf
EndIf
Else
If CountStepPackPayment = CountStepForCupFlagDelay Then
If Seeker = "curr" Then
Var Seeker.ExtendData = ExtendDataCurr
Var Seeker.PayDetail2 = ToppingDetailCurr
Else
Var Seeker.ExtendData = ExtendDataNext
Var Seeker.PayDetail2 = ToppingDetailNext
EndIf
DEBUGVAR Seeker
DEBUGVAR Seeker.ExtendData
If GetPayInfoFlag = 0 Then
SaveLog "RoadShow test"
If RoadShow = "false" Then
;CoinVending ON
If AdultFlag = 1 Then If AdultFlag = 1 Then
Var CoinAmount = 0 Var CoinAmount = 0
Else Else
If NOCashFlag = 0 Then If NOCashFlag = 0 Then
SAVELOG "CoinVending XBILL from page_payment" SAVELOG "CoinVending XBILL from page_payment"
CoinVending XBILL CoinVending XBILL
Else Else
Var CoinAmount = 0 Var CoinAmount = 0
EndIf EndIf
EndIf EndIf
;Var CoinAmount = 0 ;Var CoinAmount = 0
Var Delay = 1 Var Delay = 1
Else Else
Var Delay = 1 Var Delay = 1
EndIf EndIf
Var RemainAmount = 0 Var RemainAmount = 0
Var SessionID2 = SelectSlot + ":" Var SessionID2 = SelectSlot + ":"
Var SessionID2 = SessionID2 + Seeker.ExtendData Var SessionID2 = SessionID2 + Seeker.ExtendData
EndIf EndIf
; Reset ; Reset
Var MachineState_Result = 0 Var MachineState_Result = 0
DEBUGVAR Seeker DEBUGVAR Seeker
DEBUGVAR Seeker.ExtendData DEBUGVAR Seeker.ExtendData
Var CountStepPackPayment = 1 Var CountStepPackPayment = 1
EndIf
If Delay = 1 Then
Var DelayCount = DelayCount + 1
If DelayCount >= 2 Then
If web_readyOK = "true" Then
Var Seeker.OrderChanel = "WebApp"
Var Seeker.selected_a_drink = SelectDrink
Var Seeker.ServiceAmount2 = PriceDrink
Var PayAmount = PriceDrink
If web_payment = "CODE" Then
Open "ROOT/taobin_project/xml/page_payment_code.xml"
EndIf
If web_payment = "CREDIT" Then
Open "ROOT/taobin_project/xml/page_payment_credit.xml"
EndIf
EndIf
If Only18 = "true" Then
Var AdultFlag = 0
EndIf
Open "ROOT/taobin_project/xml/page_payment_cash.xml"
EndIf
EndIf
EndIf EndIf
If Delay = 1 Then
Var DelayCount = DelayCount + 1
If DelayCount >= 2 Then
If web_readyOK = "true" Then
Var Seeker.OrderChanel = "WebApp"
Var Seeker.selected_a_drink = SelectDrink
Var Seeker.ServiceAmount2 = PriceDrink
Var PayAmount = PriceDrink
If web_payment = "CODE" Then
Open "ROOT/taobin_project/xml/page_payment_code.xml"
EndIf
If web_payment = "CREDIT" Then
Open "ROOT/taobin_project/xml/page_payment_credit.xml"
EndIf
EndIf
If Only18 = "true" Then
Var AdultFlag = 0
EndIf
Open "ROOT/taobin_project/xml/page_payment_cash.xml"
EndIf
EndIf

120
xml/pos_fail.xml Normal file
View file

@ -0,0 +1,120 @@
<Page>
<X> 0 </X>
<Y> 608 </Y>
<Cache> "Enable" </Cache>
<Width> 1080 </Width>
<Height> 1312 </Height>
<Background> "0xEFEDEA" </Background>
<Volume> SoundVolume </Volume>
<EventOpen>
Var Timeout = 0
If show_eng = "true" Then
Var DirImage = "ROOT/taobin_project/image/user_take_cup_en/"
Var show_btp = "ROOT/taobin_project/image/bn_thai_lang_press.png"
Var show_btn = "ROOT/taobin_project/image/bn_thai_lang.png"
Else
Var DirImage = "ROOT/taobin_project/image/user_take_cup_th/"
Var show_btp = "ROOT/taobin_project/image/bn_eng_lang_press.png"
Var show_btn = "ROOT/taobin_project/image/bn_eng_lang.png"
EndIf
LED LedDoorDoor 5 255 255 255 255
;include=ROOT/taobin_project/inc/remove_cup_event_open.inc
</EventOpen>
<Timeout> 1000 </Timeout>
<EventTimeout>
;SAVELOG MachineErrorDetail
Var MachineErrorDetailAll = MachineErrorDetail + " / "
Var MachineErrorDetailAll = MachineErrorDetailAll + MachineErrorDetailEng
;DEBUGVAR HaveCup
;DEBUGVAR CupOnArm
;DEBUGVAR DoorCupPosition
;DEBUGVAR CupChecking
;DEBUGVAR CupArmMove
;DEBUGVAR buttonRemoveCup
; Add haveCup false for block display abnormal. Alternate between page_board.xml and this file.
If HaveCup = "false" Then
If MachineStage = "show-menu" Then
Open "ROOT/taobin_project/xml/page_board.xml"
EndIf
EndIf
If MachineStage = "close-maintenance" Then
Open "ROOT/taobin_project/xml/page_show_error.xml"
EndIf
;include=ROOT/taobin_project/inc/remove_cup_step.inc
Refresh
TimerReset
</EventTimeout>
<Image>
<X> 0 </X>
<Y> 852 </Y>
<Filename> Var(DirImage + "/img5.png") </Filename>
</Image>
<Button>
<X> 212 </X>
<Y> 1661 </Y>
<Filename> Var( DirImage + "/bn_door_open.png" ) </Filename>
<FilenamePress> Var( DirImage + "/bp_door_open.png" )</FilenamePress>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<State> buttonRemoveCup </State>
<EventClick>
Open "ROOT/taobin_project/xml/page_back_to_main.xml"
</EventClick>
</Button>
<Button>
<X> 990 </X>
<Y> 400 </Y>
<State> show_eng_button_stage </State>
<Filename> show_btn </Filename>
<FilenamePress> show_btp </FilenamePress>
<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>
<Volume> SoundVolume </Volume>
<EventClick>
; eng
If show_eng = "true" Then
Var show_eng = "false"
Else
Var show_eng = "true"
EndIf
Open CurrentXMLFileName2
</EventClick>
</Button>
<Text>
<X> 5 </X>
<Y> 1868 </Y>
<Size> 24 </Size>
<Align> Center </Align>
<Width> 1080 </Width>
<Font> RobotoRegular </Font>
<Color> 0xDE794E </Color>
<Value> MachineErrorDetailAll </Value>
</Text>
</Page>