Once a sale starts it output status in the same message
how would I pole the url? do I just have to call the same Function or can it be made to do that?
Code: Select all
Private Sub ShowSaleResults(RequestID As String, http As HttpClient)
FMain.Refresh
If http.Status < 0 Then
Global.addtoStatusList("SORRY A Error was detected")
global.AddToDebugList(http.ErrorText)
Else
' Success - read data
If Lof(http) Then Read #http, global.sBuffer, Lof(http)
Global.addtoStatusList(global.sBuffer)
Dim vNew As Variant = JSON.Decode(global.sBuffer, True)
global.AddToDebugList(global.sBuffer)
Select Case UCase(vNew["notifications"][0])
Case ""
ShowSaleResults(requestId, http)
Case "CARD_ERROR"
Global.addtoStatusList("Sorry a error has been detected with the customers card")
Case "PROCESSING_ERROR"
Global.ddtoStatusList("Sorry there has been a processing Error." & gb.CrLf & "Please check the PinPad Screen for further information")
Case "SIGNATURE_VERIFICATION"
If global.WaitingForPoS = 0 Then
Global.addtoStatusList("Requesting PoS User to confirm Card Signture")
global.WaitingForPoS = 1
'CreateSigntureSlip_FromPDQ(TerminalType, responseFromServer, IDNumber)
'SendToPoSterminal("Printdata_Signture|" & PoSSlipData)
'SendToPoSterminal("SigntureCheck")
ShowSaleResults(requestId, http)
End If
Case "TRANSACTION_FINISHED"
If Global.SigntureReq = 1 Then
LoadCardSlipData(RequestID)
'selectSlipToPrint(1, responseFromServer)
'SendToPoSterminal("Printdata_Recipit|" & PoSSlipData)
'SendToPoSterminal("TransactionCompleted|" & cardSchemeName & "|" & (amountTotal * 100))
Global.WaitingForPoS = 0
ShowSaleResults(requestId, http)
Else
If Global.WaitingForPoS = 0 Then
LoadCardSlipData(RequestID, requestId)
If UCase(Global.paymentMethod) = "KEYED" Then Global.SigntureNotNeeded = 1
Select Case Global.SigntureNotNeeded
Case 0 ' No Signutre needed
'selectSlipToPrint(0, responseFromServer) '
Select Case Global.PrintStoreSlip
Case "Yes"
'SendToPoSterminal("Printdata_Store|" & PoSSlipData)
Case "No"
'SendToPoSterminal("Storedata_Store|" & PoSSlipData & "|" & transactionNumber & "|" & IDNumber & "|" & transactionId)
End Select
Case 1 ' Signture needed
'CustomerNOTPresentCardSlip_FromPDQ(TerminalType, responseFromServer, IDNumberLocal)
'SendToPoSterminal("Printdata_Store|" & PoSSlipData)
ShowSaleResults(requestId, http)
End Select
Else
LoadCardSlipData(requestID)
'selectSlipToPrint(2, responseFromServer)
Select Case Global.PrintStoreSlip
Case "Yes"
'SendToPoSterminal("Printdata_Store|" & PoSSlipData)
Case "No"
'SendToPoSterminal("Storedata_Store|" & PoSSlipData & "|" & transactionNumber & "|" & IDNumber & "|" & transactionId)
End Select
LoadCardSlipData(Requestid)
'selectSlipToPrint(1, responseFromServer)
'SendToPoSterminal("Printdata_Recipit|" & PoSSlipData)
'SendToPoSterminal("TransactionCompleted|" & cardSchemeName & "|" & (amountTotal * 100))
ShowSaleResults(requestId, http)
End If
End If
Case "REMOVE_CARD"
'SendToPoSterminal("RemoveCard")
Global.addtoStatusList("Please ask customer to remove card") ''
ShowSaleResults(requestId, http)
Case "APPROVED"
'SendToPoSterminal("Approved")
Global.addtoStatusList("Transaction has been approved")
ShowSaleResults(requestId, http)
Case "CONNECTION_MADE"
'SendToPoSterminal("ConnectionMade")
Global.addtoStatusList("Connection Established to Payment Provider")
ShowSaleResults(requestId, http)
Case "CONNECTING"
'SendToPoSterminal("Connecting")
Global.addtoStatusList("Connecting to Payment Provider")
ShowSaleResults(requestId, http)
Case "PIN_ENTRY"
'SendToPoSterminal("EnterPIN")
Global.addtoStatusList("Waiting for customer to enter PIN")
ShowSaleResults(requestId, http)
Case "PLEASE_WAIT"
'SendToPoSterminal("PleaseWait")
Global.addtoStatusList("Please Wait...")
ShowSaleResults(requestId, http)
Case "PRESENT_CARD"
'SendToPoSterminal("InsertCard")
Global.addtoStatusList("Please insert card")
ShowSaleResults(requestId, http)
Case "INSERT_CARD"
'SendToPoSterminal("InsertCard")
Global.addtoStatusList("Card has been inserted")
ShowSaleResults(requestId, http)
Case "TRANSACTION_STARTED"
'Global.SigntureNotNeeded = 0
' Global.SigntureReq = 0
Global.addtoStatusList("Starting transacation One moment...")
ShowSaleResults(requestId, http)
End Select
End If
End