Hello,
I am developing a system to interact with an automated payment machine, and ned the execution of the app to wait for s given return status, but my loop cycle hangs the app.
I have a button in the interface that sets GloryStatus = 1 and the response for the machine sets GloryStatus = 0.
It should just update the TotalPament while GloryStatus = 2, why is it hanging the App.
I amd running the App in Ubuntu, by the way.
I am developing a system to interact with an automated payment machine, and ned the execution of the app to wait for s given return status, but my loop cycle hangs the app.
I have a button in the interface that sets GloryStatus = 1 and the response for the machine sets GloryStatus = 0.
It should just update the TotalPament while GloryStatus = 2, why is it hanging the App.
I amd running the App in Ubuntu, by the way.
B4X:
Sub ProcessPayment
CurrentPage=4
SetPages
GloryStatus = 2 ' em standBy
Talk2Glory("Pay" , TotalPayment)
lblValorPagar.text=NumberFormat2(TotalPayment,1,2,2,False) & " €"
Do While GloryStatus = 2
lblValorPagar.text=NumberFormat2(TotalPayment,1,2,2,False) & " €"
Loop
If GloryStatus = 1 Then
tituloMensagem.Text = "Pagamento Abortado"
lblMensagem.Text = "Por favor recolha o cartão e o seu dinheiro."
showMensagem
Talk2Reader("EjectCard")
Talk2Glory("CancelPay", Null)
CurrentPage = 1
SetPages
Else If GloryStatus = 0 Then
Talk2WinREST("SetPayment",Null)
Sleep(1000)
PaymentAmount = TotalPayment
Talk2WinREST("ProcessPayment",Null)
'volta ao ecran inicial
CurrentPage = 1
SetPages
End If
End Sub