Browse Source

refs #1 Syncronizing with release commit: d9b773c5b4

tags/3.13.0
parent
commit
a1aba3fda2
100 changed files with 1716 additions and 432 deletions
  1. +3
    -0
      3.0/filelist.txt
  2. +6
    -5
      3.0/scripts/build/runtimes/terminal_common.xml
  3. +0
    -10
      3.0/scripts/build/runtimes/terminal_ru.xml
  4. +21
    -1
      3.0/src/apps/PaymentProcessor/src/Services/CryptService.cpp
  5. +7
    -1
      3.0/src/apps/PaymentProcessor/src/Services/CryptService.h
  6. +4
    -2
      3.0/src/apps/PaymentProcessor/src/Services/GUIService.cpp
  7. +1
    -0
      3.0/src/apps/PaymentProcessor/src/Services/GUIService.h
  8. +5
    -4
      3.0/src/apps/PaymentProcessor/src/Services/HIDService.cpp
  9. +36
    -23
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp
  10. +0
    -5
      3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.h
  11. +2
    -1
      3.0/src/apps/PaymentProcessor/src/Services/PrintingService.cpp
  12. +3
    -2
      3.0/src/apps/PaymentProcessor/src/Services/SchedulerService.cpp
  13. +2
    -1
      3.0/src/apps/PaymentProcessor/src/Services/SettingsService.cpp
  14. +6
    -1
      3.0/src/apps/PaymentProcessor/src/Services/TerminalService.cpp
  15. +8
    -3
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_de.ts
  16. +8
    -3
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_en.ts
  17. +8
    -3
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_kk.ts
  18. +8
    -3
      3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_ru.ts
  19. +1
    -0
      3.0/src/apps/Updater/Updater.qbs
  20. +5
    -5
      3.0/src/apps/Updater/msvc/Updater.vcxproj
  21. +187
    -39
      3.0/src/apps/Updater/src/UpdaterApp.cpp
  22. +12
    -2
      3.0/src/apps/Updater/src/UpdaterApp.h
  23. +23
    -12
      3.0/src/apps/Updater/src/locale/updater_en.ts
  24. +23
    -12
      3.0/src/apps/Updater/src/locale/updater_kk.ts
  25. +23
    -12
      3.0/src/apps/Updater/src/locale/updater_ru.ts
  26. +1
    -1
      3.0/src/apps/Updater/src/main.cpp
  27. +1
    -2
      3.0/src/apps/WatchService/src/WatchService.cpp
  28. +498
    -0
      3.0/src/includes/Hardware/CardReaders/EMVTagData.h
  29. +1
    -1
      3.0/src/includes/Hardware/CardReaders/ProtoMifareReader.h
  30. +1
    -1
      3.0/src/includes/Hardware/CashAcceptors/ProtoCashAcceptor.h
  31. +11
    -10
      3.0/src/includes/Hardware/Common/BaseStatus.h
  32. +1
    -0
      3.0/src/includes/Hardware/Common/BaseStatusDescriptions.h
  33. +8
    -1
      3.0/src/includes/Hardware/Common/CommandResults.h
  34. +38
    -0
      3.0/src/includes/Hardware/Common/DataPointer.h
  35. +85
    -2
      3.0/src/includes/Hardware/Common/DeviceDataConstants.h
  36. +13
    -2
      3.0/src/includes/Hardware/Common/HardwareConstants.h
  37. +3
    -0
      3.0/src/includes/Hardware/Common/ProtoDevice.h
  38. +3
    -3
      3.0/src/includes/Hardware/Common/ProtoDevices.h
  39. +3
    -1
      3.0/src/includes/Hardware/Common/Specifications.h
  40. +4
    -4
      3.0/src/includes/Hardware/Common/USBDeviceModelData.h
  41. +1
    -1
      3.0/src/includes/Hardware/Dispensers/ProtoDispenser.h
  42. +33
    -10
      3.0/src/includes/Hardware/FR/FRBaseConstants.h
  43. +12
    -5
      3.0/src/includes/Hardware/FR/FRErrorDescription.h
  44. +10
    -6
      3.0/src/includes/Hardware/FR/FRStatusCodes.h
  45. +5
    -1
      3.0/src/includes/Hardware/FR/FRStatusesDescriptions.h
  46. +77
    -33
      3.0/src/includes/Hardware/FR/FiscalFieldDescriptions.h
  47. +1
    -1
      3.0/src/includes/Hardware/FR/ProtoFR.h
  48. +1
    -1
      3.0/src/includes/Hardware/HID/ProtoHID.h
  49. +79
    -0
      3.0/src/includes/Hardware/IOPorts/LibUSBDeviceDataTypes.h
  50. +3
    -0
      3.0/src/includes/Hardware/IOPorts/LibUSBPort.h
  51. +1
    -0
      3.0/src/includes/Hardware/IOPorts/LibUSBUtils.h
  52. +3
    -0
      3.0/src/includes/Hardware/IOPorts/USBPort.h
  53. +0
    -3
      3.0/src/includes/Hardware/IOPorts/USBSerialPort.h
  54. +0
    -4
      3.0/src/includes/Hardware/Plugins/DevicePluginBase.h
  55. +13
    -7
      3.0/src/includes/Hardware/Printers/POSPrinterData.h
  56. +3
    -1
      3.0/src/includes/Hardware/Protocols/Common/ProtocolNames.h
  57. +1
    -0
      3.0/src/includes/Hardware/Protocols/FR/AFPFR.h
  58. +1
    -0
      3.0/src/includes/Hardware/Protocols/FR/Atol2FR.h
  59. +1
    -0
      3.0/src/includes/Hardware/Protocols/FR/Atol3FR.h
  60. +0
    -1
      3.0/src/includes/Hardware/Protocols/FR/AtolFR.h
  61. +1
    -1
      3.0/src/includes/Hardware/Watchdogs/ProtoWatchdog.h
  62. +12
    -10
      3.0/src/includes/SDK/Drivers/FR/FiscalDataTypes.h
  63. +44
    -33
      3.0/src/includes/SDK/Drivers/FR/FiscalFields.h
  64. +2
    -0
      3.0/src/includes/SDK/Drivers/HardwareConstants.h
  65. +1
    -1
      3.0/src/includes/SDK/Drivers/ICardReader.h
  66. +1
    -1
      3.0/src/includes/SDK/Drivers/ICashAcceptor.h
  67. +1
    -1
      3.0/src/includes/SDK/Drivers/IDispenser.h
  68. +22
    -4
      3.0/src/includes/SDK/Drivers/IFiscalPrinter.h
  69. +1
    -1
      3.0/src/includes/SDK/Drivers/IHID.h
  70. +8
    -8
      3.0/src/includes/SDK/Drivers/IIOPort.h
  71. +1
    -1
      3.0/src/includes/SDK/Drivers/IModem.h
  72. +1
    -1
      3.0/src/includes/SDK/Drivers/IPrinter.h
  73. +1
    -1
      3.0/src/includes/SDK/Drivers/IWatchdog.h
  74. +1
    -0
      3.0/src/includes/SDK/Drivers/InteractionTypes.h
  75. +2
    -2
      3.0/src/includes/SDK/PaymentProcessor/Core/Encashment.h
  76. +17
    -1
      3.0/src/includes/SDK/PaymentProcessor/Core/ICryptService.h
  77. +18
    -11
      3.0/src/includes/SysUtils/ISysUtils.h
  78. +2
    -0
      3.0/src/interface/.gitignore
  79. +26
    -0
      3.0/src/interface/interface.qbs
  80. +7
    -1
      3.0/src/interface/modern/addinfo_scene.qml
  81. +2
    -0
      3.0/src/interface/modern/controls/input_field.qml
  82. +31
    -8
      3.0/src/interface/modern/info_content/terminal_info.qml
  83. +6
    -0
      3.0/src/interface/modern/info_popup2.ini
  84. +91
    -0
      3.0/src/interface/modern/info_popup2.qml
  85. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_de.ts
  86. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_en.ts
  87. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_kk.ts
  88. +1
    -1
      3.0/src/interface/modern/locale/addinfo_scene_ru.ts
  89. +2
    -2
      3.0/src/interface/modern/locale/edit_amount_scene_de.ts
  90. +2
    -2
      3.0/src/interface/modern/locale/edit_amount_scene_en.ts
  91. +2
    -2
      3.0/src/interface/modern/locale/edit_amount_scene_kk.ts
  92. +2
    -2
      3.0/src/interface/modern/locale/edit_amount_scene_ru.ts
  93. +7
    -7
      3.0/src/interface/modern/locale/main_menu_scene_de.ts
  94. +7
    -7
      3.0/src/interface/modern/locale/main_menu_scene_en.ts
  95. +7
    -7
      3.0/src/interface/modern/locale/main_menu_scene_ru.ts
  96. +7
    -7
      3.0/src/interface/modern/locale/payment_scenario_de.ts
  97. +7
    -7
      3.0/src/interface/modern/locale/payment_scenario_en.ts
  98. +7
    -7
      3.0/src/interface/modern/locale/payment_scenario_kk.ts
  99. +7
    -7
      3.0/src/interface/modern/locale/payment_scenario_ru.ts
  100. +38
    -33
      3.0/src/interface/modern/locale/result_scene_de.ts

+ 3
- 0
3.0/filelist.txt View File

@@ -40,6 +40,8 @@
/src/interface/modern/
/src/interface/plugins/
/src/interface/qmlcontrols/
/src/interface/.gitignore
/src/interface/interface.qbs
/src/modules/AdBackend/
/src/modules/Common/
/src/modules/Connection/
@@ -82,6 +84,7 @@
/src/plugins/Drivers/Watchdog/
/src/plugins/GraphicBackends/
/src/plugins/NativeScenarios/ScreenMaker/
/src/plugins/NativeScenarios/Migrator3000/
/src/plugins/NativeWidgets/ServiceMenu/
/src/plugins/Payments/Cyberplat/
/src/plugins/Plugins.sln


+ 6
- 5
3.0/scripts/build/runtimes/terminal_common.xml View File

@@ -12,9 +12,10 @@
<file source="{QBS_RESULT_PATH}/plugins/drivers/card_readers.dll" target="drivers/plugins/drivers/card_readers.dll"/>
<file source="{QBS_RESULT_PATH}/plugins/drivers/health.dll" target="drivers/plugins/drivers/health.dll"/>
<!-- Интерфейс 12", компонент interface -->
<!--
<directory source="src/interface/touch12/build" target="interface/interface/touch12" recursive="true"/>
<file source="{QBS_RESULT_PATH}/plugins/interface/utils.dll" target="interface/interface/touch12/plugins/utils.dll"/>
-->
<!-- Интерфейс modern, компонент interface_plugins -->
<file source="{QBS_RESULT_PATH}/plugins/interface/utils.dll" target="interface_plugins/interface/modern/plugins/utils.dll"/>
<!-- Выключение BITS -->
<option target="data/updater.ini" key="bits/ignore" value="true" />
</runtime>

+ 0
- 10
3.0/scripts/build/runtimes/terminal_ru.xml View File

