0
我正在使用QuickBooks中的PHP API。我創建了一些網頁,他們都使用我的沙盒帳戶。但是當我試圖爲真實賬戶做同樣的事情時,它給了我錯誤。我已經在config.php執行Quickbooks中的項目檢查代碼PHP
下面改變變量$沙箱= true以$沙箱=假是itemchk.php
<?php
//require_once dirname(__FILE__) . '/views/header.tpl.php';
header('Content-Type: text/xml');
$tokenval = '';
$customerkey = '';
$customersecreat = '';
if(isset($_POST['tokenval']) && $_POST['tokenval'] != ''){
$tokenval = $_POST['tokenval'];
}
if(isset($_POST['customerkey']) && $_POST['customerkey'] != ''){
$customerkey = $_POST['customerkey'];
}
if(isset($_POST['customersecreat']) && $_POST['customersecreat'] != ''){
$customersecreat = $_POST['customersecreat'];
}
$quers = "ItemChkQueryRs";
if(trim($tokenval) != "" && trim($customerkey) != "" && trim($customersecreat) != ""){
require_once dirname(__FILE__) . '/config1.php';
$ItemService = new QuickBooks_IPP_Service_Item();
if(isset($_POST['Itemname']) && $_POST['Itemname'] != ''){
$Itemname=$_POST['Itemname'];
$Items = $ItemService->query($Context, $realm, "SELECT * FROM Item where name='".$Itemname."' ");
if (count($Items)){
$status = 'Success';
$statuscode = '0';
$status_message = 'Item Exist';
$Item = $Items[0];
$txnid = $Item->getId();
$txnid = str_replace("{-", "", $txnid);
$txnid = str_replace("}", "", $txnid);
}
else{
$statuscode = '0';
$status_message = 'Item does not Exist';
}
}
else{
$statuscode = '1';
$status_message = 'Item Name Missing';
}
include_once "show_xml1.php";
}
else{
$statuscode = '1';
$status_message = 'Missing Authentication Details';
include_once "show_xml1.php";
}
?>
代碼在執行此頁我得到的錯誤是
Notice: Undefined variable: Context in /home2/ultrasou/public_html/garg.com/quickbooks/ItemChk1.php on line 27
Notice: Undefined variable: realm in /home2/ultrasou/public_html/garg.com/quickbooks/ItemChk1.php on line 27
Fatal error: Call to a member function IPP() on a non-object in /home2/ultrasou/public_html/garg.com/quickbooks/QuickBooks/IPP/Service.php on line 829
它現在沒有工作。我再次面臨同樣的問題。 – Phani
所以它第一次工作,你標記爲答案,現在突然第一次沒有工作?請澄清。 –
早些時候工作的人說它很好。所以我將它標記爲答案。現在他們說,他們當時還沒有測試過現場。你能告訴我如何重新連接,以及如何驗證連接是否有效? – Phani