获取从QuickBooks数据库中的所有缴费检查(Fetching all Bill Payment

2019-10-21 16:23发布

我想获取从QuickBooks数据库中的所有账单支付支票。 IAM使用PHP的Quickbooks开发套件2.0。 我创造了这样的请求查询,但网络连接显示错误。

  function _quickbooks_billpaymentcheck_query_request($requestID, $user,       $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale)
  {

 $xml = '<?xml version="1.0" encoding="utf-8"?>
     <?qbxml version="2.0"?>
     <QBXML>
        <QBXMLMsgsRq onError="stopOnError">
    <BillPaymentCheckQueryRq  requestID="' . $requestID . '">

               <FromModifiedDate>1990-01-01T00:00:00</FromModifiedDate>
                <OwnerID>0</OwnerID>
            </BillPaymentCheckQueryRq>  
        </QBXMLMsgsRq>
      </QBXML>';

  return $xml;
  }   

并请求代码如下: -

       function _quickbooks_billpaymentcheck_query_response($requestID, $user,  $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents)
     {  
          $errnum = 0;
          $errmsg = '';
          $Parser = new QuickBooks_XML_Parser($xml);
        if ($Doc = $Parser->parse($errnum, $errmsg))
         {
           $Root = $Doc->getRoot();
          $List = $Root->getChildAt('QBXML/QBXMLMsgsRs/BillPaymentCheckRs');
             foreach($List->children() as $BillPaymentCheck)
               {
        $TxnID=$BillPaymentCheck->getChildDataAt('BillPaymentCheckRet  TxnID');



    }
       }

return true;

}

难道自己什么毛病此代码? 请帮忙??

Answer 1:

ķ...我知道了,在响应代码

$List = $Root->getChildAt('QBXML/QBXMLMsgsRs/BillPaymentCheckRs');

变成

$List = $Root->getChildAt('QBXML/QBXMLMsgsRs/BillPaymentCheckQueryRs');

它工作得很好...



文章来源: Fetching all Bill Payment Check from Quickbooks database