@@ -8,7 +8,6 @@
<directory source="src/interface/modern/build" target="interface/interface/modern" recursive="true">
<exclude>*.wav</exclude>
</directory>
<file source="{QBS_RESULT_PATH}/plugins/interface/utils.dll" target="interface/interface/modern/plugins/utils.dll"/>
<!-- Звуки интерфейса modern -->
<directory source="src/interface/modern/build/sounds" target="sounds/interface/modern/sounds" recursive="true"/>
@@ -106,15 +105,6 @@

<!-- ###################################################################################### -->

<!-- Контент Самарского дистрибутива -->
<directory source="src/runtimes/ru/samara" target="" recursive="true"/>

<!-- Плагин сценария samaraticket, компонент plugins -->
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/samara_ticket.dll" target="_tclib/plugins/samara_ticket.dll"/>
<!-- Локализации плагинов -->
<file if="{CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/locale/samara_ticket_ru.qm" target="_tclib/plugins/samara_ticket_ru.qm"/>

<!-- Token plugin -->
<file if="{TC_USE_TOKEN} &amp;&amp; {CYBERPLAT_BUILD}" source="{QBS_RESULT_PATH}/plugins/drivers/token.dll" target="drivers/plugins/drivers/token.dll"/>



+ 21
- 1
3.0/src/apps/PaymentProcessor/src/Services/CryptService.cpp View File

@@ -322,7 +322,13 @@ bool CryptService::addKey(const PP::SKeySettings & aKey)
}

//---------------------------------------------------------------------------
int CryptService::generateKey(int aKeyId, const QString & aLogin, const QString & aPassword, const QString & aURL, QString & aSD, QString & aAP, QString & aOP)
QList<int> CryptService::getLoadedKeys() const
{
return mKeys.keys();
}

//---------------------------------------------------------------------------
int CryptService::generateKey(int aKeyId, const QString & aLogin, const QString & aPassword, const QString & aURL, QString & aSD, QString & aAP, QString & aOP, const QString & aDescription)
{
PP::INetworkService * networkService = mApplication->getCore()->getNetworkService();

@@ -342,6 +348,7 @@ int CryptService::generateKey(int aKeyId, const QString & aLogin, const QString
}

mKeyPair = keyPair;
mKeyPair.description = aDescription;

if ((result = registerKeyPair(getCryptEngine(), aKeyId, networkService->getNetworkTaskManager(), aURL, aLogin, aPassword, mKeyPair)) != EKeysUtilsError::Ok)
{
@@ -404,6 +411,18 @@ bool CryptService::replaceKeys(int aKeyIdSrc, int aKeyIdDst)
return result;
}

//---------------------------------------------------------------------------
SDK::PaymentProcessor::ICryptService::SKeyInfo CryptService::getKeyInfo(int aKeyId)
{
SDK::PaymentProcessor::SKeySettings key = getKey(aKeyId);
SDK::PaymentProcessor::ICryptService::SKeyInfo keyInfo;

keyInfo.sd = key.sd;
keyInfo.ap = key.ap;
keyInfo.op = key.op;

return keyInfo;
}

//---------------------------------------------------------------------------
bool CryptService::saveKey()
@@ -420,6 +439,7 @@ bool CryptService::saveKey()
key.op = mKeyPair.op;
key.sd = mKeyPair.sd;
key.engine = mKeyPair.engine;
key.description = mKeyPair.description;

QByteArray serverPublicKey = mKeyPair.serverPublicKey;



+ 7
- 1
3.0/src/apps/PaymentProcessor/src/Services/CryptService.h View File

@@ -51,7 +51,7 @@ public:
#pragma region SDK::PaymentProcessor::ICryptService interface

/// Сгенерировать и зарегистрировать ключ на сервере. Возвращает EKeysUtilsError::Enum.
virtual int generateKey(int aKeyId, const QString & aLogin, const QString & aPassword, const QString & aURL, QString & aSD, QString & aAP, QString & aOP);
virtual int generateKey(int aKeyId, const QString & aLogin, const QString & aPassword, const QString & aURL, QString & aSD, QString & aAP, QString & aOP, const QString & aDescription = QString());

/// Сохранить сгенерированный ключ.
virtual bool saveKey();
@@ -59,6 +59,12 @@ public:
/// Меняем ключи местами
virtual bool replaceKeys(int aKeyIdSrc, int aKeyIdDst);

/// Получить информацию о ключе по номеру пары
virtual SDK::PaymentProcessor::ICryptService::SKeyInfo getKeyInfo(int aKeyId);

/// Возвращает загруженные номера пар ключей
virtual QList<int> getLoadedKeys() const;

/// Возвращает интерфейс криптодвижка.
virtual ICryptEngine * getCryptEngine();



+ 4
- 2
3.0/src/apps/PaymentProcessor/src/Services/GUIService.cpp View File

@@ -127,7 +127,7 @@ bool GUIService::initialize()

auto parseIni = [&](const QString & aIniFile)
{
QSettings settings(aIniFile, QSettings::IniFormat);
QSettings settings(ISysUtils::rmBOM(aIniFile), QSettings::IniFormat);
settings.setIniCodec("UTF-8");

foreach (auto key, settings.allKeys())
@@ -513,7 +513,9 @@ void GUIService::onIntruderActivity()
break;
}

mEventManager->sendEvent(PPSDK::Event(event, CGUIService::LogName, message));
#ifndef _DEBUG
ILog::getInstance(CGUIService::IntruderLogName)->write(LogLevel::Warning, message);
#endif
}

//---------------------------------------------------------------------------


+ 1
- 0
3.0/src/apps/PaymentProcessor/src/Services/GUIService.h View File

@@ -27,6 +27,7 @@ class GuardService;
namespace CGUIService
{
const char LogName[] = "Interface";
const char IntruderLogName[] = "Penetration";
const char BackedObjectPrefix[] = "Backend$";
const char IdleScenarioName[] = "idle";
const int CheckTopmostWindowTimeout = 5 * 1000;


+ 5
- 4
3.0/src/apps/PaymentProcessor/src/Services/HIDService.cpp View File

@@ -83,10 +83,6 @@ void HIDService::updateHardwareConfiguration()

// Подписываемся на сигнал от устройства.
device->subscribe(SDK::Driver::IHID::DataSignal, this, SIGNAL(data(const QVariantMap &)));

// Включаем устройство на чтение
device->enable(true);

toLog(LogLevel::Normal, QString("Device '%1' added...").arg(device->getName()));
}
else
@@ -222,6 +218,11 @@ bool HIDService::setEnable(bool aEnable, const QString & aDevice)
}
}

toLog(LogLevel::Debug, QString("Update HID device state: name [%1], state [%2], result: [%3]")
.arg(aDevice)
.arg(aEnable ? "ENABLE" : "DISABLE")
.arg(result ? "OK" : "ERROR"));

return result;
}



+ 36
- 23
3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.cpp View File

@@ -54,7 +54,7 @@ QVariantMap toUpperCaseKeys(const QVariantMap & aParameters)
#endif

//---------------------------------------------------------------------------
SDK::Driver::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap & aParameters)
DSDK::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap & aParameters)
{
DSDK::TUnitDataList unitDataList;

@@ -95,18 +95,33 @@ SDK::Driver::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap &
}
}

if (!qFuzzyIsNull(fee))
bool combineFeeWithZeroVAT = aParameters.value("COMBINE_FEE_WITH_ZERO_VAT", false).toBool();
QString feeName = combineFeeWithZeroVAT ? tr("#dealer_bpa_fee") : tr("#dealer_fee");

if (dealerVAT == 0 && combineFeeWithZeroVAT)
{
QString dealerINN = aParameters.value(CPrintConstants::DealerInn).toString();
unitDataList << (dealerIsBank ?
DSDK::SUnitData(fee, dealerVAT, tr("#bank_fee"), dealerINN, DSDK::EPayOffSubjectTypes::Payment) :
DSDK::SUnitData(fee, dealerVAT, tr("#dealer_fee"), dealerINN, DSDK::EPayOffSubjectTypes::AgentFee));
fee = aParameters.value("FEE").toDouble();
if (!qFuzzyIsNull(fee))
{
QString dealerINN = aParameters.value(CPrintConstants::DealerInn).toString();
unitDataList << DSDK::SUnitData(fee, dealerVAT, feeName, dealerINN, DSDK::EPayOffSubjectTypes::AgentFee);
}
}

if (!qFuzzyIsNull(processingFee))
else
{
QString bankINN = aParameters.value(CPrintConstants::BankInn).toString();
unitDataList << DSDK::SUnitData(processingFee, 0, tr("#processing_fee"), bankINN, DSDK::EPayOffSubjectTypes::Payment);
if (!qFuzzyIsNull(fee))
{
QString dealerINN = aParameters.value(CPrintConstants::DealerInn).toString();
unitDataList << (dealerIsBank ?
DSDK::SUnitData(fee, dealerVAT, tr("#bank_fee"), dealerINN, DSDK::EPayOffSubjectTypes::Payment) :
DSDK::SUnitData(fee, dealerVAT, feeName, dealerINN, DSDK::EPayOffSubjectTypes::AgentFee));
}

if (!qFuzzyIsNull(processingFee))
{
QString bankINN = aParameters.value(CPrintConstants::BankInn).toString();
unitDataList << DSDK::SUnitData(processingFee, 0, tr("#processing_fee"), bankINN, DSDK::EPayOffSubjectTypes::Payment);
}
}

