【发布时间】:2014-05-01 14:57:54
【问题描述】:
我正在使用我的网络服务器中的 IPP_V3 连接到 Quicbooks。
我正在尝试实现example_payment_add.php
通过将付款分配给发票来添加付款时,我遇到了业务验证错误。
我什至按照以下页面中的说明更改了分配值的顺序:
(最后一点:Lines被接收的顺序就是Lines被保留的顺序。)
注意:只需向客户添加付款,而不将其分配给客户,即可。
错误: 6000:[处理您的请求时发生业务验证错误,业务验证错误:意外内部错误。 (-30035)]
代码:
require_once dirname(__FILE__) . '/config.php';
require_once dirname(__FILE__) . '/views/header.tpl.php';
?>
<pre>
<?php
// Set up the IPP instance
$IPP = new QuickBooks_IPP($dsn);
// Get our OAuth credentials from the database
$creds = $IntuitAnywhere->load($the_username, $the_tenant);
// Tell the framework to load some data from the OAuth store
$IPP->authMode(
QuickBooks_IPP::AUTHMODE_OAUTH,
$the_username,
$creds);
// Print the credentials we're using
//print_r($creds);
// This is our current realm
$realm = $creds['qb_realm'];
// Load the OAuth information from the database
if ($Context = $IPP->context())
{
// Set the IPP version to v3
$IPP->version(QuickBooks_IPP_IDS::VERSION_3);
$PaymentService = new QuickBooks_IPP_Service_Payment();
// Create payment object
$Payment = new QuickBooks_IPP_Object_Payment();
$Payment->setTxnDate('2014-04-04');
// Create line for payment (this details what it's applied to)
$Line = new QuickBooks_IPP_Object_Line();
$Line->setAmount(1);
// The line has a LinkedTxn node which links to the actual invoice
$LinkedTxn = new QuickBooks_IPP_Object_LinkedTxn();
$LinkedTxn->setTxnId('10001'); //real invoice number in quickbooks
$LinkedTxn->setTxnType('Invoice');
$Line->setLinkedTxn($LinkedTxn);
$Payment->addLine($Line);
$Payment->setCustomerRef('876');
$Payment->setPaymentRefNum('8762393');
$Payment->setTotalAmt(1);
// Send payment to QBO
if ($resp = $PaymentService->add($Context, $realm, $Payment))
{
print('Our new Payment ID is: [' . $resp . ']');
}
else
{
print($PaymentService->lastError());
}
/*
print('<br><br><br><br>');
print("\n\n\n\n\n\n\n\n");
print('Request [' . $IPP->lastRequest() . ']');
print("\n\n\n\n");
print('Response [' . $IPP->lastResponse() . ']');
print("\n\n\n\n\n\n\n\n\n");
*/
}
else
{
die('Unable to load a context...?');
}
?>
</pre>
<?php
require_once dirname(__FILE__) . '/views/footer.tpl.php';
【问题讨论】:
标签: php api quickbooks intuit-partner-platform quickbooks-online