ConfigAuthorizeDotNetProcessor::ConfigAuthorizeDotNetProcessor(QWidget* parent, Qt::WindowFlags fl) : ConfigCreditCardProcessor(parent, fl) { setupUi(this); connect(_anDuplicateWindow, SIGNAL(valueChanged(int)), this, SLOT(sDuplicateWindow(int))); if (_metrics->value("CCANVer").isEmpty()) _anVersion->setItemText(0, "3.1"); else _anVersion->setItemText(0, _metrics->value("CCANVer")); _anDelim->setText(_metrics->value("CCANDelim")); _anEncap->setText(_metrics->value("CCANEncap")); _anDuplicateWindow->setValue(_metrics->value("CCANDuplicateWindow").toInt()); _anMD5Hash->setText(_metrics->value("CCANMD5Hash")); _anMD5HashSetOnGateway->setChecked(_metrics->boolean("CCANMD5HashSetOnGateway")); _anMD5HashWarn->setChecked(_metrics->value("CCANMD5HashAction") == "W"); _anMD5HashFail->setChecked(_metrics->value("CCANMD5HashAction") == "F"); if (! _metrics->value("CCANCurrency").isEmpty()) _anCurrFixedValue->setId(_metrics->value("CCANCurrency").toInt()); _anUsingWellsFargoSecureSource->setChecked(_metrics->boolean("CCANWellsFargoSecureSource")); _anIgnoreSSLErrors->setChecked(_metrics->boolean("CCANIgnoreSSLErrors")); if (0 != _metricsenc) _anMD5Hash->setText(_metricsenc->value("CCANMD5Hash")); else _anMD5Hash->setEnabled(false); sDuplicateWindow(_anDuplicateWindow->value()); }
configureCC::configureCC(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_anDuplicateWindow, SIGNAL(valueChanged(int)), this, SLOT(sDuplicateWindow(int))); connect(_ccCompany, SIGNAL(currentIndexChanged(int)), this, SLOT(sCCCompanyChanged(int))); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _enableChargePreauth->setVisible(false); _enableCredit->setVisible(false); if (_metricsenc == 0) { QMessageBox::critical( this, tr("Cannot Read Configuration"), tr("<p>Cannot read encrypted information from database.")); } _ccDefaultBank->setType(XComboBox::ARBankAccounts); _ccAccept->setChecked(_metrics->boolean("CCAccept")); _ccTest->setChecked(_metrics->boolean("CCTest")); _ccValidDays->setValue(_metrics->value("CCValidDays").toInt()); _ccCompany->setCurrentIndex(_ccCompany->findText(_metrics->value("CCCompany"))); _ccWidgetStack->setCurrentIndex(_ccCompany->currentIndex()); sCCCompanyChanged(_ccCompany->currentIndex()); _ccServer->setText(_metrics->value("CCServer")); _ccPort->setText(_metrics->value("CCPort")); _ccUseProxyServer->setChecked(_metrics->boolean("CCUseProxyServer")); _ccProxyServer->setText(_metrics->value("CCProxyServer")); _ccProxyPort->setText(_metrics->value("CCProxyPort")); _ccDefaultBank->setId(_metrics->value("CCDefaultBank").toInt()); _ccEncKeyName->setText(_metrics->value("CCEncKeyName")); _ccWinEncKey->setText(_metrics->value("CCWinEncKey")); _ccLinEncKey->setText(_metrics->value("CCLinEncKey")); _ccMacEncKey->setText(_metrics->value("CCMacEncKey")); if (_metrics->value("CCANVer").isEmpty()) _anVersion->setCurrentText("3.1"); else _anVersion->setCurrentText(_metrics->value("CCANVer")); _anDelim->setText(_metrics->value("CCANDelim")); _anEncap->setText(_metrics->value("CCANEncap")); _anDuplicateWindow->setValue(_metrics->value("CCANDuplicateWindow").toInt()); _anMD5Hash->setText(_metrics->value("CCANMD5Hash")); _anMD5HashSetOnGateway->setChecked(_metrics->boolean("CCANMD5HashSetOnGateway")); _anMD5HashWarn->setChecked(_metrics->value("CCANMD5HashAction") == "W"); _anMD5HashFail->setChecked(_metrics->value("CCANMD5HashAction") == "F"); if (_metrics->value("CCANCurrency") == "TRANS") _anCurrTransaction->setChecked(true); else if (! _metrics->value("CCANCurrency").isEmpty()) { _anCurrFixed->setChecked(true); _anCurrFixedValue->setId(_metrics->value("CCANCurrency").toInt()); } _anUsingWellsFargoSecureSource->setChecked(_metrics->boolean("CCANWellsFargoSecureSource")); _ccYPWinPathPEM->setText(_metrics->value("CCYPWinPathPEM")); _ccYPLinPathPEM->setText(_metrics->value("CCYPLinPathPEM")); _ccYPMacPathPEM->setText(_metrics->value("CCYPMacPathPEM")); _ccYPLinkShield->setChecked(_metrics->boolean("CCYPLinkShield")); _ccYPLinkShieldMax->setValue(_metrics->value("CCYPLinkShieldMax").toInt()); _confirmPreauth->setChecked(_metrics->boolean("CCConfirmPreauth")); _confirmCharge->setChecked(_metrics->boolean("CCConfirmCharge")); _confirmChargePreauth->setChecked(_metrics->boolean("CCConfirmChargePreauth")); _confirmCredit->setChecked(_metrics->boolean("CCConfirmCredit")); _enablePreauth->setChecked(_metrics->boolean("CCEnablePreauth")); _enableCharge->setChecked(_metrics->boolean("CCEnableCharge")); _enableChargePreauth->setChecked(_metrics->boolean("CCEnableChargePreauth")); _enableCredit->setChecked(_metrics->boolean("CCEnableCredit")); _cvvRequired->setChecked(_metrics->boolean("CCRequireCVV")); QString str = _metrics->value("CCCVVCheck"); if (str == "F") _cvvReject->setChecked(true); else if (str == "W") _cvvWarn->setChecked(true); else // if (str == "X") _cvvNone->setChecked(true); str = _metrics->value("CCCVVErrors"); _cvvNotMatch->setChecked(str.contains("N")); _cvvNotProcessed->setChecked(str.contains("P")); _cvvNotOnCard->setChecked(str.contains("S")); _cvvInvalidIssuer->setChecked(str.contains("U")); str = _metrics->value("CCAvsCheck"); if (str == "F") _avsReject->setChecked(true); else if (str == "W") _avsWarn->setChecked(true); else // if (str == "X") _avsNone->setChecked(true); str = _metrics->value("CCAvsAddr"); _avsAddrNotMatch->setChecked(str.contains("N")); _avsAddrNotAvail->setChecked(str.contains("X")); str = _metrics->value("CCAvsZIP"); _avsZIPNotMatch->setChecked(str.contains("N")); _avsZIPNotAvail->setChecked(str.contains("X")); str = _metrics->value("CCTestResult"); if (str == "F") _testsAllFail->setChecked(true); else if (str == "S") _testsSomeFail->setChecked(true); else // if (str == "P") _testsAllPass->setChecked(true); if (0 != _metricsenc) { _ccLogin->setText(_metricsenc->value("CCLogin")); _ccPassword->setText(_metricsenc->value("CCPassword")); _ccProxyLogin->setText(_metricsenc->value("CCProxyLogin")); _ccProxyPassword->setText(_metricsenc->value("CCProxyPassword")); _ccYPStoreNum->setText(_metricsenc->value("CCYPStoreNum")); _anMD5Hash->setText(_metricsenc->value("CCANMD5Hash")); } else { _ccLogin->setEnabled(false); _ccPassword->setEnabled(false); _ccProxyLogin->setEnabled(false); _ccProxyPassword->setEnabled(false); _ccYPStoreNum->setEnabled(false); _anMD5Hash->setEnabled(false); } sDuplicateWindow(_anDuplicateWindow->value()); }
configureCC::configureCC(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { setupUi(this); if (name) setObjectName(name); connect(_anDuplicateWindow, SIGNAL(valueChanged(int)), this, SLOT(sDuplicateWindow(int))); connect(_ccCompany, SIGNAL(currentIndexChanged(int)), this, SLOT(sCCCompanyChanged(int))); _enableChargePreauth->setVisible(false); _enableCredit->setVisible(false); // these ids must match the pages in the stack widget _ccCompany->append(0, "Authorize.Net", "AN"); _ccCompany->append(1, "YourPay", "YP"); _ccCompany->append(2, "CyberSource", "CS"); _ccCompany->append(3, "External", "EXT"); if (_metrics->boolean("CCEnablePaymentech")) _ccCompany->append(4, "Paymentech", "PT"); ConfigCyberSourceProcessor *cs = new ConfigCyberSourceProcessor(this); _configcclist.append(cs); _ccWidgetStack->insertWidget(_ccWidgetStack->indexOf(_externalStack), cs); _ccAccept->setChecked(_metrics->boolean("CCAccept")); _ccTest->setChecked(_metrics->boolean("CCTest")); _ccValidDays->setValue(_metrics->value("CCValidDays").toInt()); _ccCompany->setCurrentIndex(_ccCompany->findText(_metrics->value("CCCompany"))); _ccWidgetStack->setCurrentIndex(_ccCompany->currentIndex()); sCCCompanyChanged(_ccCompany->currentIndex()); _ccServer->setText(_metrics->value("CCServer")); _ccPort->setText(_metrics->value("CCPort")); _ccUseProxyServer->setChecked(_metrics->boolean("CCUseProxyServer")); _ccProxyServer->setText(_metrics->value("CCProxyServer")); _ccProxyPort->setText(_metrics->value("CCProxyPort")); XSqlQuery ccbankq("SELECT * FROM ccbank;"); ccbankq.exec(); while (ccbankq.next()) { if (ccbankq.value("ccbank_ccard_type").toString() == "A") _amexBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); else if (ccbankq.value("ccbank_ccard_type").toString() == "D") _discoverBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); else if (ccbankq.value("ccbank_ccard_type").toString() == "M") _mastercardBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); /* TODO: wait until we support paypal? else if (ccbankq.value("ccbank_ccard_type").toString() == "P") _paypalBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); */ else if (ccbankq.value("ccbank_ccard_type").toString() == "V") _visaBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); } if (ccbankq.lastError().type() != QSqlError::NoError) systemError(this, ccbankq.lastError().text(), __FILE__, __LINE__); if (_metrics->value("CCANVer").isEmpty()) _anVersion->setItemText(0, "3.1"); else _anVersion->setItemText(0, _metrics->value("CCANVer")); _anDelim->setText(_metrics->value("CCANDelim")); _anEncap->setText(_metrics->value("CCANEncap")); _anDuplicateWindow->setValue(_metrics->value("CCANDuplicateWindow").toInt()); _anMD5Hash->setText(_metrics->value("CCANMD5Hash")); _anMD5HashSetOnGateway->setChecked(_metrics->boolean("CCANMD5HashSetOnGateway")); _anMD5HashWarn->setChecked(_metrics->value("CCANMD5HashAction") == "W"); _anMD5HashFail->setChecked(_metrics->value("CCANMD5HashAction") == "F"); if (_metrics->value("CCANCurrency") == "TRANS") _anCurrTransaction->setChecked(true); else if (! _metrics->value("CCANCurrency").isEmpty()) { _anCurrFixed->setChecked(true); _anCurrFixedValue->setId(_metrics->value("CCANCurrency").toInt()); } _anUsingWellsFargoSecureSource->setChecked(_metrics->boolean("CCANWellsFargoSecureSource")); _ccYPWinPathPEM->setText(_metrics->value("CCYPWinPathPEM")); _ccYPLinPathPEM->setText(_metrics->value("CCYPLinPathPEM")); _ccYPMacPathPEM->setText(_metrics->value("CCYPMacPathPEM")); _ccYPLinkShield->setChecked(_metrics->boolean("CCYPLinkShield")); _ccYPLinkShieldMax->setValue(_metrics->value("CCYPLinkShieldMax").toInt()); _confirmPreauth->setChecked(_metrics->boolean("CCConfirmPreauth")); _confirmCharge->setChecked(_metrics->boolean("CCConfirmCharge")); _confirmChargePreauth->setChecked(_metrics->boolean("CCConfirmChargePreauth")); _confirmCredit->setChecked(_metrics->boolean("CCConfirmCredit")); _enablePreauth->setChecked(_metrics->boolean("CCEnablePreauth")); _enableCharge->setChecked(_metrics->boolean("CCEnableCharge")); _enableChargePreauth->setChecked(_metrics->boolean("CCEnableChargePreauth")); _enableCredit->setChecked(_metrics->boolean("CCEnableCredit")); _printReceipt->setChecked(_metrics->boolean("CCPrintReceipt")); _cvvRequired->setChecked(_metrics->boolean("CCRequireCVV")); QString str = _metrics->value("CCCVVCheck"); if (str == "F") _cvvReject->setChecked(true); else if (str == "W") _cvvWarn->setChecked(true); else // if (str == "X") _cvvNone->setChecked(true); str = _metrics->value("CCCVVErrors"); _cvvNotMatch->setChecked(str.contains("N")); _cvvNotProcessed->setChecked(str.contains("P")); _cvvNotOnCard->setChecked(str.contains("S")); _cvvInvalidIssuer->setChecked(str.contains("U")); str = _metrics->value("CCAvsCheck"); if (str == "F") _avsReject->setChecked(true); else if (str == "W") _avsWarn->setChecked(true); else // if (str == "X") _avsNone->setChecked(true); str = _metrics->value("CCAvsAddr"); _avsAddrNotMatch->setChecked(str.contains("N")); _avsAddrNotAvail->setChecked(str.contains("X")); str = _metrics->value("CCAvsZIP"); _avsZIPNotMatch->setChecked(str.contains("N")); _avsZIPNotAvail->setChecked(str.contains("X")); str = _metrics->value("CCTestResult"); if (str == "F") _testsAllFail->setChecked(true); else if (str == "S") _testsSomeFail->setChecked(true); else // if (str == "P") _testsAllPass->setChecked(true); if (0 != _metricsenc) { _ccLogin->setText(_metricsenc->value("CCLogin")); _ccPassword->setText(_metricsenc->value("CCPassword")); _ccProxyLogin->setText(_metricsenc->value("CCProxyLogin")); _ccProxyPassword->setText(_metricsenc->value("CCProxyPassword")); _ccYPStoreNum->setText(_metricsenc->value("CCYPStoreNum")); _ccPTDivisionNumber->setText(_metricsenc->value("CCPTDivisionNumber")); _anMD5Hash->setText(_metricsenc->value("CCANMD5Hash")); } else { _ccLogin->setEnabled(false); _ccPassword->setEnabled(false); _ccProxyLogin->setEnabled(false); _ccProxyPassword->setEnabled(false); _ccYPStoreNum->setEnabled(false); _ccPTDivisionNumber->setEnabled(false); _anMD5Hash->setEnabled(false); } sDuplicateWindow(_anDuplicateWindow->value()); XAbstractConfigure *encryption = new configureEncryption(this); if (encryption) { encryption->setObjectName("_encryption"); _keyPage->layout()->addWidget(encryption); QPushButton *encbutton = encryption->findChild<QPushButton*>("_save"); if (encbutton) encbutton->hide(); encbutton = encryption->findChild<QPushButton*>("_close"); if (encbutton) encbutton->hide(); encryption->show(); } else if (_metricsenc == 0) QMessageBox::critical( this, tr("Cannot Read Configuration"), tr("<p>Cannot read encrypted information from database.")); }