我正在使用Keith Palmer的漂亮的php框架: docs/example_ Online _edition.php来与Quickbook在线版帐户进行交互。
我可以检索发票信息,并输入供应商记录(默认示例行为),但不能输入发票。
我已经下载了sdk验证器,并验证了我的v12,但quickbooks中没有发票。这是我删除登录凭据后的网页输出。我在Gateway/OnlineEdition.php中的curl之前有print语句。如果没有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 fileXXXXXXXXX输出结束
服务器显然没有响应addInvoice请求。
任何帮助解开这个谜团的人都将不胜感激!
另外,假设我最终可以输入发票,我是否能够在IPP API中编写和字段?我在某一时刻得到的以下错误消息并不是很令人振奋:
org.xml.sax.SAXParseException:元素类型"InvoiceAdd“的内容必须匹配"(CustomerRef,ClassRef?,ARAccountRef?,TemplateRef?,TxnDate?,RefNumber?,BillAddress?,ShipAddress?,IsPending?,PONumber?,TermsRef?,DueDate?,SalesRepRef?,FOB?,ShipDate?,ShipMethodRef?,ItemSalesTaxRef?,Memo?,CustomerMsgRef?,Other?,LinkToTxnID*,(InvoiceLineAdd|InvoiceLineGroupAdd)*,?)”
非常感谢!
发布于 2014-06-03 18:17:55
尝尝这个
<?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 Invoice ( http://www.fetchflow.com/blog/how-do-i-integrate-payments-with-authorize-net )帐户与fetchflow.com集成,这样您的客户就可以通过Web发票在线向您付款。
https://stackoverflow.com/questions/18792770
复制相似问题