Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions QuickBooks/WebConnector/Handlers.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ protected function _defaults($config)
'deny_reallyfast_timeout' => 600,

'masking' => true,

'status_error_threshold' => 1, // the lowest status code considered an error
);

$config = array_merge($defaults, $config);
Expand Down Expand Up @@ -347,6 +349,8 @@ protected function _defaults($config)
$config['deny_reallyfast_logins'] = (boolean) $config['deny_reallyfast_logins'];
$config['deny_reallyfast_timeout'] = (int) max(1, $config['deny_reallyfast_timeout']);

$config['status_error_threshold'] = (int) max(1, $config['status_error_threshold']);

return $config;
}

Expand Down Expand Up @@ -1287,8 +1291,9 @@ public function receiveResponseXML($obj)
$this->_log('Incoming XML response: ' . $obj->response, $obj->ticket, QUICKBOOKS_LOG_DEBUG);

// Check if we got a error message...
if (strlen($obj->message) or
$this->_extractStatusCode($obj->response)) // or an error code
if (strlen($obj->message) or
$this->_extractStatusCode($obj->response)
>= $this->_config['status_error_threshold']) // or an error code
{
//$this->_log('Extracted code[' . $this->_extractStatusCode($obj->response) . ']', $obj->ticket, QUICKBOOKS_LOG_DEBUG);

Expand Down