本文整理汇总了C++中CreditCardProcessor::testConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C++ CreditCardProcessor::testConfiguration方法的具体用法?C++ CreditCardProcessor::testConfiguration怎么用?C++ CreditCardProcessor::testConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreditCardProcessor
的用法示例。
在下文中一共展示了CreditCardProcessor::testConfiguration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AuthorizeDotNetProcessor
// pcompany should be "" except when checking for errors in configCC
CreditCardProcessor * CreditCardProcessor::getProcessor(const QString pcompany)
{
if (DEBUG)
qDebug("CCP:getProcessor(%s)", pcompany.toAscii().data());
if (pcompany == "Authorize.Net")
return new AuthorizeDotNetProcessor();
else if (pcompany == "Verisign")
return new VerisignProcessor();
else if (pcompany == "YourPay")
return new YourPayProcessor();
else if (! pcompany.isEmpty())
{
_errorMsg = errorMsg(-14).arg(pcompany);
return 0;
}
CreditCardProcessor *processor = 0;
if (_metrics->value("CCCompany") == "Authorize.Net")
processor = new AuthorizeDotNetProcessor();
else if (_metrics->value("CCCompany") == "Verisign")
processor = new VerisignProcessor();
else if ((_metrics->value("CCCompany") == "YourPay"))
processor = new YourPayProcessor();
else
_errorMsg = errorMsg(-14).arg(_metrics->value("CCServer"));
// reset to 0 if the config is bad and we're not configuring the system
if (processor && processor->testConfiguration() != 0 && pcompany.isEmpty())
{
delete processor;
processor = 0;
}
if (processor)
processor->reset();
return processor;
}
示例2: sSave
//.........这里部分代码省略.........
_metrics->set("CCYPMacPathPEM", _ccYPMacPathPEM->text());
_metrics->set("CCYPLinkShield", _ccYPLinkShield->isChecked());
_metrics->set("CCYPLinkShieldMax", _ccYPLinkShieldMax->text());
_metrics->set("CCConfirmPreauth", _confirmPreauth->isChecked());
_metrics->set("CCConfirmCharge", _confirmCharge->isChecked());
_metrics->set("CCConfirmChargePreauth", _confirmChargePreauth->isChecked());
_metrics->set("CCConfirmCredit", _confirmCredit->isChecked());
_metrics->set("CCEnablePreauth", _enablePreauth->isChecked());
_metrics->set("CCEnableCharge", _enableCharge->isChecked());
_metrics->set("CCEnableChargePreauth", _enableChargePreauth->isChecked());
_metrics->set("CCEnableCredit", _enableCredit->isChecked());
_metrics->set("CCRequireCVV", _cvvRequired->isChecked());
if(_cvvNone->isChecked())
_metrics->set("CCCVVCheck", QString("X"));
else if(_cvvWarn->isChecked())
_metrics->set("CCCVVCheck", QString("W"));
else if(_cvvReject->isChecked())
_metrics->set("CCCVVCheck", QString("F"));
if(_avsNone->isChecked())
_metrics->set("CCAvsCheck", QString("X"));
else if(_avsWarn->isChecked())
_metrics->set("CCAvsCheck", QString("W"));
else if(_avsReject->isChecked())
_metrics->set("CCAvsCheck", QString("F"));
QString str;
if (_cvvNotMatch->isChecked())
str += "N";
if (_cvvNotProcessed->isChecked())
str += "P";
if (_cvvNotOnCard->isChecked())
str += "S";
if (_cvvInvalidIssuer->isChecked())
str += "U";
_metrics->set("CCCVVErrors", str);
if (_avsAddrNotMatch->isChecked() && _avsAddrNotAvail->isChecked())
_metrics->set("CCAvsAddr", QString("NX"));
else if (_avsAddrNotMatch->isChecked())
_metrics->set("CCAvsAddr", QString("N"));
else if (_avsAddrNotAvail->isChecked())
_metrics->set("CCAvsAddr", QString("X"));
if (_avsZIPNotMatch->isChecked() && _avsZIPNotAvail->isChecked())
_metrics->set("CCAvsZIP", QString("NX"));
else if (_avsZIPNotMatch->isChecked())
_metrics->set("CCAvsZIP", QString("N"));
else if (_avsZIPNotAvail->isChecked())
_metrics->set("CCAvsZIP", QString("X"));
if(_testsAllFail->isChecked())
_metrics->set("CCTestResult", QString("F"));
else if(_testsSomeFail->isChecked())
_metrics->set("CCTestResult", QString("S"));
else if(_testsAllPass->isChecked())
_metrics->set("CCTestResult", QString("P"));
_metrics->load();
if (0 != _metricsenc)
{
_metricsenc->set("CCLogin", _ccLogin->text());
_metricsenc->set("CCPassword", _ccPassword->text());
_metricsenc->set("CCProxyLogin", _ccProxyLogin->text());
_metricsenc->set("CCProxyPassword", _ccProxyPassword->text());
_metricsenc->set("CCYPStoreNum", _ccYPStoreNum->text());
_metricsenc->set("CCANMD5Hash", _anMD5Hash->text());
_metricsenc->load();
}
CreditCardProcessor *cardproc =
CreditCardProcessor::getProcessor(_ccCompany->currentText());
if (! cardproc)
{
QMessageBox::warning(this, tr("Error getting Credit Card Processor"),
tr("<p>Internal error finding the right Credit Card "
"Processor. The application saved what it could "
"but you should re-open this window and double-"
"check all of the settings before continuing."));
}
else if (cardproc && cardproc->testConfiguration() != 0)
{
if (QMessageBox::question(this, tr("Invalid Credit Card Configuration"),
tr("<p>The configuration has been saved but "
"at least one configuration option appears "
"to be invalid:<p>%1"
"<p>Would you like to fix it now?")
.arg(cardproc->errorMsg()),
QMessageBox::Yes | QMessageBox::Default,
QMessageBox::No) == QMessageBox::Yes)
return;
}
accept();
}
示例3: sSave
//.........这里部分代码省略.........
_metrics->set("CCPrintReceipt", _printReceipt->isChecked());
_metrics->set("CCRequireCVV", _cvvRequired->isChecked());
if(_cvvNone->isChecked())
_metrics->set("CCCVVCheck", QString("X"));
else if(_cvvWarn->isChecked())
_metrics->set("CCCVVCheck", QString("W"));
else if(_cvvReject->isChecked())
_metrics->set("CCCVVCheck", QString("F"));
if(_avsNone->isChecked())
_metrics->set("CCAvsCheck", QString("X"));
else if(_avsWarn->isChecked())
_metrics->set("CCAvsCheck", QString("W"));
else if(_avsReject->isChecked())
_metrics->set("CCAvsCheck", QString("F"));
QString str;
if (_cvvNotMatch->isChecked())
str += "N";
if (_cvvNotProcessed->isChecked())
str += "P";
if (_cvvNotOnCard->isChecked())
str += "S";
if (_cvvInvalidIssuer->isChecked())
str += "U";
_metrics->set("CCCVVErrors", str);
if (_avsAddrNotMatch->isChecked() && _avsAddrNotAvail->isChecked())
_metrics->set("CCAvsAddr", QString("NX"));
else if (_avsAddrNotMatch->isChecked())
_metrics->set("CCAvsAddr", QString("N"));
else if (_avsAddrNotAvail->isChecked())
_metrics->set("CCAvsAddr", QString("X"));
if (_avsZIPNotMatch->isChecked() && _avsZIPNotAvail->isChecked())
_metrics->set("CCAvsZIP", QString("NX"));
else if (_avsZIPNotMatch->isChecked())
_metrics->set("CCAvsZIP", QString("N"));
else if (_avsZIPNotAvail->isChecked())
_metrics->set("CCAvsZIP", QString("X"));
if(_testsAllFail->isChecked())
_metrics->set("CCTestResult", QString("F"));
else if(_testsSomeFail->isChecked())
_metrics->set("CCTestResult", QString("S"));
else if(_testsAllPass->isChecked())
_metrics->set("CCTestResult", QString("P"));
_metrics->load();
if (0 != _metricsenc)
{
_metricsenc->set("CCLogin", _ccLogin->text());
_metricsenc->set("CCPassword", _ccPassword->text());
_metricsenc->set("CCProxyLogin", _ccProxyLogin->text());
_metricsenc->set("CCProxyPassword", _ccProxyPassword->text());
_metricsenc->set("CCYPStoreNum", _ccYPStoreNum->text());
_metricsenc->set("CCPTDivisionNumber", _ccPTDivisionNumber->text());
_metricsenc->load();
}
for (int i = 0; i < _configcclist.size(); i++)
if (! _configcclist.at(i)->sSave())
return false;
if (_ccAccept->isChecked())
{
CreditCardProcessor *cardproc =
CreditCardProcessor::getProcessor(_ccCompany->currentText());
if (! cardproc)
{
QMessageBox::warning(this, tr("Error getting Credit Card Processor"),
tr("<p>Internal error finding the right Credit Card "
"Processor. The application saved what it could "
"but you should re-open this window and double-"
"check all of the settings before continuing."));
}
else if (cardproc && cardproc->testConfiguration() != 0)
{
if (QMessageBox::question(this, tr("Invalid Credit Card Configuration"),
tr("<p>The configuration has been saved but "
"at least one configuration option appears "
"to be invalid:<p>%1"
"<p>Would you like to fix it now?")
.arg(cardproc->errorMsg()),
QMessageBox::Yes | QMessageBox::Default,
QMessageBox::No) == QMessageBox::Yes)
return false;
}
}
configureEncryption *encryption = _keyPage->findChild<configureEncryption*>("_encryption");
if (encryption && ! encryption->sSave())
return false;
return true;
}