bool EMoney = aParameters.value(PPSDK::CPayment::Parameters::PayTool).toInt() > 0;
@@ -114,7 +129,7 @@ SDK::Driver::SPaymentData PrintFiscalCommand::getPaymentData(const QVariantMap &
auto taxSystem = aParameters.contains(CPrintConstants::DealerTaxSystem) ? static_cast<DSDK::ETaxSystems::Enum>(aParameters.value(CPrintConstants::DealerTaxSystem).toInt()) : DSDK::ETaxSystems::None;
auto agentFlag = aParameters.contains(CPrintConstants::DealerAgentFlag) ? static_cast<DSDK::EAgentFlags::Enum>(aParameters.value(CPrintConstants::DealerAgentFlag).toInt()) : DSDK::EAgentFlags::None;

DSDK::SPaymentData result(unitDataList, false, payType, taxSystem, agentFlag);
DSDK::SPaymentData result(unitDataList, DSDK::EPayOffTypes::Debit, payType, taxSystem, agentFlag);

result.fiscalParameters[CHardwareSDK::FR::UserPhone] = QString();
result.fiscalParameters[CHardwareSDK::FR::UserMail] = QString();
@@ -257,10 +272,10 @@ bool PrintPayment::print(DSDK::IPrinter * aPrinter, const QVariantMap & aParamet
else if (canFiscalPrint(aPrinter, false))
{
DSDK::SPaymentData paymentData = getPaymentData(actualParameters);
DSDK::IFiscalPrinter * fiscalPrinter = static_cast<DSDK::IFiscalPrinter *>(aPrinter);

mFiscalPaymentData.clear();
mPayOffSubjectData.clear();
result = static_cast<DSDK::IFiscalPrinter *>(aPrinter)->printFiscal(receipt, paymentData, mFiscalPaymentData, mPayOffSubjectData);
quint32 FDNumber = 0;
result = fiscalPrinter->printFiscal(receipt, paymentData, &FDNumber);

if (result)
{
@@ -269,11 +284,15 @@ bool PrintPayment::print(DSDK::IPrinter * aPrinter, const QVariantMap & aParamet
mFiscalFieldData = aPrinter->getDeviceConfiguration().value(CHardwareSDK::FR::FiscalFieldData).value<DSDK::TFiscalFieldData>();
}

addFiscalPaymentData(mFiscalPaymentData, receipt);
DSDK::TFiscalPaymentData fiscalPaymentData;
DSDK::TComplexFiscalPaymentData payOffSubjectData;
fiscalPrinter->checkFiscalFields(FDNumber, fiscalPaymentData, payOffSubjectData);

for (int i = 0; i < mPayOffSubjectData.size(); ++i)
addFiscalPaymentData(fiscalPaymentData, receipt);

for (int i = 0; i < payOffSubjectData.size(); ++i)
{
addFiscalPaymentData(mPayOffSubjectData[i], receipt);
addFiscalPaymentData(payOffSubjectData[i], receipt);
}
}
}
@@ -309,12 +328,6 @@ void PrintPayment::addFiscalPaymentData(const DSDK::TFiscalPaymentData & aFPData
}

//---------------------------------------------------------------------------
const DSDK::TFiscalPaymentData & PrintPayment::getFiscalData() const
{
return mFiscalPaymentData;
}

//---------------------------------------------------------------------------
bool PrintPayment::isFiscal(DSDK::IPrinter * aPrinter)
{
DSDK::IFiscalPrinter * fiscalPrinter = dynamic_cast<DSDK::IFiscalPrinter *>(aPrinter);


+ 0
- 5
3.0/src/apps/PaymentProcessor/src/Services/PrintingCommands.h View File

@@ -90,8 +90,6 @@ class PrintPayment : public PrintFiscalCommand
{
Q_DECLARE_TR_FUNCTIONS(PrintPayment)

SDK::Driver::TFiscalPaymentData mFiscalPaymentData;
SDK::Driver::TComplexFiscalPaymentData mPayOffSubjectData;
SDK::Driver::TFiscalFieldData mFiscalFieldData;

public:
@@ -104,9 +102,6 @@ public:
/// Печать.
virtual bool print(SDK::Driver::IPrinter * aPrinter, const QVariantMap & aParameters);

/// Получить выходные параметры, после печати фискального чека
const SDK::Driver::TFiscalPaymentData & getFiscalData() const;

private:
/// Добавить данные платежа.
void addFiscalPaymentData(const SDK::Driver::TFiscalPaymentData & aFPData, QStringList & aData);


+ 2
- 1
3.0/src/apps/PaymentProcessor/src/Services/PrintingService.cpp View File

@@ -1313,7 +1313,7 @@ void PrintingService::saveReceipt(const QVariantMap & aParameters, const QString
}

//---------------------------------------------------------------------------
QString & replaceTags(QString & aMessage)
QString replaceTags(QString aMessage)
{
aMessage.replace("[br]", "\n", Qt::CaseInsensitive);
aMessage.remove(QRegExp("\\[(b|dw|dh)\\]", Qt::CaseInsensitive));
@@ -1445,6 +1445,7 @@ void PrintingService::updateHardwareConfiguration()
QVariantMap dealerSettings;
if (mStaticParameters.contains(CPrintConstants::DealerTaxSystem)) dealerSettings.insert(CHardwareSDK::FR::DealerTaxSystem, mStaticParameters[CPrintConstants::DealerTaxSystem]);
if (mStaticParameters.contains(CPrintConstants::DealerAgentFlag)) dealerSettings.insert(CHardwareSDK::FR::DealerAgentFlag, mStaticParameters[CPrintConstants::DealerAgentFlag]);
if (mStaticParameters.contains(CPrintConstants::DealerVAT)) dealerSettings.insert(CHardwareSDK::FR::DealerVAT, mStaticParameters[CPrintConstants::DealerVAT]);

mPrinterDevices.append(device);



+ 3
- 2
3.0/src/apps/PaymentProcessor/src/Services/SchedulerService.cpp View File

@@ -12,6 +12,7 @@
#include <SDK/PaymentProcessor/Core/ISettingsService.h>

// Модули
#include <SysUtils/ISysUtils.h>
#include <System/IApplication.h>
#include <System/SettingsConstants.h>
#include <Services/ServiceNames.h>
@@ -99,8 +100,8 @@ SchedulerService::~SchedulerService()
//---------------------------------------------------------------------------
bool SchedulerService::initialize()
{
QSettings settings(IApplication::toAbsolutePath(IApplication::getWorkingDirectory() + CScheduler::ConfigName), QSettings::IniFormat);
QSettings userSettings(IApplication::toAbsolutePath(IApplication::getWorkingDirectory() + CScheduler::UserConfigName), QSettings::IniFormat);
QSettings settings(ISysUtils::rmBOM(IApplication::toAbsolutePath(IApplication::getWorkingDirectory() + CScheduler::ConfigName)), QSettings::IniFormat);
QSettings userSettings(ISysUtils::rmBOM(IApplication::toAbsolutePath(IApplication::getWorkingDirectory() + CScheduler::UserConfigName)), QSettings::IniFormat);

foreach (QString taskName, settings.childGroups())
{


+ 2
- 1
3.0/src/apps/PaymentProcessor/src/Services/SettingsService.cpp View File

@@ -15,6 +15,7 @@
#include <SDK/PaymentProcessor/Settings/ExtensionsSettings.h>

// Modules
#include <SysUtils/ISysUtils.h>
#include <SettingsManager/SettingsManager.h>

// Project
@@ -56,7 +57,7 @@ bool SettingsService::initialize()
// Регистрируем все конфиги.
QList<SSettingsSource> settingsSources;
settingsSources
<< SSettingsSource(mApplication->getWorkingDirectory() + "/data/system.ini", AdapterNames::TerminalAdapter, true)
<< SSettingsSource(ISysUtils::rmBOM(mApplication->getWorkingDirectory() + "/data/system.ini"), AdapterNames::TerminalAdapter, true)
<< SSettingsSource("terminal.ini", AdapterNames::TerminalAdapter, false)
<< SSettingsSource("keys.xml", AdapterNames::TerminalAdapter, false)
<< SSettingsSource("config.xml", AdapterNames::TerminalAdapter, true)


+ 6
- 1
3.0/src/apps/PaymentProcessor/src/Services/TerminalService.cpp View File

@@ -4,6 +4,7 @@
#include <Common/QtHeadersBegin.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QTimer>
#include <QtCore/QSet>
#include <QtCore/QDateTime>
#include <Common/QtHeadersEnd.h>

@@ -595,10 +596,13 @@ void TerminalService::checkConfigsIntegrity()
//---------------------------------------------------------------------------
void TerminalService::sendFeedback(const QString & aSenderSubsystem, const QString & aMessage)
{
// Отбрасываем дубли сообщений
static QSet<QString> sentMessages;

QString url = static_cast<PPSDK::TerminalSettings *>(mApplication->getCore()
->getSettingsService()->getAdapter(PPSDK::CAdapterNames::TerminalAdapter))->getFeedbackURL();

if (!url.isEmpty())
if (!url.isEmpty() && !sentMessages.contains(aMessage))
{
QByteArray sendBody;

@@ -662,6 +666,7 @@ void TerminalService::sendFeedback(const QString & aSenderSubsystem, const QStri
task->getDataStream()->write(sendBody);

mApplication->getCore()->getNetworkService()->getNetworkTaskManager()->addTask(task);
sentMessages.insert(aMessage);
}
}



+ 8
- 3
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_de.ts View File

@@ -20,17 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="102"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_bpa_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="103"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="109"/>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


+ 8
- 3
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_en.ts View File

@@ -20,17 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="102"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_bpa_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="103"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="109"/>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


+ 8
- 3
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_kk.ts View File

@@ -20,17 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="102"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_bpa_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<source>#bank_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="103"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="109"/>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<source>#processing_fee</source>
<translation type="unfinished"></translation>
</message>


+ 8
- 3
3.0/src/apps/PaymentProcessor/src/locale/paymentprocessor_ru.ts View File

@@ -20,17 +20,22 @@
<context>
<name>PrintFiscalCommand</name>
<message>
<location filename="../Services/PrintingCommands.cpp" line="102"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_bpa_fee</source>
<translation>Комиссия БПА</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="116"/>
<source>#bank_fee</source>
<translation>Комиссия БПА</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="103"/>
<location filename="../Services/PrintingCommands.cpp" line="99"/>
<source>#dealer_fee</source>
<translation>Комиссия субагента</translation>
</message>
<message>
<location filename="../Services/PrintingCommands.cpp" line="109"/>
<location filename="../Services/PrintingCommands.cpp" line="123"/>
<source>#processing_fee</source>
<translation>Комиссия КБ Платина</translation>
</message>


+ 1
- 0
3.0/src/apps/Updater/Updater.qbs View File

@@ -16,6 +16,7 @@ Project {
Depends { name: "UpdateEngine" }
Depends { name: "Packer" }
Depends { name: "qBreakpad" }
Depends { name: "TaskScheduler" }

Depends { name: "UpdaterTranslations" }



+ 5
- 5
3.0/src/apps/Updater/msvc/Updater.vcxproj View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@@ -170,7 +170,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<AdditionalIncludeDirectories>$(QTDIR)\include;.\GeneratedFiles\$(ProjectName);.\GeneratedFiles\$(ProjectName)\$(Configuration);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR)\boost;$(THIRDPARTY_DIR)\QtSolutions;$(THIRDPARTY_DIR)\qBreakpad\handler;..\src;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;..\..\PaymentProcessor\src\System;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(QTDIR)\include;.\GeneratedFiles\$(ProjectName);.\GeneratedFiles\$(ProjectName)\$(Configuration);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR)\boost;$(THIRDPARTY_DIR)\QtSolutions;$(THIRDPARTY_DIR)\TaskSchedulerPhishMe;$(THIRDPARTY_DIR)\qBreakpad\handler;..\src;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;..\..\PaymentProcessor\src\System;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_DLL;QT_GUI_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
@@ -185,7 +185,7 @@
<ResourceOutputFileName>$(IntDir)%(Filename).res</ResourceOutputFileName>
</ResourceCompile>
<Link>
<AdditionalDependencies>qtmain.lib;NetworkTaskManager.lib;QtNetwork4.lib;QtCore4.lib;QtGui4.lib;QtXml4.lib;Log.lib;UpdateEngine.lib;WatchServiceClient.lib;MessageQueue.lib;Application.lib;DebugUtils.lib;SysUtils.lib;Packer.lib;QtSingleApplication.lib;qt5port.lib;qBreakpad.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>qtmain.lib;NetworkTaskManager.lib;QtNetwork4.lib;QtCore4.lib;QtGui4.lib;QtXml4.lib;Log.lib;UpdateEngine.lib;WatchServiceClient.lib;MessageQueue.lib;Application.lib;DebugUtils.lib;SysUtils.lib;Packer.lib;QtSingleApplication.lib;qt5port.lib;qBreakpad.lib;TaskScheduler.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(THIRDPARTY_BIN_DIR);$(TC_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
@@ -243,7 +243,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(QTDIR)\include;.\GeneratedFiles\$(ProjectName);.\GeneratedFiles\$(ProjectName)\$(Configuration);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR)\boost;$(THIRDPARTY_DIR)\QtSolutions;$(THIRDPARTY_DIR)\qBreakpad\handler;..\src;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;..\..\PaymentProcessor\src\System;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(QTDIR)\include;.\GeneratedFiles\$(ProjectName);.\GeneratedFiles\$(ProjectName)\$(Configuration);$(TC_INCLUDE_DIR);$(THIRDPARTY_DIR)\boost;$(THIRDPARTY_DIR)\QtSolutions;$(THIRDPARTY_DIR)\TaskSchedulerPhishMe;$(THIRDPARTY_DIR)\qBreakpad\handler;..\src;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;..\..\PaymentProcessor\src\System;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0502;_WIN32_WINNT=0x0502;UNICODE;WIN32;QT_THREAD_SUPPORT;QT_CORE_LIB;QT_DLL;QT_GUI_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
@@ -256,7 +256,7 @@
<ResourceOutputFileName>$(IntDir)%(Filename).res</ResourceOutputFileName>
</ResourceCompile>
<Link>
<AdditionalDependencies>qtmaind.lib;NetworkTaskManagerd.lib;QtNetworkd4.lib;QtCored4.lib;QtGuid4.lib;Logd.lib;QtXmld4.lib;Applicationd.lib;UpdateEngined.lib;WatchServiceClientd.lib;MessageQueued.lib;DebugUtilsd.lib;SysUtilsd.lib;Packerd.lib;QtSingleApplicationd.lib;qt5portd.lib;qBreakpadd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>qtmaind.lib;NetworkTaskManagerd.lib;QtNetworkd4.lib;QtCored4.lib;QtGuid4.lib;Logd.lib;QtXmld4.lib;Applicationd.lib;UpdateEngined.lib;WatchServiceClientd.lib;MessageQueued.lib;DebugUtilsd.lib;SysUtilsd.lib;Packerd.lib;QtSingleApplicationd.lib;qt5portd.lib;qBreakpadd.lib;TaskSchedulerd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(THIRDPARTY_BIN_DIR);$(TC_LIB_DIR);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>


+ 187
- 39
3.0/src/apps/Updater/src/UpdaterApp.cpp View File

@@ -18,6 +18,7 @@
#include <Common/Version.h>
#include <SysUtils/ISysUtils.h>
#include <WatchServiceClient/Constants.h>
#include <PhishMeWrapper.h>

// Project
#include "UpdaterApp.h"
@@ -41,6 +42,7 @@ namespace Opt
const char NoRestart[] = "no-restart";
const char DestinationSubdirs[] = "destination-subdir";
const char AcceptKeys[] = "accept-keys";
const char WithoutBITS[] = "no-bits";
}

namespace Command
@@ -49,6 +51,7 @@ namespace Command
const char UserPack[] = "userpack";
const char Update[] = "update";
const char Integrity[] = "integrity";
const char Bits[] = "bits";
}

//---------------------------------------------------------------------------
@@ -72,13 +75,14 @@ UpdaterApp::~UpdaterApp()
SDK::PaymentProcessor::IRemoteService::EStatus status;

// Обновляем отчет.
switch (mResultCode)
switch (mResultCode_)
{
case CUpdaterApp::ExitCode::NoError:
status = SDK::PaymentProcessor::IRemoteService::OK;
break;

case CUpdaterApp::ExitCode::ContunueExecution:
case CUpdaterApp::ExitCode::WorkInProgress:
status = SDK::PaymentProcessor::IRemoteService::Executing;
break;

@@ -86,24 +90,7 @@ UpdaterApp::~UpdaterApp()
status = SDK::PaymentProcessor::IRemoteService::Error;
}

QMap<int, QString> descriptions;

descriptions.insert(CUpdaterApp::ExitCode::ErrorRunFromTempDir, tr("#error_run_from_temp_dir"));
descriptions.insert(CUpdaterApp::ExitCode::NoWatchService, tr("#error_connection_to_guard"));
descriptions.insert(CUpdaterApp::ExitCode::UnknownCommand, tr("#error_unknown_command"));
descriptions.insert(CUpdaterApp::ExitCode::SecondInstance, tr("#error_second_instance"));
descriptions.insert(CUpdaterApp::ExitCode::UnknownError, tr("#error_unknown"));
descriptions.insert(CUpdaterApp::ExitCode::NetworkError, tr("#error_network"));
descriptions.insert(CUpdaterApp::ExitCode::ParseError, tr("#error_parse_response"));
descriptions.insert(CUpdaterApp::ExitCode::DeployError, tr("#error_deploy"));
descriptions.insert(CUpdaterApp::ExitCode::Aborted, tr("#error_aborted"));
descriptions.insert(CUpdaterApp::ExitCode::Blocked, tr("#error_update_blocked"));
descriptions.insert(CUpdaterApp::ExitCode::FailIntegrity, tr("#error_check_integrity"));

if (descriptions.contains(mResultCode))
{
mReportBuilder.setStatusDescription(descriptions.value(mResultCode));
}
mReportBuilder.setStatusDescription(mResultDescription);
mReportBuilder.setStatus(status);
}

@@ -125,7 +112,7 @@ void UpdaterApp::onCloseCommandReceived()
{
getLog()->write(LogLevel::Normal, "Receive close signal from watch service. Update aborted.");

mResultCode = CUpdaterApp::ExitCode::Aborted;
setResultCode(CUpdaterApp::ExitCode::Aborted);

errorExit();
}
@@ -219,6 +206,10 @@ void UpdaterApp::run()
bool woRestart = getArgument(Opt::NoRestart).compare("true", Qt::CaseInsensitive) == 0;
// подпапка, в которую распаковываем архив
QString subdir = getArgument(Opt::DestinationSubdirs);
bool woBITS = getArgument(Opt::WithoutBITS).compare("true", Qt::CaseInsensitive) == 0;

// Отключение BITS через updater.ini
woBITS = settings.value("bits/ignore", woBITS).toBool();

// Создаем файл с отчетом.
mReportBuilder.open(cmndId, server, md5);
@@ -226,10 +217,28 @@ void UpdaterApp::run()

// Проверка на запуск второй копии программы.
QtLocalPeer * peer = new QtLocalPeer(this, getName());

if (command == Command::Bits)
{
mUpdater = new Updater(this);
mUpdater->setWorkingDir(workingDir);
CUpdaterApp::ExitCode::Enum result = bitsCheckStatus(peer->isClient());
if (result == CUpdaterApp::ExitCode::ContunueExecution)
{
setResultCode(CUpdaterApp::ExitCode::NoError, tr("Update in progress"));
}
else
{
setResultCode(result);
}
return;
}

// Проверка на запуск второй копии программы.
if (peer->isClient())
{
getLog()->write(LogLevel::Warning, "Another instance is already running.");
mResultCode = CUpdaterApp::ExitCode::SecondInstance;
setResultCode(CUpdaterApp::ExitCode::SecondInstance);
return;
}

@@ -237,8 +246,10 @@ void UpdaterApp::run()
if (!mWatchServiceClient->start())
{
getLog()->write(LogLevel::Error, "Cannot connect to watch service.");
mResultCode = CUpdaterApp::ExitCode::NoWatchService;
setResultCode(CUpdaterApp::ExitCode::NoWatchService);
#ifndef _DEBUG
return;
#endif
}

QTimer * tooLongDownloadTimer = new QTimer(this);
@@ -250,6 +261,7 @@ void UpdaterApp::run()
mUpdater->setParent(this);
mUpdater->setProxy(proxy);
mUpdater->setAcceptedKeys(acceptKeys);
mUpdater->useBITS(!woBITS, settings.value("bits/priority", CBITS::HIGH).toInt());
connect(mUpdater, SIGNAL(progress(int)), &mReportBuilder, SLOT(setProgress(int)));

// Создаем файл отчета.
@@ -283,13 +295,13 @@ void UpdaterApp::run()
if (reRunFromTempDirectory())
{
getLog()->write(LogLevel::Normal, QString("Run updater from temp path: '%1' is OK.").arg(getUpdaterTempDir()));
mResultCode = CUpdaterApp::ExitCode::ContunueExecution;
setResultCode(CUpdaterApp::ExitCode::ContunueExecution);
return;
}
else
{
getLog()->write(LogLevel::Error, QString("Failed run updater from temp path: '%1'.").arg(getUpdaterTempDir()));
mResultCode = CUpdaterApp::ExitCode::ErrorRunFromTempDir;
setResultCode(CUpdaterApp::ExitCode::ErrorRunFromTempDir);
return;
}
}
@@ -330,16 +342,16 @@ void UpdaterApp::run()
if (result < 0)
{
mResultCode = CUpdaterApp::ExitCode::UnknownCommand;
setResultCode(CUpdaterApp::ExitCode::UnknownCommand);
}
else if (result > 0)
{
mResultCode = CUpdaterApp::ExitCode::FailIntegrity;
setResultCode(CUpdaterApp::ExitCode::FailIntegrity);
mReportBuilder.setStatusDescription(tr("#error_check_integrity").arg(result));
}
else
{
mResultCode = CUpdaterApp::ExitCode::NoError;
setResultCode(CUpdaterApp::ExitCode::NoError);
}

return;
@@ -347,11 +359,93 @@ void UpdaterApp::run()
else
{
getLog()->write(LogLevel::Error, QString("Unknown command: %1.").arg(command));
mResultCode = CUpdaterApp::ExitCode::UnknownCommand;
setResultCode(CUpdaterApp::ExitCode::UnknownCommand);
return;
}

mResultCode = exec();
int result = exec();
if (result != mResultCode_)
{
setResultCode(static_cast<CUpdaterApp::ExitCode::Enum>(result));
}
}

//---------------------------------------------------------------------------
CUpdaterApp::ExitCode::Enum UpdaterApp::bitsCheckStatus(bool aAlreadyRunning)
{
getLog()->write(LogLevel::Normal, QString("Check bits status '%1'...").arg(qApp->applicationFilePath()));

QStringList parameters;

if (!mUpdater->bitsLoadState(&parameters))
{
getLog()->write(LogLevel::Error, QString("Failed load bits.ini."));
return CUpdaterApp::ExitCode::ParseError;
}

if (mUpdater->bitsIsComplete())
{
getLog()->write(LogLevel::Normal, QString("BITS jobs are complete. Restart for deploy."));

if (!aAlreadyRunning)
{
int stub = 0;
mUpdater->bitsCompleteAllJobs(stub, stub, stub);

// Restart for deploy
if (!QProcess::startDetached(qApp->applicationFilePath(), parameters))
{
getLog()->write(LogLevel::Fatal, QString("Couldn't start updater from '%1'.").arg(qApp->applicationFilePath()));
return CUpdaterApp::ExitCode::UnknownError;
}
}
else
{
QString commanLine = QDir::toNativeSeparators(qApp->applicationFilePath());
QString arguments = QString("--command bits --workdir %1").arg(mUpdater->getWorkingDir());
QString workDir = QDir::toNativeSeparators(mUpdater->getWorkingDir());

try
{
// Shedule restart myself
PhishMe::AddScheduledTask(L"TC_Updater",
commanLine.toStdWString(),
arguments.toStdWString(),
workDir.toStdWString(),
CUpdaterApp::BITSCompleteTimeout);

getLog()->write(LogLevel::Normal, QString("Do create updater restart scheduler task OK. Timeout: %1 min.").arg(CUpdaterApp::BITSCompleteTimeout / 60));
}
catch (std::exception & ex)
{
// Something seriously went wrong inside ScheduleTask
getLog()->write(LogLevel::Fatal, QString("Didn't create updater restart scheduler task '%1'. Reason: %2.")
.arg(commanLine).arg(QString::fromLocal8Bit(ex.what())));

return CUpdaterApp::ExitCode::UnknownError;
}
}

return CUpdaterApp::ExitCode::NoError;
}

if (mUpdater->bitsIsError())
{
getLog()->write(LogLevel::Error, QString("BITS jobs are failed. Restart for download w/o bits."));

// Restart for download w/o bits
parameters << "--no-bits" << "true";

if (!QProcess::startDetached(qApp->applicationFilePath(), parameters))
{
getLog()->write(LogLevel::Fatal, QString("Couldn't start updater from '%1'.").arg(qApp->applicationFilePath()));
}

return CUpdaterApp::ExitCode::NetworkError;
}
getLog()->write(LogLevel::Normal, QString("BITS contunue execution."));
return CUpdaterApp::ExitCode::ContunueExecution;
}

//---------------------------------------------------------------------------
@@ -490,13 +584,18 @@ void UpdaterApp::onUpdateComplete(CUpdaterErrors::Enum aError)
//---------------------------------------------------------------------------
void UpdaterApp::errorExit()
{
getQtApplication().exit(mResultCode ? mResultCode : CUpdaterApp::ExitCode::UnknownError);
if (!mResultCode_)
{
mResultCode_ = CUpdaterApp::ExitCode::UnknownError;
}

getQtApplication().exit(mResultCode_);
}

//---------------------------------------------------------------------------
int UpdaterApp::getResultCode() const
{
return mResultCode;
return mResultCode_;
}

//---------------------------------------------------------------------------
@@ -528,7 +627,7 @@ void UpdaterApp::delayedExit(int aTimeout, CUpdaterErrors::Enum aError)
getLog()->write(aError ? LogLevel::Error : LogLevel::Normal, QString("Closing after %1 seconds.").arg(aTimeout));

if (aError)
if (mResultCode_)
{
QTimer::singleShot(aTimeout * 1000, this, SLOT(errorExit()));
}
@@ -569,7 +668,7 @@ bool UpdaterApp::reRunFromTempDirectory()

{
QString programSettingsFile = QDir(getUpdaterTempDir()).absoluteFilePath(QFileInfo(QCoreApplication::arguments()[0]).baseName()) + ".ini";
QSettings tempSettings(programSettingsFile, QSettings::IniFormat);
QSettings tempSettings(ISysUtils::rmBOM(programSettingsFile), QSettings::IniFormat);

tempSettings.setValue("common/working_directory", getWorkingDirectory());
}
@@ -685,33 +784,82 @@ bool UpdaterApp::cleanDir(const QString & dirName)
}

//---------------------------------------------------------------------------
void UpdaterApp::setResultCode(CUpdaterErrors::Enum aError)
void UpdaterApp::setResultCode(CUpdaterErrors::Enum aError, const QString aMessage /*= QString()*/)
{
mResultDescription = aMessage;

switch (aError)
{
case CUpdaterErrors::OK:
setResultCode(CUpdaterApp::ExitCode::NoError, aMessage);
break;

case CUpdaterErrors::UnknownError:
mResultCode = CUpdaterApp::ExitCode::UnknownError;
setResultCode(CUpdaterApp::ExitCode::UnknownError, aMessage);
break;

case CUpdaterErrors::NetworkError:
mResultCode = CUpdaterApp::ExitCode::NetworkError;
setResultCode(CUpdaterApp::ExitCode::NetworkError, aMessage);
break;

case CUpdaterErrors::ParseError:
mResultCode = CUpdaterApp::ExitCode::ParseError;
setResultCode(CUpdaterApp::ExitCode::ParseError, aMessage);
break;

case CUpdaterErrors::DeployError:
mResultCode = CUpdaterApp::ExitCode::DeployError;
setResultCode(CUpdaterApp::ExitCode::DeployError, aMessage);
break;

case CUpdaterErrors::UpdateBlocked:
mResultCode = CUpdaterApp::ExitCode::Blocked;
setResultCode(CUpdaterApp::ExitCode::Blocked, aMessage);
break;

case CUpdaterErrors::BitsInProgress:
setResultCode(CUpdaterApp::ExitCode::NoError, tr("Update in progress"));
break;

default:

break;
}
updateErrorDescription();
}

//---------------------------------------------------------------------------
void UpdaterApp::setResultCode(CUpdaterApp::ExitCode::Enum aExitCode, const QString aMessage /*= QString()*/)
{
mResultCode_ = aExitCode;
mResultDescription = aMessage;

updateErrorDescription();
}

//---------------------------------------------------------------------------
void UpdaterApp::updateErrorDescription()
{
static QMap<int, QString> descriptions;

if (descriptions.isEmpty())
{
descriptions.insert(CUpdaterApp::ExitCode::ErrorRunFromTempDir, tr("#error_run_from_temp_dir"));
descriptions.insert(CUpdaterApp::ExitCode::NoWatchService, tr("#error_connection_to_guard"));
descriptions.insert(CUpdaterApp::ExitCode::UnknownCommand, tr("#error_unknown_command"));
descriptions.insert(CUpdaterApp::ExitCode::SecondInstance, tr("#error_second_instance"));
descriptions.insert(CUpdaterApp::ExitCode::UnknownError, tr("#error_unknown"));
descriptions.insert(CUpdaterApp::ExitCode::NetworkError, tr("#error_network"));
descriptions.insert(CUpdaterApp::ExitCode::ParseError, tr("#error_parse_response"));
descriptions.insert(CUpdaterApp::ExitCode::DeployError, tr("#error_deploy"));
descriptions.insert(CUpdaterApp::ExitCode::Aborted, tr("#error_aborted"));
descriptions.insert(CUpdaterApp::ExitCode::Blocked, tr("#error_update_blocked"));
descriptions.insert(CUpdaterApp::ExitCode::FailIntegrity, tr("#error_check_integrity"));
descriptions.insert(CUpdaterApp::ExitCode::WorkInProgress, tr("#work_in_progress"));
}

if (mResultDescription.isEmpty() && descriptions.contains(mResultCode_))
{
mResultDescription = descriptions.value(mResultCode_);
}
}

//---------------------------------------------------------------------------

+ 12
- 2
3.0/src/apps/Updater/src/UpdaterApp.h View File

@@ -26,6 +26,9 @@ namespace CUpdaterApp
/// Глобальный таймаут скачивания обновлений
const int MaxDownloadTime = 4 * 60 * 60 * 1000; // 4 часа

/// Таймаут попыток повторнго запуска по финишу BITS
const long BITSCompleteTimeout = 15 * 60; // 15 минут

typedef enum
{
Download, // закачиваем обновления
@@ -49,6 +52,7 @@ namespace CUpdaterApp
Aborted, /// Команда прервана снаружи
Blocked, /// Обновление заблокировано на стороне сервера
FailIntegrity, /// Проверка целостности закончилась неуспехом
WorkInProgress, /// Фоновая обработка задания
ContunueExecution = 54321 /// Перезапуск из временной папки
};
}
@@ -65,6 +69,8 @@ public:

