我对Kashflow很陌生,但我正在尝试将其集成到我一直在开发的CRM中。目前,我正在尝试创建一个发票,然后使用InsertInvoice调用通过API将其推送到Kashflow。
这是我用来创建测试发票的代码:
$kashflow = new Kashflow($username,$password);
// Initialise the invoice.
$invoice = new KashflowInvoice($kashflow_customer_id,$invoice_number,$invoice_date,$due_date);
// Add a line to the invoice: 1 unit, with a unit price of £10 @ 20% VAT.
$invoice->addLine(1,10,2,20,$nominal_id,"Test invoice item");
// Now insert the invoice on Kashflow.
$response = $kashflow->insertInvoice($invoice);
addLine()只是将条目添加到发票中,然后insertInvoice()方法如下:
public function insertInvoice(KashflowInvoice $invoice)
{
$lines = $this->prepareInvoiceLines($invoice->getLines());
$parameters['Inv'] = array
(
// parameters here...
);
return $this->makeRequest("InsertInvoice",$parameters);
}
其中,所有"参数"都是Kashflow的必需参数。
当我运行脚本时,我得到以下异常输出:
未处理的异常:SOAP-ERROR:编码:对象没有"UseCustomDeliveryAddress"属性
我的类或文件中没有名为UseCustomDeliveryAddress的属性,也找不到Kashflow API文档中记录的属性,这让我怀疑它是否已被弃用,但仍在某个地方被引用?
有没有其他人遇到这个问题并设法解决了它?
提前感谢Michael
好吧,我想明白了。基本上,我使用的示例需要将UseCustomDeliveryAddress传递给API,不管它是真是假。
引用自https://securedwebapp.com/api/service.asmx?op=InsertInvoice