From 98ef7b7b26c03eaa4cacc6e70b79478ae7f869b5 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Mon, 5 Jun 2023 18:04:34 +0200 Subject: [PATCH] Send cashInputFinished(), when cash input is finished --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 18 ++++++++++++++++++ src/ATBAPP/ATBDeviceControllerPlugin.h | 1 + 2 files changed, 19 insertions(+) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index d58559e..d604f99 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -75,6 +75,9 @@ void ATBDeviceControllerPlugin::requestStartCashInput(const QString & amount) void ATBDeviceControllerPlugin::requestStopCashInput() { hw->cash_stopPayment(); + + // we need new cash value in application... + QTimer::singleShot(500, this, SLOT(onCashPayStoped())); } void ATBDeviceControllerPlugin::cashCollect() @@ -322,6 +325,21 @@ void ATBDeviceControllerPlugin::onCashPayStopByTimeout() ""); } +void ATBDeviceControllerPlugin::onCashPayStoped() +{ + // DEBUG + qCritical() << "ATBDeviceControllerPlugin::onCashPayStoped()"; + + uint32_t amountInt = this->hw->getInsertedAmount(); + + QString amountString = QString::number(amountInt); + + emit this->cashInputFinished(nsDeviceControllerInterface::RESULT_STATE::SUCCESS, + amountString, + "", + ""); +} + bool ATBDeviceControllerPlugin::private_loadCashAgentLib(QString pluginName) { diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.h b/src/ATBAPP/ATBDeviceControllerPlugin.h index b8eba92..2278375 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.h +++ b/src/ATBAPP/ATBDeviceControllerPlugin.h @@ -127,6 +127,7 @@ private slots: // cash payment void onCashGotCoin(); + void onCashPayStoped(); void onCashPayStopByMax(); void onCashPayStopByEscrow(); void onCashPayStopByError();