void run();

CUpdaterApp::ExitCode::Enum bitsCheckStatus(bool aAlreadyRunning);

int getResultCode() const;

/// Возвращает рабочий каталог приложения (может быть задан в .ini файле).
@@ -115,10 +121,12 @@ private:

SplashScreen mSplashScreen;
ReportBuilder mReportBuilder;
int mResultCode;
CUpdaterApp::State mState;
QPointer<QTimer> mErrorStopTimer;

int mResultCode_;
QString mResultDescription;

private:
/// Получить значение параметра командной строки
QString getArgument(const char * aName, const QString & aDafaultValue = QString()) const;
@@ -139,7 +147,9 @@ private:
void delayedExit(int aTimeout, CUpdaterErrors::Enum aError);

/// Выставить код возврата updater
void setResultCode(CUpdaterErrors::Enum aError);
void setResultCode(CUpdaterErrors::Enum aResult, const QString aMessage = QString());
void setResultCode(CUpdaterApp::ExitCode::Enum aExitCode, const QString aMessage = QString());
void updateErrorDescription();

private:
/// Скопировать файлы


+ 23
- 12
3.0/src/apps/Updater/src/locale/updater_en.ts View File

@@ -17,58 +17,69 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="91"/>
<location filename="../UpdaterApp.cpp" line="228"/>
<location filename="../UpdaterApp.cpp" line="818"/>
<source>Update in progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="845"/>
<source>#error_run_from_temp_dir</source>
<translation>Failed to run updater from a temp path</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="92"/>
<location filename="../UpdaterApp.cpp" line="846"/>
<source>#error_connection_to_guard</source>
<translation>Failed to connect to guard.exe</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="93"/>
<location filename="../UpdaterApp.cpp" line="847"/>
<source>#error_unknown_command</source>
<translation>Unknown command</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="94"/>
<location filename="../UpdaterApp.cpp" line="848"/>
<source>#error_second_instance</source>
<translation>Deny second updater instance</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="95"/>
<location filename="../UpdaterApp.cpp" line="849"/>
<source>#error_unknown</source>
<translation>Unknown error</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="850"/>
<source>#error_network</source>
<translation>Network error</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="851"/>
<source>#error_parse_response</source>
<translation>Update server parse response error</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="852"/>
<source>#error_deploy</source>
<translation>Error while copying files</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="853"/>
<source>#error_aborted</source>
<translation>External abort</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="854"/>
<source>#error_update_blocked</source>
<translation>Update is blocked</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="338"/>
<location filename="../UpdaterApp.cpp" line="856"/>
<source>#work_in_progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="350"/>
<location filename="../UpdaterApp.cpp" line="855"/>
<source>#error_check_integrity</source>
<translation>The integrity of the distribution is broken. Number of differences:%1. Run software update</translation>
</message>


