Implemented EET batch send.

closes #275
This commit is contained in:
2017-02-23 22:50:01 +01:00
parent 954f655363
commit 402535c40c
13 changed files with 324 additions and 16 deletions
+14 -10
View File
@@ -324,22 +324,26 @@ void ShopForm::on_payButton_clicked()
ShopService srv;
srv.pay(m_voucher);
QString eetMsg;
bool eetRet = srv.processEet(m_voucher, eetMsg);
if (!eetRet)
if (srv.isEetEnabled())
{
QString errMsg = tr("EET communication error.\n");
bool eetRet = srv.processEet(m_voucher, eetMsg);
if (!eetMsg.isEmpty())
if (!eetRet)
{
errMsg += tr("Message from portal: ") + eetMsg + "\n";
}
QString errMsg = tr("EET communication error.\n");
errMsg += tr("Switch to offline?");
if (!eetMsg.isEmpty())
{
errMsg += tr("Message from portal: ") + eetMsg + "\n";
}
if (srv.isEetOnline() && QMessageBox::question(this, tr("EET error"), errMsg) == QMessageBox::Yes)
{
srv.setEetOnline(false);
errMsg += tr("Switch to offline?");
if (srv.isEetOnline() && QMessageBox::question(this, tr("EET error"), errMsg) == QMessageBox::Yes)
{
srv.setEetOnline(false);
}
}
}