我正在尝试使用以下 github 存储库集成 quickbook 桌面版本:
https://github.com/consolibyte/quickbooks-php
但是当我使用您的示例代码(即 mydomain.com/qb_desktop/docs/web_connector/customer.php)创建自定义新文件以从我们的网站将客户创建到 QB 桌面应用程序中时
在 Web 连接器中添加此文件并运行此文件后,它会继续运行并不断创建新的无限客户,直到我在 php 脚本中添加“die”以强制停止此操作。
你能看看我下面的代码,让我知道我在这里到底做错了什么吗?
提前致谢。
<?php
$primary_key_of_your_customer = 5;
require_once '../../QuickBooks.php';
$user = 'user';
$pass = 'password';
$map = array(QUICKBOOKS_ADD_CUSTOMER => array( '_quickbooks_customer_add_request', '_quickbooks_customer_add_response'));
$errmap = array( 3070 => '_quickbooks_error_stringtoolong');
$hooks = array();
$log_level = QUICKBOOKS_LOG_DEBUG;
$soapserver = QUICKBOOKS_SOAPSERVER_BUILTIN;
$soap_options = array();
$handler_options = array('deny_concurrent_logins' => false,
'deny_reallyfast_logins' => false);
$driver_options = array();
$callback_options = array();
$dsn = 'mysqli://root:password@localhost/quickbooks';
$Server = new QuickBooks_WebConnector_Server($dsn, $map, $errmap, $hooks, $log_level, $soapserver, QUICKBOOKS_WSDL, $soap_options, $handler_options, $driver_options, $callback_options);
$response = $Server->handle(true, true);
$Queue = new QuickBooks_WebConnector_Queue($dsn);
$Queue->enqueue(QUICKBOOKS_ADD_CUSTOMER, $primary_key_of_your_customer);
function _quickbooks_customer_add_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale)
{
$xml = '<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="2.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<CustomerAddRq requestID="' . $requestID . '">
<CustomerAdd>
<Name>ConsoliBYTE, LLC (' . mt_rand() . ')</Name>
撒科打诨