+ 23
- 12
3.0/src/apps/Updater/src/locale/updater_kk.ts View File

@@ -17,58 +17,69 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="91"/>
<location filename="../UpdaterApp.cpp" line="228"/>
<location filename="../UpdaterApp.cpp" line="818"/>
<source>Update in progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="845"/>
<source>#error_run_from_temp_dir</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="92"/>
<location filename="../UpdaterApp.cpp" line="846"/>
<source>#error_connection_to_guard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="93"/>
<location filename="../UpdaterApp.cpp" line="847"/>
<source>#error_unknown_command</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="94"/>
<location filename="../UpdaterApp.cpp" line="848"/>
<source>#error_second_instance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="95"/>
<location filename="../UpdaterApp.cpp" line="849"/>
<source>#error_unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="850"/>
<source>#error_network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="851"/>
<source>#error_parse_response</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="852"/>
<source>#error_deploy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="853"/>
<source>#error_aborted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="854"/>
<source>#error_update_blocked</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="338"/>
<location filename="../UpdaterApp.cpp" line="856"/>
<source>#work_in_progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="350"/>
<location filename="../UpdaterApp.cpp" line="855"/>
<source>#error_check_integrity</source>
<translation type="unfinished"></translation>
</message>


+ 23
- 12
3.0/src/apps/Updater/src/locale/updater_ru.ts View File

