2017-08-12 38 views
2

我使用Xero的用于生成发票,现在我想用Xero的发票编号在PHP中得到发票,我的代码是...........使用xero api的发票ID在我的网站上获得发票?

$nik = $xero->load('Accounting\\Invoice') 
     ->where('InvoiceID', $outwardRecord->xero_invoice_id) 
     or 
     ->where('InvoiceID', \XeroPHP\Models\Accounting\Invoice::InvoiceID) 
     ->execute(); 

,但它给了错误

Fatal error: Undefined class constant 'InvoiceID' in /var/w 

请指导我如何使用invoiceId获取发票,如何理解我的问题。

谢谢!

回答

0

感谢所有,

最后我得到了答案,

$xero_api_config = getCustomConfigItem('xero_api_config'); 
$xero = new \XeroPHP\Application\PrivateApplication($xero_api_config); 
$response=$xero->loadByGUID('Accounting\\Invoice',$xero_invoice_id); 
print_r($response); 

它的工作!