当前位置: 首页>>代码示例>>C++>>正文


C++ CreditCardProcessor::checkConfiguration方法代码示例

本文整理汇总了C++中CreditCardProcessor::checkConfiguration方法的典型用法代码示例。如果您正苦于以下问题:C++ CreditCardProcessor::checkConfiguration方法的具体用法?C++ CreditCardProcessor::checkConfiguration怎么用?C++ CreditCardProcessor::checkConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CreditCardProcessor的用法示例。


在下文中一共展示了CreditCardProcessor::checkConfiguration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: precheckCreditCard

void arWorkBench::precheckCreditCard()
{
  CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor();

  if (cardproc->checkConfiguration() < 0)
  {
    QMessageBox::warning( this, tr("Credit Card Error"),
			  cardproc->errorMsg() );
    _CCAmount->setFocus();
    _passPrecheck = false;
  }

  q.prepare( "SELECT ccpay.*, "
             "       ccard_active, "
             "       formatbytea(decrypt(setbytea(ccard_number), setbytea(:key), 'bf')) AS ccard_number,"
             "       formatccnumber(decrypt(setbytea(ccard_number), setbytea(:key), 'bf')) AS ccard_number_x,"
             "       formatbytea(decrypt(setbytea(ccard_month_expired), setbytea(:key), 'bf')) AS ccard_month_expired,"
             "       formatbytea(decrypt(setbytea(ccard_year_expired), setbytea(:key), 'bf')) AS ccard_year_expired, "
             "       ccard_type "
             "FROM ccpay, ccard "
             "WHERE ((ccpay_ccard_id=ccard_id) "
             " AND (ccpay_id=:ccpay_id));");
  q.bindValue(":ccpay_id", _preauth->id());
  q.bindValue(":key",key);
  q.exec();
  q.first();
  
  _ccActive = q.value("ccard_active").toBool();
  
  if (!_ccActive)
  {
    QMessageBox::warning( this, tr("Invalid Credit Card"),
                          tr("The Credit Card you are attempting to use is not active.") );
    _CCAmount->setFocus();
    _passPrecheck = false;
    return;
  }
  
  _ccard_type = q.value("ccard_type").toString();
  _ccard_number = q.value("ccard_number").toString();
  _ccard_month_expired = q.value("ccard_month_expired").toInt();
  _ccard_year_expired = q.value("ccard_year_expired").toInt();
  _ccard_type = q.value("ccard_type").toString();
  _backrefnum = q.value("ccpay_yp_r_ordernum").toString();
  
  YourPay = false;
  VeriSign = false;
  
  if (_metrics->value("CCServer") == "test-payflow.verisign.com"  ||  _metrics->value("CCServer") == "payflow.verisign.com") 
  {
    VeriSign = true; 
  }
  
  if (_metrics->value("CCServer") == "staging.linkpt.net"  ||  _metrics->value("CCServer") == "secure.linkpt.net") 
  {
    YourPay = true; 
  }
  
  if (!YourPay && !VeriSign)
  {
    QMessageBox::warning( this, tr("Invalid Credit Card Service Selected"),
                            tr("OpenMFG only supports YourPay and VeriSign.  You have not selected either of these as your credit card processors.") );
    _CCAmount->setFocus();
    _passPrecheck = false;
    return;
  }
  
  if (YourPay)
  {
    // Set up all of the YourPay parameters
    _storenum = _metricsenc->value("CCYPStoreNum");
     
#ifdef Q_WS_WIN
    _pemfile = _metrics->value("CCYPWinPathPEM");
#elif defined Q_WS_MACX
    _pemfile = _metrics->value("CCYPMacPathPEM");
#elif defined Q_WS_X11
    _pemfile = _metrics->value("CCYPLinPathPEM");
#endif
      
    if (_CCAmount->baseValue() <= 0)
    {
      QMessageBox::warning( this, tr("Charge Amount Missing or incorrect"),
                            tr("The Charge Amount must be greater than 0.00") );
      _CCAmount->setFocus();
      _passPrecheck = false;
      return;
    }
    
    configfile = new char[strlen(_storenum.latin1()) + 1];
    strcpy(configfile, _storenum.latin1());
    host = new char[strlen(_metrics->value("CCServer").latin1()) + 1];
    strcpy(host, _metrics->value("CCServer").latin1());
    pemfile = new char[strlen(_pemfile.latin1()) + 1];
    strcpy(pemfile, _pemfile.latin1());
  }
}
开发者ID:,项目名称:,代码行数:97,代码来源:


注:本文中的CreditCardProcessor::checkConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。