@@ -17,58 +17,69 @@
<context>
<name>UpdaterApp</name>
<message>
<location filename="../UpdaterApp.cpp" line="91"/>
<location filename="../UpdaterApp.cpp" line="228"/>
<location filename="../UpdaterApp.cpp" line="818"/>
<source>Update in progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="845"/>
<source>#error_run_from_temp_dir</source>
<translation>Ошибка запуска updater из временной папки</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="92"/>
<location filename="../UpdaterApp.cpp" line="846"/>
<source>#error_connection_to_guard</source>
<translation>Ошибка соединения с guard.exe</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="93"/>
<location filename="../UpdaterApp.cpp" line="847"/>
<source>#error_unknown_command</source>
<translation>Неизвестная команда</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="94"/>
<location filename="../UpdaterApp.cpp" line="848"/>
<source>#error_second_instance</source>
<translation>Запуск второй копии updater</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="95"/>
<location filename="../UpdaterApp.cpp" line="849"/>
<source>#error_unknown</source>
<translation>Неизвестная ошибка</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="96"/>
<location filename="../UpdaterApp.cpp" line="850"/>
<source>#error_network</source>
<translation>Сетевая ошибка</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="97"/>
<location filename="../UpdaterApp.cpp" line="851"/>
<source>#error_parse_response</source>
<translation>Ошибка обработки ответа сервера обновления</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="98"/>
<location filename="../UpdaterApp.cpp" line="852"/>
<source>#error_deploy</source>
<translation>Ошибка копирования файлов</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="99"/>
<location filename="../UpdaterApp.cpp" line="853"/>
<source>#error_aborted</source>
<translation>Прерван внешним процессом</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="100"/>
<location filename="../UpdaterApp.cpp" line="854"/>
<source>#error_update_blocked</source>
<translation>Обновление заблокировано</translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="101"/>
<location filename="../UpdaterApp.cpp" line="338"/>
<location filename="../UpdaterApp.cpp" line="856"/>
<source>#work_in_progress</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../UpdaterApp.cpp" line="350"/>
<location filename="../UpdaterApp.cpp" line="855"/>
<source>#error_check_integrity</source>
<translation>Целостность дистрибутива нарушена. Кол-во отличий: %1. Выполните команду обновления ПО</translation>
</message>


+ 1
- 1
3.0/src/apps/Updater/src/main.cpp View File

@@ -21,7 +21,7 @@ int main(int aArgc, char * aArgv[])
app.run();
app.getLog()->write(LogLevel::Normal, QString("Exit. resultCode = %1").arg(app.getResultCode()));
app.getLog()->write(LogLevel::Normal, QString("Exit with resultCode = %1").arg(app.getResultCode()));
return app.getResultCode();
}


+ 1
- 2
3.0/src/apps/WatchService/src/WatchService.cpp View File

@@ -16,7 +16,6 @@
// Modules
#include <Common/Application.h>
#include <Common/SleepHelper.h>

#include <SysUtils/ISysUtils.h>
#include <WatchServiceClient/Constants.h>

@@ -337,7 +336,7 @@ void WatchService::loadConfiguration()
}

#if 0 // #40592 Пока выключаем данную опцию
QSettings userSettings(BasicApplication::getInstance()->getWorkingDirectory() + "/user/user.ini", QSettings::IniFormat);
QSettings userSettings(ISysUtils::rmBOM(BasicApplication::getInstance()->getWorkingDirectory() + "/user/user.ini"), QSettings::IniFormat);
userSettings.setIniCodec("UTF-8");

if (userSettings.value("guard/taboo_enabled").toString() == "true")


+ 498
- 0
3.0/src/includes/Hardware/CardReaders/EMVTagData.h View File

@@ -0,0 +1,498 @@
/* @file Данные тегов EMV. */

#pragma once

#include "Hardware/Common/Specifications.h"

