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

@ -8,7 +8,7 @@
;world-class
OpenInst 1 "/mnt/sdcard/coffeevending/taobin_project/xml/page_blank.xml"
;Open "ROOT/taobin_project/xml/page_display_ExclusiveGift.xml"
@ -33,7 +33,7 @@
Var ServiceCharge = 0
Var AdultFlag = 0
Var AdultFlag = 0
If Only18 = "true" Then
DEBUGVAR AdultState1
@ -68,7 +68,7 @@
DEBUGVAR CustomerFilterType
EndIf
If NightTime = 1 Then
If NightTime = 1 Then
If SelectDrink = "12-99-03-0066" Then
Var PriceDrink = 60
EndIf
@ -110,10 +110,10 @@
Var QRCODE3 = "VDGN"
Var QRCODE4 = BoxID
Var QRCODE5 = SelectSlot
Var QRCODE6 = SelectDrink
Var QRCODE7 = PriceDrink
Var QRCODE6 = SelectDrink
Var QRCODE7 = PriceDrink
Var QRCODE8 = ""
Var CountStepPackPayment = 0
Var CountStepForCupFlagDelay = 0
@ -121,13 +121,13 @@
Var ReqPayInfoFromCashOther = 0
Var Seeker.PromotionIDCurrentOrder = 0
Var Seeker.TxRef1 = ""
Var Seeker.OrderChanel = "Normal"
Var Seeker.CurrCreditAmount = 0
Var Seeker.CurrCreditUse = 0
Var Seeker.CurrCreditTelNum = ""
@ -141,26 +141,26 @@
Var Seeker.IntVendingCampaign = 0
Var Seeker.FreeVendingCampaign = 0
Var Seeker.CodeChannel = 0
Var CoinVendingOnFlag = 0
Var CoinVendingOnFlag = 0
Var Seeker.CreditCard = 0
Var Seeker.CreditCardRef = ""
Var Seeker.UseCreditPayFullDrinkPrice = 0
Var Seeker.IntVendingCredit = 0
Var Seeker.StoreCreditFlag = 0
Var Seeker.pageStoreCredit0 = 0
Var Seeker.TNumberTaobinCredit = ""
Var Seeker.TNumberTaobinMember = ""
Var Seeker.CoffeePinNumber = ""
Var Seeker.VendingDiscount = 0
Var Seeker.VendingCampaign = 0
Var Seeker.VendingTSID = ""
Var Seeker.CreditNotEnoughRefID = ""
Var PayType = ""
Var CART_INDEX = 0
@ -169,7 +169,7 @@
Var LOADING_STATE = "Invisible"
Var QR_POPUP = "/img_popup2.png"
If show_eng = "true" Then
If show_eng = "true" Then
Var DirImage = "ROOT/taobin_project/image/page_payment_en/page_payment"
Var PlaySoundLag = "ROOT/taobin_project/sound_eng/How_would_you_like_to_pay.mp3"
Var PlaySoundCodeLang = "ROOT/taobin_project/sound_eng/Code8digit.mp3"
@ -178,24 +178,24 @@
Else
Var DirImage = "ROOT/taobin_project/image/page_payment"
Var PlaySoundLag = "ROOT/taobin_project/sound_thai/payment.mp3"
If FromJemilaPro = 1 Then
Var PlaySoundLag = "/mnt/sdcard/coffeevending/taobin_project/sound_thai/jemila/payment.m4a"
EndIf
; Play Sound #zone
If SoundBackToSchoolEnable = 1 Then
If SoundBackToSchoolType = 1 Then
If SoundBackToSchoolType = 1 Then
Var RootPathSoundBackToSchool = "/mnt/sdcard/coffeevending/taobin_project/sound_thai/boy/"
EndIf
If SoundBackToSchoolType = 2 Then
If SoundBackToSchoolType = 2 Then
Var RootPathSoundBackToSchool = "/mnt/sdcard/coffeevending/taobin_project/sound_thai/girl/"
EndIf
Var PlaySoundLag = RootPathSoundBackToSchool + "payment.wav"
EndIf
Var PlaySoundCodeLang = "ROOT/sounds/Code8digit.m4a"
EndIf
@ -203,7 +203,7 @@
SAVELOG MachineStage
If AdultFlag = 1 Then
If CameraCount = 1 Then
CameraSetting "usbfront" "default" "Rotate=90,Resolution=1280x720,scaleX=1.0,scaleY=1.0"
@ -222,7 +222,7 @@
EndIf
; Test
;Var MachineStage = "-"
@ -242,7 +242,7 @@
Var ServiceType = "coffee"
Var VendingCreditRemain = ""
DEBUGVAR Seeker.thankLidFlag
@ -275,7 +275,7 @@
EndIf
;
;
DEBUGVAR PromotionIDCurrentOrder
@ -306,23 +306,40 @@
DEBUGVAR TOPPING_PRICE
TRY "ROOT/taobin_project/xml/process/discount_from_promotion.ev"
DEBUGVAR PromotionIDCurrentOrder
Var CoundDownStillOnPage = 240
__CMD "CLEAR_TIME_BLINK_DISPLAY" 0 "-" "-"
Var WaitPOSStatus = 0
;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 "
Var 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
</EventOpen>
<Timeout> 900 </Timeout>
<EventTimeout>
<EventTimeout>
If stop_now = "true" Then
SAVELOG "stop_now is true page_payment"
@ -349,7 +366,7 @@
EndIf
EndIf
If CupChecking = "true" Then
If HaveCup = "true" Then
SAVELOG "Have cup"
@ -369,7 +386,7 @@
EndIf
If ReadyForBrew = "false" Then
Open "ROOT/taobin_project/xml/page_back_to_main.xml"
Var ReadyForBrew = "false"
@ -382,7 +399,7 @@
EndIf
EndIf
;If CupChecking = "false" Then
; Var CountStepPackPayment = CountStepPackPayment + 1
;EndIf
@ -395,96 +412,118 @@
DEBUGVAR ToppingDetailCurr
DEBUGVAR ToppingDetailNext
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
Var CoinAmount = 0
Else
If NOCashFlag = 0 Then
SAVELOG "CoinVending XBILL from page_payment"
CoinVending XBILL
Else
Var CoinAmount = 0
EndIf
EndIf
;Var CoinAmount = 0
Var Delay = 1
Else
Var Delay = 1
EndIf
If WaitPOSStatus = 1 Then
Var RemainAmount = 0
If TimeWaitPOSStatus < 10 Then
Var TimeWaitPOSStatus = TimeWaitPOSStatus + 1
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
Var CoinAmount = 0
Else
If NOCashFlag = 0 Then
SAVELOG "CoinVending XBILL from page_payment"
CoinVending XBILL
Else
Var CoinAmount = 0
EndIf
EndIf
;Var CoinAmount = 0
Var Delay = 1
Else
Var Delay = 1
EndIf
Var RemainAmount = 0
Var SessionID2 = SelectSlot + ":"
Var SessionID2 = SessionID2 + Seeker.ExtendData
Var SessionID2 = SelectSlot + ":"
Var SessionID2 = SessionID2 + Seeker.ExtendData
EndIf
EndIf
; Reset
Var MachineState_Result = 0
; Reset
Var MachineState_Result = 0
DEBUGVAR Seeker
DEBUGVAR Seeker.ExtendData
DEBUGVAR Seeker
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
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
TimerReset
Refresh
</EventTimeout>
</EventTimeout>
<Video>
@ -520,7 +559,7 @@
</Text>
<Text>
<State> StageShowAlias</State>
<State> StageShowAlias</State>
<X> 0 </X>
<Y> 1022 </Y>
<Width> 1080</Width>

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>