我正在使用Keith Palmer的漂亮php框架:docs / example_online_edition.php与Quickbooks Online Edition帐户进行交互。
我可以检索发票信息,并输入供应商记录(默认示例行为),但我无法输入发票。
我已经下载了sdk v12验证器,并验证了我的xml,但是在quickbooks中没有出现发票。这是删除了登录凭据的网页输出。我在curl之前的Gateway / OnlineEdition.php中有打印语句。没有print语句,我看不到请求msg xml。
删除了连接信息的XXXXX php代码:XXXXX
<?php
/**
* Example of connecting to QuickBooks Online edition via qbXML
*
* IMPORTANT:
* IF YOU ARE BUILDING A SAAS APPLICATION (E.G. YOU ARE ALLOWING MANY OF YOUR
* CUSTOMERS TO CONNECT THEIR COMPANY FILES TO YOUR WEB APPLICATION) THEN THIS
* IS PROBABLY *NOT* THE FILE YOU SHOULD LOOKING AT. You should look at the
* Intuit Partner Platform (and thus the corresponding docs/example_ipp_*.php
* scripts) in this package.
*
*
*
* @author Keith Palmer <keith@ConsoliBYTE.com>
*
* @package QuickBooks
*/
error_reporting(E_ALL);
ini_set('display_errors', '1');
header('Content-Type: text/plain');
require_once dirname(__FILE__) . '/../QuickBooks.php';
// Register in DESKTOP mode to get these. Docs:
// http://www.consolibyte.com/docs/index.php/QuickBooks_Online_via_qbXML#Connecting_with_the_.27Desktop.27_model_of_communication
$application_id = 'goodid';
$application_login = 'goodLogin';
$connection_ticket = 'goodTicket';
// Create our new gateway instance
$Gateway = new QuickBooks_Gateway_OnlineEdition(
$application_id,
$application_login,
$connection_ticket);
// Get RefNumber 1014
$xml =
'<QBXMLMsgsRq onError="stopOnError">
<InvoiceQueryRq>
<RefNumber>1014</RefNumber>
</InvoiceQueryRq>
</QBXMLMsgsRq>';
// Send the request
$resp = $Gateway->qbxml($xml);
print($resp);
print("\n\n\n\n");
$xml = '<QBXMLMsgsRq onError="stopOnError">
<InvoiceAddRq requestID="1">
<InvoiceAdd>
<CustomerRef>
<ListID>2</ListID>
</CustomerRef>
<InvoiceLineAdd>
<ItemRef>
<FullName>Sales</FullName>
</ItemRef>
<Desc>Item1escriptionGoesHere</Desc>
<Amount>29.50</Amount>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>';
// Send the request
$resp = $Gateway->qbxml($xml);
print($resp);
print('\n\n\n\nLast print in file');
?>
XXXXX结束php代码XXXXX
XXXXX输出开始(已删除登录)XXXXX
<?xml version="1.0" ?>
<?qbxml version="6.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceQueryRq>
<RefNumber>1014</RefNumber>
</InvoiceQueryRq>
</QBXMLMsgsRq></QBXML>
XXXXX成功回复:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE QBXML PUBLIC "-//INTUIT//DTD QBXML QBO 6.0//EN" "http://apps.quickbooks.com/dtds/qbxmlops60.dtd">
<QBXML>
<QBXMLMsgsRs>
<InvoiceQueryRs statusCode="0" statusMessage="Status OK" statusSeverity="Info">
<InvoiceRet>
<TxnID>19</TxnID>
<TimeCreated>2013-09-11T21:06:33</TimeCreated>
<TimeModified>2013-09-11T21:17:54</TimeModified>
<EditSequence>0</EditSequence>
<TxnNumber>19</TxnNumber>
<CustomerRef>
<ListID>3</ListID>
<FullName>Willy Wonka #442:Bertha Linebacker</FullName>
</CustomerRef>
<ARAccountRef>
<ListID>48</ListID>
<FullName>Accounts Receivable (A/R)</FullName>
</ARAccountRef>
<TxnDate>2013-09-11</TxnDate>
<RefNumber>1014</RefNumber>
<BillAddress>
<Addr1>111 Main</Addr1>
<City>Denver</City>
<State>CO</State>
<PostalCode>98310</PostalCode>
</BillAddress>
<ShipAddress>
<Addr1>111 Main</Addr1>
<City>Denver</City>
<State>CO</State>
<PostalCode>98310</PostalCode>
</ShipAddress>
<DueDate>2013-09-26</DueDate>
<Subtotal>70.00</Subtotal>
<SalesTaxPercentage>0</SalesTaxPercentage>
<AppliedAmount>0.00</AppliedAmount>
<BalanceRemaining>70.00</BalanceRemaining>
<IsPaid>false</IsPaid>
<IsToBePrinted>true</IsToBePrinted>
<InvoiceLineRet>
<TxnLineID>1</TxnLineID>
<ItemRef>
<ListID>1</ListID>
<FullName>Sales</FullName>
</ItemRef>
<Desc>tire storage (season)
RO# 57, Bertha</Desc>
<Amount>70.00</Amount>
<IsTaxable>false</IsTaxable>
</InvoiceLineRet>
</InvoiceRet>
</InvoiceQueryRs>
</QBXMLMsgsRs>
</QBXML>
XXXXX请求添加发票:注意客户'2'是有效客户
<?xml version="1.0" ?>
<?qbxml version="6.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceAddRq requestID="1">
<InvoiceAdd>
<CustomerRef>
<ListID>2</ListID>
</CustomerRef>
<InvoiceLineAdd>
<ItemRef>
<FullName>Sales</FullName>
</ItemRef>
<Desc>Item1escriptionGoesHere</Desc>
<Amount>29.50</Amount>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq></QBXML>
</QBXMLMsgsRq></QBXML>
[41] =>
[42] => 1
[64] =>
[81] => 0
)
\n\n\n\nLast print in file
XXXXXXXXX输出结束
服务器显然没有对addInvoice请求做出响应。
非常感谢任何有助于解决这个谜团的帮助!
另外,假设我最终可以输入发票,我是否可以在IPP API中编写我可以写的字段? 我在某一点上得到的以下错误消息并不令人鼓舞:
org.xml.sax.SAXParseException:元素类型的内容 “InvoiceAdd”必须匹配 “(CustomerRef,ClassRef?,ARAccountRef?,TemplateRef?,TxnDate?,RefNumber?,BillAddress?,ShipAddress?,IsPending?,采购单号码?,TermsRef?,交货期?,SalesRepRef?,FOB?,并按ShipDate?,ShipMethodRef?,ItemSalesTaxRef ?,备注CustomerMsgRef,IsToBePrinted,IsToBeEmailed,IsTaxIncluded,CustomerSalesTaxCodeRef其他,LinkToTxnID *,(InvoiceLineAdd | InvoiceLineGroupAdd)??????????*,DiscountLineAdd,SalesTaxLineAdd,ShippingLineAdd)“
非常感谢!
答案 0 :(得分:0)
试试这个
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="5.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<InvoiceAddRq requestID="SW52b2ljZUFkZHw1NA==">
<InvoiceAdd>
<CustomerRef>
<ListID>90001-1263558758</ListID>
<FullName>Testy McTesterson</FullName>
</CustomerRef>
<TxnDate>2010-01-15</TxnDate>
<RefNumber>21011</RefNumber>
<BillAddress>
<Addr1>ConsoliBYTE, LLC</Addr1>
<Addr2>134 Stonemill Road</Addr2>
<Addr3 />
<City>Mansfield</City>
<State>CT</State>
<PostalCode>06268</PostalCode>
<Country>United States</Country>
</BillAddress>
<ShipAddress>
<Addr1>ConsoliBYTE, LLC</Addr1>
<Addr2>Attn: Keith Palmer</Addr2>
<Addr3>56 Cowles Road</Addr3>
<City>Willington</City>
<State>CT</State>
<PostalCode>06279</PostalCode>
<Country>United States</Country>
</ShipAddress>
<TermsRef>
<FullName>Net 30</FullName>
</TermsRef>
<SalesRepRef>
<FullName>KRP</FullName>
</SalesRepRef>
<Memo>Test memo goes here.</Memo>
<InvoiceLineAdd>
<ItemRef>
<FullName>test</FullName>
</ItemRef>
<Desc>Test item description</Desc>
<Quantity>1.00000</Quantity>
<Rate>15.00000</Rate>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>
您可以将您的Authorize.net发票(http://www.fetchflow.com/blog/how-do-i-integrate-payments-with-authorize-net)帐户与fetchflow.com集成,以便您的客户可以通过网络发票在线付款。