//--------------------------------------------------------------------------------
namespace CEMVTags
{
const int MSREquivalentData = 0xDFEF4D;

class CData : public CDescription<int>
{
public:
CData()
{
append( 0x42, "Issuer Identification Number (IIN)");
append( 0x4F, "Application Identifier (ADF Name)");
append( 0x50, "Application Label");
append( 0x52, "Command to perform");
append( 0x56, "Track 1 Data");
append( 0x57, "Track 2 Equivalent Data");
append( 0x5A, "Application Primary Account Number (PAN)");
append( 0x5D, "Deleted (see 9D)");
append( 0x6F, "File Control Information (FCI) Template");
append( 0x61, "Application Template");
append( 0x62, "File Control Parameters (FCP) Template");
append( 0x70, "READ RECORD Response Message Template");
append( 0x71, "Issuer Script Template 1");
append( 0x72, "Issuer Script Template 2");
append( 0x73, "Directory Discretionary Template");
append( 0x77, "Response Message Template Format 2");
append( 0x80, "Response Message Template Format 1");
append( 0x81, "Amount, Authorised (Binary)");
append( 0x82, "Application Interchange Profile (AIP)");
append( 0x83, "Command Template");
append( 0x84, "Dedicated File (DF) Name");
append( 0x86, "Issuer Script Command");
append( 0x87, "Application Priority Indicator");
append( 0x88, "Short File Identifier (SFI)");
append( 0x89, "Authorisation Code");
append( 0x8A, "Authorization Response Code");
append( 0x8A, "Authorisation Response Code (ARC)");
append( 0x8C, "Card Risk Management Data Object List 1 (CDOL1)");
append( 0x8D, "Card Risk Management Data Object List 2 (CDOL2)");
append( 0x8E, "Cardholder Verification Method (CVM) List");
append( 0x8F, "Certification Authority Public Key Index (PKI)");
append( 0x90, "Issuer Public Key Certificate");
append( 0x91, "Issuer Authentication Data");
append( 0x92, "Issuer Public Key Remainder");
append( 0x93, "Signed Application Data");
append( 0x94, "Application File Locator (AFL)");
append( 0x95, "Terminal Verification Results (TVR)");
append( 0x97, "Transaction Certificate Data Object List (TDOL)");
append( 0x98, "Transaction Certificate (TC) Hash Value");
append( 0x99, "Transaction Personal Identification Number (PIN) Data");
append( 0x99, "Transaction Personal Identification Number (PIN) Data");
append( 0x98, "Transaction Certificate (TC) Hash Value");
append( 0x9A, "Transaction Date (YYMMDD )");
append( 0x9A, "Transaction Date");
append( 0x9B, "Transaction Status Information");
append( 0x9B, "Transaction Status Information");
append( 0x9C, "Transaction Type");
append( 0x9C, "Transaction Type");
append( 0x9D, "Directory Definition File (DDF) Name");
append( 0xA5, "File Control Information (FCI) Proprietary Template");
append( 0xC3, "Card issuer action code -decline");
append( 0xC4, "Card issuer action code -default");
append( 0xC5, "Card issuer action code online");
append( 0xC6, "PIN Try Limit");
append( 0xC7, "CDOL 1 Related Data Length");
append( 0xC8, "Card risk management country code");
append( 0xC9, "Card risk management currency code");
append( 0xCA, "Lower cummulative offline transaction amount");
append( 0xCB, "Upper cumulative offline transaction amount");
append( 0xCD, "Card Issuer Action Code (PayPass) – Default");
append( 0xCE, "Card Issuer Action Code (PayPass) – Online");
append( 0xCF, "Card Issuer Action Code (PayPass) – Decline");
append( 0xD1, "Currency conversion table");
append( 0xD2, "Integrated Data Storage Directory (IDSD)");
append( 0xD3, "Additional check table");
append( 0xD5, "Application Control");
append( 0xD6, "Default ARPC response code");
append( 0xD7, "Application Control (PayPass)");
append( 0xD8, "AIP (PayPass)");
append( 0xD9, "AFL (PayPass)");
append( 0xDA, "Static CVC3-TRACK1");
append( 0xDB, "Static CVC3-TRACK2");
append( 0xDC, "IVCVC3-TRACK1");
append( 0xDD, "IVCVC3-TRACK2");
append( 0x5F20, "Cardholder Name");
append( 0x5F24, "Application Expiration Date");
append( 0x5F28, "Issuer Country Code");
append( 0x5F2A, "Transaction Currency Code (Default: 08 40)");
append( 0x5F2D, "Language Preference");
append( 0x5F30, "Service Code");
append( 0x5F34, "Application Primary Account Number (PAN) Sequence Number (PSN)");
append( 0x5F36, "Transaction Currency Exponent");
append( 0x5F3C, "Transaction Reference Currency Code");
append( 0x5F3D, "Transaction Reference Currency Exponent");
append( 0x5F50, "Issuer URL");
append( 0x5F53, "International Bank Account Number (IBAN)");
append( 0x5F54, "Bank Identifier Code (BIC)");
append( 0x5F55, "Issuer Country Code (alpha2 format)");
append( 0x5F56, "Issuer Country Code (alpha3 format)");
append( 0x5F57, "Account Type Selection");
append( 0x9F01, "Acquirer Identifier");
append( 0x9F02, "Amount, Authorized (Numeric)");
append( 0x9F03, "Amount, Other (Numeric)");
append( 0x9F04, "Amount, Other (Binary)");
append( 0x9F05, "Application Discretionary Data");
append( 0x9F06, "Application Identifier (AID) – terminal");
append( 0x9F07, "Application Usage Control (AUC)");
append( 0x9F08, "Application Version Number");
append( 0x9F09, "Application Version Number (Default: 00 02 )");
append( 0x9F0B, "Cardholder Name Extended");
append( 0x9F0D, "Issuer Action Code - Default");
append( 0x9F0E, "Issuer Action Code - Denial");
append( 0x9F0F, "Issuer Action Code - Online");
append( 0x9F10, "Issuer Application Data (IAD)");
append( 0x9F11, "Issuer Code Table Index");
append( 0x9F12, "Application Preferred Name");
append( 0x9F13, "Last Online Application Transaction Counter (ATC) Register");
append( 0x9F14, "Lower Consecutive Offline Limit");
append( 0x9F15, "Merchant Category Code");
append( 0x9F16, "Merchant Identifier");
append( 0x9F17, "Personal Identification Number (PIN) Try Counter");
append( 0x9F18, "Issuer Script Identifier");
append( 0x9F19, "Deleted (see 9F49)");
append( 0x9F1A, "Terminal Country Code");
append( 0x9F1B, "Terminal Floor Limit");
append( 0x9F1C, "Terminal Identification");
append( 0x9F1D, "Terminal Risk Management Data");
append( 0x9F1E, "Interface Device (IFD) Serial Number");
append( 0x9F1F, "Track 1 Discretionary Data");
append( 0x9F20, "Track 2 Discretionary Data");
append( 0x9F21, "Transaction Time (HHMMSS )");
append( 0x9F22, "Certification Authority Public Key Index");
append( 0x9F23, "Upper Consecutive Offline Limit");
append( 0x9F26, "Application Cryptogram (AC)");
append( 0x9F27, "Cryptogram Information Data (CID)");
append( 0x9F29, "Extended Selection");
append( 0x9F2A, "Kernel Identifier");
append( 0x9F2D, "Integrated Circuit Card (ICC) PIN Encipherment Public Key Certificate");
append( 0x9F2E, "Integrated Circuit Card (ICC) PIN Encipherment Public Key Exponent");
append( 0x9F2F, "Integrated Circuit Card (ICC) PIN Encipherment Public Key Remainder");
append( 0x9F32, "Issuer Public Key Exponent");
append( 0x9F33, "Terminal Capabilities (see below)");
append( 0x9F34, "Cardholder Verification Method (CVM) Results");
append( 0x9F35, "Terminal Type (see below)");
append( 0x9F36, "Application Transaction Counter (ATC)");
append( 0x9F37, "Unpredictable Number");
append( 0x9F38, "Processing Options Data Object List (PDOL)");
append( 0x9F39, "POS Entry Mode (Default: 07)");
append( 0x9F3A, "Amount, Reference Currency");
append( 0x9F3B, "Application Reference Currency");
append( 0x9F3C, "Transaction Reference Currency Code");
append( 0x9F3D, "Transaction Reference Currency Exponent");
append( 0x9F40, "Additional Terminal Capabilities (see below)");
append( 0x9F41, "Transaction Sequence Counter");
append( 0x9F42, "Application Currency Code");
append( 0x9F43, "Application Reference Currency Exponent");
append( 0x9F44, "Application Currency Exponent");
append( 0x9F45, "Data Authentication Code");
append( 0x9F46, "Integrated Circuit Card (ICC) Public Key Certificate");
append( 0x9F47, "Integrated Circuit Card (ICC) Public Key Exponent");
append( 0x9F48, "Integrated Circuit Card (ICC) Public Key Remainder");
append( 0x9F49, "Dynamic Data Authentication Data Object List (DDOL)");
append( 0x9F4A, "Static Data Authentication Tag List (SDA)");
append( 0x9F4B, "Signed Dynamic Application Data (SDAD)");
append( 0x9F4C, "ICC Dynamic Number");
append( 0x9F4D, "Log Entry");
append( 0x9F4E, "Merchant Name and Location");
append( 0x9F4E, "Merchant Name and Location");
append( 0x9F4F, "Log Format");
append( 0x9F50, "Offline Accumulator Balance");
append( 0x9F51, "Application Currency Code");
append( 0x9F52, "Application Default Action (ADA)");
append( 0x9F53, "Transaction Category Code");
append( 0x9F54, "DS ODS Card");
append( 0x9F55, "Geographic Indicator");
append( 0x9F56, "Issuer Authentication Indicator");
append( 0x9F57, "Issuer Country Code");
append( 0x9F58, "Consecutive Transaction Counter Limit (CTCL)");
append( 0x9F59, "Consecutive Transaction Counter Upper Limit (CTCUL)");
append( 0x9F5A, "Application Program Identifier (Program ID)");
append( 0x9F5B, "Issuer Script Results");
append( 0x9F5C, "Magstripe Data Object List (MDOL)");
append( 0x9F5D, "Available Offline Spending Amount (AOSA)");
append( 0x9F5D, "Application Capabilities Information (ACI)");
append( 0x9F5E, "Consecutive Transaction International Upper Limit (CTIUL)");
append( 0x9F5E, "DS ID");
append( 0x9F5F, "DS Slot Availability");
append( 0x9F60, "CVC3 (Track1)");
append( 0x9F61, "CVC3 (Track2)");
append( 0x9F62, "PCVC3 (Track1)");
append( 0x9F64, "NATC (Track1)");
append( 0x9F65, "PCVC3 (Track2)");
append( 0x9F66, "PUNATC (Track2)");
append( 0x9F67, "NATC (Track2)");
append( 0x9F68, "Card Additional Processes");
append( 0x9F69, "UDOL");
append( 0x9F6A, "Unpredictable Number (Numeric)");
append( 0x9F6B, "Track 2 Data");
append( 0x9F6C, "Card Transaction Qualifiers (CTQ)");
append( 0x9F6D, "Mag-stripe Application Version Number (Reader)");
append( 0x9F6E, "Third Party Data");
append( 0x9F6E, "Terminal Transaction Capabilities");
append( 0x9F6F, "DS Slot Management Control");
append( 0x9F70, "Protected Data Envelope 1");
append( 0x9F71, "Protected Data Envelope 2");
append( 0x9F72, "Protected Data Envelope 3");
append( 0x9F73, "Protected Data Envelope 4");
append( 0x9F74, "Protected Data Envelope 5");
append( 0x9F75, "Unprotected Data Envelope 1");
append( 0x9F76, "Unprotected Data Envelope 2");
append( 0x9F77, "Unprotected Data Envelope 3");
append( 0x9F78, "Unprotected Data Envelope 4");
append( 0x9F79, "Unprotected Data Envelope 5");
append( 0x9F7A, "VLP Terminal Support Indicator");
append( 0x9F7B, "VLP Terminal Transaction Limit");
append( 0x9F7C, "Customer Exclusive Data (CED)");
append( 0x9F7D, "DS Summary 1");
append( 0x9F7F, "DS Unpredictable Number");
append( 0xBF0C, "File Control Information (FCI) Issuer Discretionary Data");
append( 0xBF50, "Visa Fleet - CDO");
append( 0xBF60, "Integrated Data Storage Record Update Template");
append( 0xDF01, "ApplePay VAS Protocol");
append( 0xDF02, "ApplePay VAS Failure Report");
append( 0xDF10, "Terminal Languages Supported");
append( 0xDF10, "Multi Language (Default: “enfr”)");
append( 0xDF11, "Enable Transaction Logging");
append( 0xDF13, "Terminal Action Code - Default");
append( 0xDF14, "Terminal Action Code - Denial");
append( 0xDF15, "Terminal Action Code - Online");
append( 0xDF17, "Threshold Value for Biased Random Selection");
append( 0xDF18, "Target Percentage to be Used for Random Selection");
append( 0xDF19, "Maximum Target Percentage to be used for Biased Random Selection");
append( 0xDF1F, "Last 4 digits of Primary Account Number (PAN)");
append( 0xDF21, "Issuer Script Results");
append( 0xDF22, "Force Online (1-Enable, 0-Disable)");
append( 0xDF25, "Default DDOL (1-Enable, 0-Disable)");
append( 0xDF26, "Revocation List Support (Default: Enable - 1)");
append( 0xDF27, "Exception File Support (Default: Disable - 0)");
append( 0xDF28, "Default TDOL");
append( 0xDF29, "Terminal Capabilities - CVM Required");
append( 0xDF2A, "Threshold Value for Biased Random Selection (Interac)");
append( 0xDF2B, "Maximum Target Percentage for Biased Random Selection (Interac)");
append( 0xDF2C, "Target Percentage for Random Selection (Interac)");
append( 0xDF30, "Track Data Source");
append( 0xDF31, "DD Card Track 1");
append( 0xDF32, "DD Card Track 2");
append( 0xDF33, "Interac Receipt Required");
append( 0xDF34, "TTK Customer - Firmware Version");
append( 0xDF40, "Message to be displayed by EMV Kernel on “PIN Try Limit Exceeded” condition");
append( 0xDF41, "Message to be displayed by EMV Kernel on “Last PIN Try” condition");
append( 0xDF42, "Message to be displayed by EMV Kernel on “Please Try Again” condition");
append( 0xDF43, "Message to be displayed by EMV Kernel on “Call Your Bank” condition");
append( 0xDF45, "GMEDS Secret Keys");
append( 0xDF46, "GMAD MIDs");
append( 0xDF47, "ISIS Read Cmd Data");
append( 0xDF48, "ISIS Write Data");
append( 0xDF49, "ISIS Transaction Data");
append( 0xDF4A, "TTK Customer - Current KSN of Data encryption Key");
append( 0xDF4B, "TTK Customer - MSR all track data");
append( 0xDF4C, "TTK Customer - Masked PAN");
append( 0xDF4D, "TTK Customer - Additional POS Info");
append( 0xDF4E, "Polling Options");
append( 0xDF4F, "TTK Customer - Fallback Reason");
append( 0xDF50, "Special Flow");
append( 0xDF51, "Amex Terminal Capability");
append( 0xDF52, "Transaction CVM");
append( 0xDF55, "RID");
append( 0xDF56, "Activate Trans for DESFireViVOComm Flows");
append( 0xDF57, "Reader Primary Language");
append( 0xDF57, "2nd usage: Remaining Candidates");
append( 0xDF58, "Reader Secondary Language");
append( 0xDF5A, "TLV Exclusion List");
append( 0xDF5B, "Terminal Entry Capability");
append( 0xDF5C, "RF Deactivate Period");
append( 0xDF5D, "D-PAS Issuer Script Response status");
append( 0xDF5E, "Transaction Timing Information");
append( 0xDF5F, "Encrypted PAN for remote PIN Pad");
append( 0xDF60, "Product ID");
append( 0xDF61, "Processor ID");
append( 0xDF61, "CVMRequiredLimit_JCBScheme");
append( 0xDF62, "Main Firmware Build ID");
append( 0xDF63, "CB Enhanced DDA Indicator (same block as DF03)");
append( 0xDF64, "CB Wave 2 CVM Requirements (same block as DF04)");
append( 0xDF65, "Build ID Num (Cxx)");
append( 0xDF65, "CB Display Offline Funds Indicator (same block as DF05)");
append( 0xDF65, "Serial heartbeat Required");
append( 0xDF66, "SVN Number");
append( 0xDF66, "CB Terminal Type (same block as 9F35)");
append( 0xDF66, "Display Unsupported Card");
append( 0xDF68, "Enable/Disable STOP command processing");
append( 0xDF69, "ConfigureProprietaryTags");
append( 0xDF6A, "Enable/Disable Comm Error Recovery");
append( 0xDF6C, "Cubic FTP Phase 2 Mode Options");
append( 0xDF6D, "Cubic Mode 3 Match AID");
append( 0xDF6E, "Cubic Fixed Fare Amounts");
append( 0xDF6F, "Cubic Timestamp Data");
append( 0xDF70, "Loyalty Program ID");
append( 0xDF70, "Generic Name String");
append( 0xDF71, "Value Added Tax 1");
append( 0xDF71, "Generic Numeric");
append( 0xDF72, "Value Added Tax 2");
append( 0xDF72, "Generic Specification String");
append( 0xDF73, "Merchant Category Code");
append( 0xDF73, "Generic Implementation String");
append( 0xDF74, "Discover Optional Features");
append( 0xDF75, "Communications Error Message Delay");
append( 0xDF76, "TVR from GenAC");
append( 0xDF77, "ViVOpay MSR Custom Data Output Tag");
append( 0xDF78, "MC Timing Performance Enable");
append( 0xDF79, "Card Disable Mask");
append( 0xDF7A, "Card Disable Interval");
append( 0xDF7B, "Serial Port (UART) Inter-character Timeout Period");
append( 0xDF7C, "Auto Switch Feature");
append( 0xDF7D, "Track Formatting Feature");
append( 0xDF7F, "Improved Collision Detection & Media Removal Feature");
append( 0xFF69, "ViVOpay Proprietary Tag List");
append( 0xFF70, "Serial Finite State Machine Version");
append( 0xFF71, "Transaction Finite State Machine Version");
append( 0xFF72, "System Information Suite");
append( 0xFF73, "Serial Protocol Version");
append( 0xFF74, "Serial Protocol Suite");
append( 0xFF75, "L1 Paypass Version");
append( 0xFF76, "L1 LCR Version");
append( 0xFF77, "L2 Card App Version");
append( 0xFF78, "L2 Card App Suite");
append( 0xFF79, "GMEDs Data");
append( 0xFF79, "User Experience Version");
append( 0xFF7A, "User Experience Suite");
append( 0xFF7B, "ViVOtech Proprietary Suite");
append( 0xFF7C, "VIUDS Scheme IDs Supported");
append( 0xFF7D, "VIUDS Scheme ID Selection Criteria");
append( 0xFFE0, "Registered Application Provider Identifier (RID)");
append( 0xFFE1, "Partial Selection Allowed");
append( 0xFFE2, "Application Flow");
append( 0xFFE3, "Selection Features - GR 1.2.10");
append( 0xFFE4, "Group Number / Fallback Group");
append( 0xFFE5, "Max AID Length");
append( 0xFFE6, "AID Disabled");
append( 0xFFE7, "Interface Support");
append( 0xFFE8, "Exclude from Processing");
append( 0xFFE9, "Kernel ID Transaction Type Group List");
append( 0xFFEA, "Default Kernel ID");
append( 0xFFF0, "Specific Features Switch");
append( 0xFFF1, "Terminal Contactless Transaction Limit");
append( 0xFFF2, "Terminal IFD");
append( 0xFFF3, "Application Capability");
append( 0xFFF4, "Visa Reader Risk Flags");
append( 0xFFF6, "Torn Transaction Log Clean Interval (minutes)");
append( 0xFFF7, "Burst Mode");
append( 0xFFF8, "UI Scheme");
append( 0xFFF9, "LCD Font Size");
append( 0xFFFA, "LCD Delay Time");
append( 0xFFFB, "Language Option for LCD");
append( 0xFFFC, "Force MagStripe");
append(0xDF891B, "Poll Mode");
append(0xDF891C, "Interac Retry Limit");
append(0xDFDE04, "MSR Encryption Option");
append(0xDFEE0C, "PPSE Terminate Flags");
append(0xDFEE12, "KID");
append(0xDFEE15, "Application Selection Indicator");
append(0xDFEE16, "DUKPT Key or MKSK Select for Online PIN Encrypted");
append(0xDFEE17, "ICC Terminal Entry Mode");
append(0xDFEE18, "MSR Terminal Entry Mode");
append(0xDFEE19, "Online DOL");
append(0xDFEE1A, "Output data element");
append(0xDFEE1B, "Authorization Request data elements");
append(0xDFEE1E, "Contact Terminal Configuration (see below)");
append(0xDFEE1F, "Issuer script device limit, Range: 0~255 (Default: 128)");
append(0xDFEE20, "ICC Power on detect waiting time. (Unit: Sec) (Default: 60S)");
append(0xDFEE21, "ICC L1 waiting time. (Unit: Sec)(Default: 10 S)");
append(0xDFEE22, "Driver (Menu, Get PIN, Get MSR) Timeout. (Unit: Sec) (see below)");
append(0xDFEE23, "MSR Track Data");
append(0xDFEE24, "Force Acceptance (Default: 00)");
append(0xDFEE25, "ICC Response Code");
append(0xDFEE26, "Encryption Status Information");
append(0xDFEE27, "MSR Control");
append(0xDFEF1A, "TLV available");
append(0xDFEF1A, "Encrypted Sensitive Tags");
append(0xDFEF1A, "Auto Authenticate");
append(0xDFEF20, "MAC option in reponse data");
append(0xDFEF21, "BIN");
append(0xDFEF22, "AID");
append(0xDFEF23, "HMAC");
append(0xDFEF24, "HMAC KSN");
append(0xDFEF25, "Output Data Format Select");
append(0xDFEF26, "MSR fallback");
append(0xDFEF27, "Online capability");
append(0xDFEF28, "Disable Encrypt ON");
append(0xDFEF2C, "Terminal AID List");
append(0xDFEF2E, "Terminal Transaction Log");
append(0xDFEF2F, "CUP configuration");
append(0xDFEF30, "White List");
append(0xDFEF31, "Black List");
append(0xDFEF32, "Auto-Switch");
append(0xDFEF34, "Antenna Detection Switch");
append(0xDFEF35, "Communications Watchdog Period");
append(0xDFEF36, "Media Control & Status Tracking");
append(0xDFEF37, "Interface Select");
append(0xDFEF38, "Timeout for Next Command");
append(0xDFEF39, "Network Indicate");
append(0xDFEF3A, "Reader Behavior Mode");
append(0xDFEF3B, "Autopoll Transaction Separation Interval");
append(0xDFEF40, "Ascii-code encryption Tag57 TLV");
append(0xDFEF41, "MAC Verification Data for SRED");
append(0xDFEF42, "MAC Verification KSN for SRED");
append(0xDFEF43, "Local TZ/DST information");
append(0xDFEF44, "Combination Options");
append(0xDFEF45, "Removal Timeout");
append(0xDFEF46, "ACT Pass Response DOL");
append(0xDFEF47, "CDA Hash Input");
append(0xDFEF48, "Indicate - retrieve transaction result again due to Output RAM is Not enough");
append(0xDFEF49, "Outcome Parameter Set");
append(0xDFEF4A, "User Interface Request Data");
append(0xDFEF4B, "MSR Equivalent Data Option");
append(0xDFEF4C, "MSR Equivalent Data Track Lengths");
append(0xDFEF4D, "MSR Equivalent Data");
append(0xDFEF4E, "ACT MSD Response DOL");
append(0xDFEF4F, "ACT Decline Response DOL");
append(0xDFEF50, "Terminal Interchange Profile (JCB)");
append(0xDFEF51, "Bypass EMV Completion Output");
append(0xDFEF52, "Re-FallBack times");
append(0xDFEF53, "Dynamic Reader Limits");
append(0xDFEF54, "SmartTap AID Index");
append(0xDFEF55, "Kernel Specific Features");
append(0xDFEF56, "Retry Limit");
append(0xDFEF57, "PPSE Terminate Flags");
append(0xDFEF59, "Terminal Data Setting - Default Amount");
append(0xDFEF5A, "Terminal Data Setting - Tags to Return");
append(0xDFEF5B, "Mask for Tag5A");
append(0xDFEF5C, "Mask for Tag56");
append(0xDFEF5D, "Mask for Tag57");
append(0xDFEF5E, "Mask for Tag9F6B");
append(0xDFEF5F, "Mask for TagFFEE13");
append(0xDFEF60, "Mask for TagFFEE14");
append(0xDFEF61, "Error Code");
append(0xDFEF62, "Allow MSR Swipe data from ICC Card");
append(0xDFEF63, "Tags To Read Yet");
append(0xDFEF64, "Referral Timeout");
append(0xDFEF6E, "USB-KB Output Data Postfix");
append(0xDFEF6F, "Inter-character Delay for USB-KB Interface");
append(0xDFEF70, "PISCES dual interface interference prevention mechanism fine-tune parameters");
append(0xDFEF71, "Waiting ICC insert time");
append(0xDFEF72, "Pre-poll card mechanism control in ACT cmd & config setting");
append(0xDFEF73, "Transaction Message Type");
append(0xDFEF74, "Reference amplitude value");
append(0xDFEF75, "Reference delta value");
append(0xDFEF76, "Transaction Interface Type to activate");
append(0xDFEF77, "Timeout for waiting next command");
append(0xDFEF78, "EMV contact L2 display messages option");
append(0xDFEF79, "PIN block format (when TDES)");
append(0xDFEF7A, "Enable Apple Pay Check");
append(0xDFEF7B, "Apple Pay Status");
append(0xDFEF7C, "Track Bit Encoding");
append(0xDFEF7D, "Re-power on times");
append(0xDFEF7E, "Fallback response code list");
append(0xFFEE01, "ViVOpay TLV Group Tag");
append(0xFFEE02, "ViVOpay Pre-PPSE Special Flow Group Tag");
append(0xFFEE03, "ViVOpay Post-PPSE Special Flow Group Tag");
append(0xFFEE04, "M/Chip3 Intermediate Message Data");
append(0xFFEE05, "M/Chip3 Intermediate Message Marker");
append(0xFFEE06, "ApplePay VAS Container");
append(0xFFEE07, "Encrypted Sensitive Tags");
append(0xFFEE08, "Masked Tags");
append(0xFFEE0A, "BIN Range");
append(0xFFEE0B, "AID Range");
append(0xFFEE0C, "White List");
append(0xFFEE10, "ViVOpay MChip Group Tag");
append(0xFFEE11, "ViVOpay Discover Group Tag");
append(0xFFEE12, "KID");
append(0xFFEE12, "Cash Reader Risk Record");
append(0xFFEE13, "Track 1 Data");
append(0xFFEE13, "Cashback Reader Risk Record");
append(0xFFEE14, "Track 2 Data");
append(0xFFEE14, "DRL Record 1");
append(0xFFEE15, "DRL Record 2");
append(0xFFEE16, "DRL Record 3");
append(0xFFEE17, "DRL Record 4");
append(0xFFEE18, "Tags To Write Yet Before GenAC");
append(0xFFEE19, "Tags To Write Yet After GenAC");
append(0xFFEE1A, "Terminal App DET Data");
append(0xFFEE1C, "Unpredictable Number Range");
append(0xFFEE1D, "Sensitive Data Mask");
append(0xFFEE1E, "Group 0 Initialize Flag ");
append(0xFFEE1F, "Error Code Table");
append(0xFFEE20, "Restart Deactivation Time");
}
};

static CData Data;
}

//--------------------------------------------------------------------------------

+ 1
- 1
3.0/src/includes/Hardware/CardReaders/ProtoMifareReader.h View File

@@ -9,7 +9,7 @@
#include "Hardware/Common/ProtoDevice.h"