Fetching all Bill Payment Check from Quickbooks database

天涯浪子 提交于 2019-12-24 11:37:18

问题


I want to fetch all the bill payment checks from quickbooks database. Iam using PHP Quickbooks dev kit 2.0. I created a request query like this, but web connector showing error.

  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;
  }   

And request code is like :-

       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;

}

Is their anything wrong with this code?? please help??


回答1:


K... I got it , In the response code

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

changed to

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

It worked fine...



来源:https://stackoverflow.com/questions/28146720/fetching-all-bill-payment-check-from-quickbooks-database

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!