在Quickbooks PHP中执行项目检查代码


Executing Item check code in Quickbooks PHP

我正在QuickBooks中开发PHP API。我已经创建了一些页面,他们都与我的沙箱帐户工作。但是当我试图为真实账户做同样的事情时,它给了我错误。我已经改变了变量$sandbox=true到$sandbox=false在config.php

下面是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

您是否在将$sandbox更改为FALSE后重新连接到您的实时QuickBooks ?

你需要,而且看起来你没有……