_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q256000
QuickBooks_Driver.authResolve
test
final public function authResolve($ticket) { $err = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_AUTHRESOLVE, $ticket, $err, array()); return $this->_authResolve($ticket); }
php
{ "resource": "" }
q256001
QuickBooks_Driver.authCheck
test
final public function authCheck($ticket) { $err = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_AUTHCHECK, $ticket, $err, array()); return $this->_authCheck($ticket); }
php
{ "resource": "" }
q256002
QuickBooks_Driver.authLogout
test
final public function authLogout($ticket) { $err = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_AUTHLOGOUT, $ticket, $err, array()); return $this->_authLogout($ticket); }
php
{ "resource": "" }
q256003
QuickBooks_Driver.authCreate
test
final public function authCreate($username, $password, $company_file = null, $wait_before_next_update = null, $min_run_every_n_seconds = null) { $hookdata = array( 'username' => $username, 'password' => $password, 'qb_company_file' => $company_file, 'qbwc_wait_before_next_update' => $wait_before_next_...
php
{ "resource": "" }
q256004
QuickBooks_Driver.initialize
test
public function initialize($options) { $hookdata = array( 'options' => $options, ); $err = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_INITIALIZE, null, $err, $hookdata); return $this->_initialize($options); }
php
{ "resource": "" }
q256005
QuickBooks_Driver.initialized
test
public function initialized() { $hookdata = array(); $err = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_INITIALIZED, null, $err, $hookdata); return $this->_initialized(); }
php
{ "resource": "" }
q256006
QuickBooks_Driver.log
test
final public function log($msg, $ticket = null, $lvl = QUICKBOOKS_LOG_NORMAL) { /* $hookdata = array( 'message' => $msg, 'level' => $lvl, ); $err = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_LOG, $ticket, $err, $hookdata); */ if (is_null($lvl) or $this->_loglevel >= $lvl) { return $this...
php
{ "resource": "" }
q256007
QuickBooks_Driver._callHook
test
final protected function _callHook($hook, $ticket, &$err, $hook_data) { $user = ''; if ($ticket) { $user = (string) $this->_authResolve($ticket); } // Call the hook QuickBooks_Callbacks::callHook($this, $this->_hooks, $hook, null, $user, $ticket, $err, $hook_data, null, __FILE__, __LINE__); if (...
php
{ "resource": "" }
q256008
QuickBooks_IPP_Federator.connectOAuth
test
public function connectOAuth($provider, $token, $pem_key, $encryption_key, $app_username, $app_tenant, $auth_id_pseudonym, $realm_id_pseudonym, $realm, $flavor) { if (!$this->_driver) { $this->_log('Could not connect to OAuth, no DRIVER storage instance.'); return false; } $url = QuickBooks_IPP_Federa...
php
{ "resource": "" }
q256009
QuickBooks_WebConnector_Handlers._defaults
test
protected function _defaults($config) { $url = '?'; if (isset($_SERVER['REQUEST_URI'])) { $url = $_SERVER['REQUEST_URI']; } $defaults = array( 'qb_company_file' => null, // To force a specific company file to be used 'qbwc_min_version' => null, // Minimum version of the QBWC that must be us...
php
{ "resource": "" }
q256010
QuickBooks_WebConnector_Handlers._handleRecurringEvents
test
protected function _handleRecurringEvents($ticket) { if ($user = $this->_driver->authResolve($ticket)) { while ($next = $this->_driver->recurDequeue($user, true)) { //$this->_driver->log('Dequeued a recurring event, enqueuing!', $ticket, QUICKBOOKS_LOG_VERBOSE); $this->_log('Dequeued a recurring even...
php
{ "resource": "" }
q256011
QuickBooks_WebConnector_Handlers._extractIdentifiers
test
protected function _extractIdentifiers($xml) { $fetch_tagdata = array( 'ListID', 'TxnID', 'OwnerID', 'TxnLineID', 'EditSequence', 'FullName', 'Name', 'RefNumber', ); $fetch_attributes = array( 'requestID', 'iteratorID', 'iteratorRemainingCount', 'metaData', 'retCount', ...
php
{ "resource": "" }
q256012
QuickBooks_WebConnector_Handlers._extractStatusCode
test
protected function _extractStatusCode($xml) { if (false !== ($start = strpos($xml, ' statusCode="')) and false !== ($end = strpos($xml, '"', $start + 13))) { return substr($xml, $start + 13, $end - $start - 13); } return QUICKBOOKS_ERROR_OK; }
php
{ "resource": "" }
q256013
QuickBooks_WebConnector_Handlers._extractStatusMessage
test
protected function _extractStatusMessage($xml) { if (false !== ($start = strpos($xml, ' statusMessage="')) and false !== ($end = strpos($xml, '"', $start + 16))) { return substr($xml, $start + 16, $end - $start - 16); } return ''; }
php
{ "resource": "" }
q256014
QuickBooks_WebConnector_Handlers._callMappedFunction
test
protected function _callMappedFunction($which, $user, $requestID, $action, $ident, $extra, &$err, $last_action_time, $last_actionident_time, $xml_or_version = '', $qb_identifier_or_locale = array(), $qbxml = null) { if ($which == 0) { return QuickBooks_Callbacks::callRequestHandler($this->_driver, $this->_map, ...
php
{ "resource": "" }
q256015
QuickBooks_WebConnector_Handlers._callHook
test
protected function _callHook($ticket, $hook, $requestID, $action, $ident, $extra, &$err, $xml = '', $qb_identifiers = array(), $hook_data = array()) { $user = ''; if ($ticket) { $user = $this->_driver->authResolve($ticket); } // Call the hook $ret = QuickBooks_Callbacks::callHook($this->_driver, $this-...
php
{ "resource": "" }
q256016
QuickBooks_WebConnector_Handlers._handleError
test
protected function _handleError($ticket, $errnum, $errmsg, $requestID, $action, $ident, $extra, &$err, $xml = '', $qb_identifiers = array()) { // , $requestID, $user, $action, $ident, $extra, &$err, $xml, $qb_identifier // Call the error handler (if one is set) $errmsg = html_entity_decode($errmsg); // First...
php
{ "resource": "" }
q256017
Quickbooks.enqueue
test
public function enqueue($action, $ident, $priority = 0, $extra = null, $user = null) { $Queue = new QuickBooks_WebConnector_Queue($this->_dsn); return $Queue->enqueue($action, $ident, $priority, $extra, $user); }
php
{ "resource": "" }
q256018
QuickBooks_IPP_Service_Item.findByName
test
public function findByName($Context, $realmID, $name) { $IPP = $Context->IPP(); if ($IPP->flavor() == QuickBooks_IPP_IDS::FLAVOR_DESKTOP) { for ($i = 0; $i < 999; $i++) { $list = $this->findAll($Context, $realmID, $name, $i, 50); foreach ($list as $Item) { if (strtolower($Item->get...
php
{ "resource": "" }
q256019
QuickBooks_SQL._startsWith
test
protected function _startsWith($str, $startswith) { $length = strlen($startswith); return (substr($str, 0, $length)) == $startswith; }
php
{ "resource": "" }
q256020
QuickBooks_SQL.query
test
public function query($sql, $look = true) { if ($this->_driver) { if ($look) { $tmp = trim(strtoupper($sql)); if ($this->_startsWith($sql, 'UPDATE ')) { } else if ($this->_startsWith($sql, 'INSERT INTO ')) { } else if ($this->_startsWith($sql, 'DELETE FROM '))...
php
{ "resource": "" }
q256021
QuickBooks_XML.extractTagContents
test
static public function extractTagContents($tag, $data) { $tag = trim($tag, '<> '); if (false !== strpos($data, '<' . $tag . '>') and false !== strpos($data, '</' . $tag . '>')) { $data = strstr($data, '<' . $tag . '>'); $end = strpos($data, '</' . $tag . '>'); return substr($data, strlen($tag...
php
{ "resource": "" }
q256022
QuickBooks_XML.extractTagAttributes
test
static public function extractTagAttributes($tag_w_attrs, $return_tag_first = false) { $tag = ''; $attributes = array(); $tag_w_attrs = trim($tag_w_attrs); /*if (substr($tag_w_attrs, -1, 1) == '/') // condensed empty tag { $tag = trim($tag_w_attrs, '/ '); $attributes = array(); } else*/ i...
php
{ "resource": "" }
q256023
QuickBooks_XML.encode
test
static public function encode($str, $for_qbxml = true, $double_encode = true) { $transform = array( '&' => '&amp;', '<' => '&lt;', '>' => '&gt;', //'\'' => '&apos;', '"' => '&quot;', ); $str = str_replace(array_keys($transform), array_values($transform), $str); if (!$double_encode) ...
php
{ "resource": "" }
q256024
QuickBooks_XML.decode
test
static public function decode($str, $for_qbxml = true) { $transform = array( '&lt;' => '<', '&gt;' => '>', '&apos;' => '\'', '&quot;' => '"', '&amp;' => '&', // Make sure that this is *the last* transformation to run, otherwise we end up double-un-encoding things ); return str_replace(a...
php
{ "resource": "" }
q256025
QuickBooks_IPP_IntuitAnywhere.check
test
public function check($app_username, $app_tenant) { if ($arr = $this->load($app_username, $app_tenant)) { return true; } return false; }
php
{ "resource": "" }
q256026
QuickBooks_IPP_IntuitAnywhere.load
test
public function load($app_username, $app_tenant) { if ($arr = $this->_driver->oauthLoad($this->_key, $app_username, $app_tenant) and strlen($arr['oauth_access_token']) > 0 and strlen($arr['oauth_access_token_secret']) > 0) { $arr['oauth_consumer_key'] = $this->_consumer_key; $arr['oauth_consumer_secr...
php
{ "resource": "" }
q256027
QuickBooks_IPP_IntuitAnywhere.handle
test
public function handle($app_username, $app_tenant) { if ($this->check($app_username, $app_tenant) and // We have tokens ... $this->test($app_username, $app_tenant)) // ... and they are valid { // They are already logged in, send them on to exchange data header('Location: ' . $this->_that_url); exit...
php
{ "resource": "" }
q256028
QuickBooks_IPP_IntuitAnywhere.widgetMenu
test
public function widgetMenu($app_username, $app_tenant) { $token = null; $secret = null; if ($creds = $this->load($app_username, $app_tenant)) { return $this->_request( QuickBooks_IPP_OAuth::METHOD_GET, QuickBooks_IPP_IntuitAnywhere::URL_APP_MENU, array(), $creds['oauth_access_token'], ...
php
{ "resource": "" }
q256029
QuickBooks_SQL_Schema.mapSchemaToSQLDefinition
test
static public function mapSchemaToSQLDefinition($xml, &$tables) { $Parser = new QuickBooks_XML_Parser($xml); $errnum = 0; $errmsg = ''; $tmp = $Parser->parse($errnum, $errmsg); $tmp = $tmp->children(); $base = current($tmp); $tmp = $base->children(); $rs = next($tmp); foreach ($rs->childr...
php
{ "resource": "" }
q256030
QuickBooks_SQL_Schema._transform
test
static protected function _transform($curpath, $node, &$tables) { print('' . $curpath . ' node: ' . $node->name() . "\n"); $table = ''; $field = ''; $this_sql = array(); $other_sql = array(); QuickBooks_SQL_Schema::mapToSchema($curpath . ' ' . $node->name(), QUICKBOOKS_SQL_SCHEMA_MAP_TO_SQL, $this_...
php
{ "resource": "" }
q256031
QuickBooks_QBXML_Object.set
test
public function set($key, $value, $cast = true) { if (is_array($value)) { $this->_object[$key] = $value; } else { //print('set(' . $key . ', ' . $value . ', ' . $cast . ')' . "\n"); if ($cast and $value != '__EMPTY__') { $value = QuickBooks_Cast::cast($this->object(), $key, $value, true, ...
php
{ "resource": "" }
q256032
QuickBooks_QBXML_Object.get
test
public function get($key, $default = null) { if (isset($this->_object[$key])) { return $this->_object[$key]; } return $default; }
php
{ "resource": "" }
q256033
QuickBooks_QBXML_Object.setFullNameType
test
public function setFullNameType($fullname_key, $name_key, $parent_key, $value) { if (false !== strpos($value, ':')) { if ($name_key and $parent_key) { // This covers the case where we are setting FullName, which // needs to be broken up into: // Name // ParentRef FullName $explode...
php
{ "resource": "" }
q256034
QuickBooks_QBXML_Object.setBooleanType
test
public function setBooleanType($key, $value) { //print('setting BooleanType [' . $key . '] to ' . $value . "\n"); if ($value == 'true' or $value === 1 or $value === true) { //print("\t" . ' set to TRUE' . "\n"); return $this->set($key, 'true'); } //print("\t" . ' set to FALSE' . "\n"); return $...
php
{ "resource": "" }
q256035
QuickBooks_QBXML_Object.setDateType
test
public function setDateType($key, $date, $dont_allow_19691231 = true) { if ($date == '1969-12-31' and $dont_allow_19691231) { return false; } if (!strlen($date) or $date == '0') { return false; } // 1228241458 vs. 19830102 //if (ereg('^[[:digit:]]+$', $date) and strlen($date) > 8) i...
php
{ "resource": "" }
q256036
QuickBooks_QBXML_Object.getDateType
test
public function getDateType($key, $format = 'Y-m-d') { if (!strlen($format)) { $format = 'Y-m-d'; } if ($this->exists($key) and $this->get($key)) { return date($format, strtotime($this->get($key))); } return null; }
php
{ "resource": "" }
q256037
QuickBooks_QBXML_Object.remove
test
public function remove($key) { if (isset($this->_object[$key])) { unset($this->_object[$key]); return true; } return false; }
php
{ "resource": "" }
q256038
QuickBooks_QBXML_Object._schema
test
protected function _schema($request) { if (strtolower(substr($request, -2, 2)) != 'rq') { $request = $request . 'Rq'; } $class = 'QuickBooks_QBXML_Schema_Object_' . $request; $file = 'QuickBooks/QBXML/Schema/Object/' . $request . '.php'; include_once $file; if (class_exists($class)) { re...
php
{ "resource": "" }
q256039
QuickBooks_QBXML_Object.asXML
test
public function asXML($root = null, $parent = null, $object = null) { if (is_null($root)) { $root = $this->object(); } if (is_null($object)) { $object = $this->_object; } $Node = new QuickBooks_XML_Node($root); foreach ($object as $key => $value) { if (is_array($value)) { $No...
php
{ "resource": "" }
q256040
QuickBooks_Driver_Sql_Mssql._initialized
test
protected function _initialized() { $required = array( //$this->_mapTableName(QUICKBOOKS_DRIVER_SQL_IDENTTABLE) => false, $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_TICKETTABLE) => false, $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_USERTABLE) => false, $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_RECURTA...
php
{ "resource": "" }
q256041
QuickBooks_IPP_Service_Department.add
test
public function add($Context, $realmID, $Object) { return parent::_add($Context, $realmID, QuickBooks_IPP_IDS::RESOURCE_DEPARTMENT, $Object); }
php
{ "resource": "" }
q256042
QuickBooks_QBXML_Object_Employee.getName
test
public function getName() { if (!$this->exists('Name')) { if (!is_null($this->getFirstName()) || !is_null($this->getLastName())) { $this->setNameAsFirstLast(); } } return $this->get('Name'); }
php
{ "resource": "" }
q256043
QuickBooks_QBXML_Object_Employee.setNameAsFirstLast
test
public function setNameAsFirstLast() { $first = $this->getFirstName(); $last = $this->getLastName(); if (is_null($first)) { $first = ''; } if (is_null($last)) { $last = ''; } ...
php
{ "resource": "" }
q256044
QuickBooks_WebConnector_Server_SQL._sqlDefaults
test
protected function _sqlDefaults($config) { $tmp = array( //'only_query', //'dont_query', 'only_import', 'dont_import', 'only_add', 'dont_add', 'only_modify', 'dont_modify', 'only_misc', 'dont_misc', ); foreach ($tmp as $filter) { if (empty($config[$filter]) or (!e...
php
{ "resource": "" }
q256045
QuickBooks_Status_Report.status
test
public function status($user = null, $levels = array()) { $Driver = $this->_driver; if (!$user) { $user = $Driver->authDefault(); } if (!count($levels)) { $levels = array( 60 * 60 * 12 => array( QuickBooks_Status_Report::STATUS_NOTICE, 'Notice: A connection has not been made in %d days, %d ...
php
{ "resource": "" }
q256046
QuickBooks_IPP_Service_PurchaseOrder.delete
test
public function delete($Context, $realmID, $IDType) { return parent::_delete($Context, $realmID, QuickBooks_IPP_IDS::RESOURCE_PURCHASEORDER, $IDType); }
php
{ "resource": "" }
q256047
QuickBooks_XML_Parser._read
test
protected function _read($mixed) { if (empty($mixed)) { return ''; } else if (is_resource($mixed) and get_resource_type($mixed) == 'stream') { $buffer = ''; $tmp = ''; while ($tmp = fread($mixed, 8192)) { $buffer .= $tmp; } return $buffer; } else if (substr(trim($mixed), 0, 6...
php
{ "resource": "" }
q256048
QuickBooks_XML_Parser.load
test
public function load($xml_or_file) { $xml_or_file = $this->_read($xml_or_file); $this->_xml = $xml_or_file; return $this->_backend->load($xml_or_file); }
php
{ "resource": "" }
q256049
QuickBooks_XML_Parser.parse
test
public function parse(&$errnum, &$errmsg) { if (!strlen($this->_xml)) { $errnum = QuickBooks_XML::ERROR_CONTENT; $errmsg = 'No XML content to parse.'; return false; } // first, let's remove all of the comments if ($this->validate($errnum, $errmsg)) { return $this->_backend->parse($errnum, $err...
php
{ "resource": "" }
q256050
QuickBooks_QBXML_Object_SalesTaxGroupItem.asQBXML
test
public function asQBXML($request, $version = null, $locale = null, $root = null) { return parent::asQBXML($request, $version, $locale, $root); }
php
{ "resource": "" }
q256051
QuickBooks_Callbacks_API_Errors.e500_notfound
test
static public function e500_notfound($requestID, $user, $action, $ident, $extra, &$err, $xml, $errnum, $errmsg, $config) { //$requestID, $user, $action, $ident, $extra, $errerr, $xml, $errnum, $errmsg, $this->_callback_config // Not found, *still call the callback!* /* $extra['callbacks'], $method, $action,...
php
{ "resource": "" }
q256052
QuickBooks_Driver_Sql._ticketResolve
test
protected function _ticketResolve($ticket) { static $cache = array(); if (!$ticket) { return 0; } $errnum = 0; $errmsg = ''; if (isset($cache[$ticket])) { return $cache[$ticket]; } else if ($arr = $this->_fetch($this->_query(" SELECT quickbooks_ticket_id FROM " . $this->_mapT...
php
{ "resource": "" }
q256053
QuickBooks_Driver_Sql._configWrite
test
protected function _configWrite($user, $module, $key, $value, $type, $opts) { $errnum = 0; $errmsg = ''; if ($arr = $this->_fetch($this->_query(" SELECT quickbooks_config_id FROM " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_CONFIGTABLE) . " WHERE qb_username = '" . $this->_escape($user) ....
php
{ "resource": "" }
q256054
QuickBooks_Driver_Sql._configRead
test
protected function _configRead($user, $module, $key, &$type, &$opts) { $errnum = 0; $errmsg = ''; $sql = " SELECT cfgval, cfgtype, cfgopts FROM " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_CONFIGTABLE) . " WHERE qb_username = '" . $this->_escape($user) . "' AND module = '" . $...
php
{ "resource": "" }
q256055
QuickBooks_Driver_Sql._authCreate
test
protected function _authCreate($username, $password, $company_file = null, $wait_before_next_update = null, $min_run_every_n_seconds = null) { $errnum = 0; $errmsg = ''; if (!$this->_count($this->_query("SELECT qb_username FROM " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_USERTABLE) . " WHERE qb_username = '"...
php
{ "resource": "" }
q256056
QuickBooks_Driver_Sql._authDefault
test
protected function _authDefault() { $errnum = 0; $errmsg = ''; if ($arr = $this->_fetch($this->_query(" SELECT qb_username FROM " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_USERTABLE) . " WHERE status = '" . QUICKBOOKS_USER_ENABLED . "' ", $errnum, $errmsg, 0, 1))) { return $arr['qb_...
php
{ "resource": "" }
q256057
QuickBooks_Driver_Sql._authLogin
test
protected function _authLogin($username, $password, &$company_file, &$wait_before_next_update, &$min_run_every_n_seconds, $override = false) { $errnum = 0; $errmsg = ''; if ($override) // We still need to make sure that the user exists, even if using external authentication { $this->authCreate($username, $...
php
{ "resource": "" }
q256058
QuickBooks_Driver_Sql._authCheck
test
protected function _authCheck($ticket) { $errnum = 0; $errmsg = ''; if ($arr = $this->_fetch($this->_query(" SELECT quickbooks_ticket_id FROM " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_TICKETTABLE) . " WHERE ticket = '" . $this->_escape($ticket) . "' AND touch_datetime > '" . date('...
php
{ "resource": "" }
q256059
QuickBooks_Driver_Sql._errorLog
test
protected function _errorLog($ticket, $errnum, $errmsg) { if ($ticket_id = $this->_ticketResolve($ticket)) { $db_errnum = 0; $db_errmsg = ''; return $this->_query(" UPDATE " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_TICKETTABLE) . " SET lasterror_num = '" . $this->_escape($errnum) ....
php
{ "resource": "" }
q256060
QuickBooks_Driver_Sql._recurEnqueue
test
protected function _recurEnqueue($user, $run_every, $action, $ident, $replace = true, $priority = 0, $extra = null, $qbxml = null) { $errnum = 0; $errmsg = ''; // By default, it has *never* occured $recur_lasttime = (time() - $run_every - 60); if ($replace) { if ($existing = $this->_fetch($this->_quer...
php
{ "resource": "" }
q256061
QuickBooks_Driver_Sql._recurDequeue
test
protected function _recurDequeue($user, $by_priority = false) { $errnum = 0; $errmsg = ''; $sql = " SELECT * FROM " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_RECURTABLE) . " WHERE qb_username = '" . $this->_escape($user) . "' AND recur_lasttime + run_every <= " . time(); if ($by_p...
php
{ "resource": "" }
q256062
QuickBooks_Driver_Sql._queueEnqueue
test
protected function _queueEnqueue($user, $action, $ident, $replace = true, $priority = 0, $extra = null, $qbxml = null) { $errnum = 0; $errmsg = ''; if ($replace) { $this->_query(" DELETE FROM " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_QUEUETABLE) . " WHERE qb_username = '" . $this->_e...
php
{ "resource": "" }
q256063
QuickBooks_Driver_Sql._queueProcessing
test
protected function _queueProcessing($user) { $errnum = 0; $errmsg = ''; // Fetch the latest record to be dequeued for this user, and check that it's set with a status of in processing $sql = " SELECT quickbooks_queue_id, qb_action, ident, qb_status, dequeue_datetime FROM " . $thi...
php
{ "resource": "" }
q256064
QuickBooks_Driver_Sql._queueLeft
test
protected function _queueLeft($user, $queued = true) { $errnum = 0; $errmsg = ''; // SELECT * FROM quickbooks_queue WHERE qb_status = 'q' $sql = " SELECT COUNT(*) AS num_left FROM " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_QUEUETABLE) . " WHERE qb_username = '" . $this->_escape($user)...
php
{ "resource": "" }
q256065
QuickBooks_Driver_Sql._queueProcessed
test
protected function _queueProcessed($ticket) { $errnum = 0; $errmsg = ''; if ($arr = $this->_fetch($this->_query(" SELECT processed FROM " . $this->_mapTableName(QUICKBOOKS_DRIVER_SQL_TICKETTABLE) . " WHERE ticket = '" . $this->_escape($ticket) . "' ", $errnum, $errmsg, 0, 1))) { return...
php
{ "resource": "" }
q256066
QuickBooks_Driver_Sql._log
test
protected function _log($msg, $ticket = null, $log_level = QUICKBOOKS_LOG_NORMAL, $cur_log_level = null) { static $batch = 0; /* if ($batch == 0) // Batching needs to be revised, *major* performance hit { // We store a batch ID so that we can tell which logged messages go with which actual separate HTTP re...
php
{ "resource": "" }
q256067
QuickBooks_Driver_Sql.query
test
public function query($sql, &$errnum, &$errmsg, $offset = 0, $limit = null, $vars = array()) { if (is_array($vars) and count($vars)) { foreach ($vars as $key => $value) { $vars[$key] = $this->escape($value); } array_unshift($vars, $sql); $sql = call_user_func_array('sprintf', $vars); } ...
php
{ "resource": "" }
q256068
QuickBooks_Driver_Sql.fields
test
public function fields($table, $with_field_names_as_keys = false) { static $cache = array(); if (isset($cache[$table])) { return $cache[$table]; } // *Careful* by default it's stored as array( 'field_name' => true, ... ) $tmp = $this->_fields($table); $cache[$table] = array_combine($tmp, array_fill(...
php
{ "resource": "" }
q256069
QuickBooks_Driver_Sql.select
test
public function select($table, $restrict, $order = array(), $offset = null, $limit = null) { $list = array(); if (count($restrict)) { $where = array(); foreach ($restrict as $field => $value) { $where[] = $field . " = '" . $this->_escape($value) . "' "; } $where = " WHERE " . implode(' AND '...
php
{ "resource": "" }
q256070
QuickBooks_Driver_Sql.update
test
public function update($table, $object, $where = array(), $resync = true, $discov = null, $derive = true) // @todo Is that the correct default for $derive? { $sql = ''; $set = array(); if (is_object($object)) { $object = $object->asArray(); } $avail = $this->fields($table, true); // List of available...
php
{ "resource": "" }
q256071
QuickBooks_WebConnector_Queue.interactive
test
public function interactive($priority = 0, $user = null) { if ($this->_driver) { $tmp = array_merge(range('a', 'z'), range(0, 9)); shuffle($tmp); $random = substr(implode('', $tmp), 0, 8); /* if (!$user) { $user = $this->_driver->authDefault(); } */ if (!$user) { $user...
php
{ "resource": "" }
q256072
QuickBooks_WebConnector_Queue.recurring
test
public function recurring($run_every, $action, $ident = null, $priority = 0, $extra = null, $user = null, $qbxml = null, $replace = true) { $run_every = QuickBooks_Utilities::intervalToSeconds($run_every); if (!strlen($ident)) { $tmp = array_merge(array('a', 'z'), range(0, 9)); shuffle($tmp); $ident ...
php
{ "resource": "" }
q256073
QuickBooks_WebConnector_Queue.size
test
public function size($user = null) { if ($this->_driver) { // Use the default user (provided in __construct) if none is given if (!$user) { $user = $this->_user; } $queued = true; return $this->_driver->queueLeft($user, $queued); } return null; }
php
{ "resource": "" }
q256074
Quickbooks_QBXML_Object_CreditCardRefund.getAddress
test
public function getAddress($part = null, $defaults = array()) { if (!is_null($part)) { return $this->get('Address ' . $part); } return $this->getArray('Address *', $defaults); }
php
{ "resource": "" }
q256075
QuickBooks_IPP.authenticate
test
public function authenticate($username, $password, $token) { $this->_username = $username; $this->_password = $password; $this->_token = $token; $url = 'https://workplace.intuit.com/db/main?act=API_Authenticate'; $action = 'API_Authenticate'; $xml = '<?xml version="1.0" encoding="UTF-8" ?> <qdbapi> ...
php
{ "resource": "" }
q256076
QuickBooks_IPP_Service_Company.findById
test
public function findById($Context, $realmID) { $xml = null; // WATCH OUT! We pass in the realmID as ID value return parent::_findById($Context, $realmID, QuickBooks_IPP_IDS::RESOURCE_COMPANY, $realmID, $xml); }
php
{ "resource": "" }
q256077
QuickBooks_IPP_Service_VendorCredit.delete
test
public function delete($Context, $realmID, $IDType) { return parent::_delete($Context, $realmID, QuickBooks_IPP_IDS::RESOURCE_VENDORCREDIT, $IDType); }
php
{ "resource": "" }
q256078
QuickBooks_HTTP._request
test
protected function _request($method) { $start = microtime(true); if (!function_exists('curl_init')) { die('You must have the PHP cURL extension (php.net/curl) enabled to use this (' . QUICKBOOKS_PACKAGE_NAME . ' v' . QUICKBOOKS_PACKAGE_VERSION . ').'); } $this->_log('Using CURL to send request!', QUICKB...
php
{ "resource": "" }
q256079
QuickBooks_MerchantService.signOn
test
public function signOn() { $this->_setError(QuickBooks_MerchantService::ERROR_OK); $xml = ''; $xml .= '<?xml version="1.0" ?>' . QUICKBOOKS_CRLF; $xml .= '<?qbmsxml version="4.1"?>' . QUICKBOOKS_CRLF; $xml .= '<QBMSXML>' . QUICKBOOKS_CRLF; $xml .= ' <SignonMsgsRq>' . QUICKBOOKS_CRLF; if ($this->_ce...
php
{ "resource": "" }
q256080
QuickBooks_MerchantService._transRequestID
test
protected function _transRequestID($type, $Obj, $amount, $force_new_transaction = true) { $rand = ''; if ($force_new_transaction) { $rand = mt_rand() . microtime(); } return md5($type . '-' . serialize($Obj) . '-' . $amount . '-' . $rand); }
php
{ "resource": "" }
q256081
QuickBooks_MerchantService.refund
test
public function refund($Card, $amount, $salestax = null, $comment = null, $is_card_present = false, $is_ecommerce = true, $force_new_transaction = true) { $this->_setError(QuickBooks_MerchantService::ERROR_OK); $this->_log('refund()', QUICKBOOKS_LOG_VERBOSE); if (!$this->isSignedOn()) { $this->signOn(); ...
php
{ "resource": "" }
q256082
QuickBooks_WebConnector_Queue_Singleton.initialize
test
static public function initialize($dsn = null, $user = null, $config = array(), $return_boolean = true) { static $instance; if (empty($instance)) { if (empty($dsn)) { return false; } $instance = new QuickBooks_WebConnector_Queue($dsn, $user, $config); } if ($return_boolean and $instance) ...
php
{ "resource": "" }
q256083
QuickBooks_WebConnector_Server._adapterFactory
test
protected function _adapterFactory($adapter, $wsdl, $soap_options, $loglevel) { $adapter = ucfirst(strtolower($adapter)); $file = '/QuickBooks/Adapter/Server/' . $adapter . '.php'; $class = 'QuickBooks_Adapter_Server_' . $adapter; QuickBooks_Loader::load($file); if (class_exists($class)) { retu...
php
{ "resource": "" }
q256084
QuickBooks_WebConnector_Server._defaults
test
final protected function _defaults($arr) { $defaults = array( 'error_handler' => '', 'use_builtin_error_handler' => false, 'time_limit' => 0, 'log_to_file' => null, 'log_to_syslog' => null, 'masking' => true, ); $arr = array_merge($defaults, $arr); return $arr; }
php
{ "resource": "" }
q256085
QuickBooks_WebConnector_Server._headers
test
protected function _headers() { if ($_SERVER['REQUEST_METHOD'] == 'POST') { header('Content-Type: text/xml'); } else if (isset($_GET['wsdl']) or isset($_GET['WSDL'])) { header('Content-Type: text/xml'); } else { header('Content-Type: text/plain'); } return true; }
php
{ "resource": "" }
q256086
Controller_Qbapi_Quickbooks.action_index
test
public function action_index() { //Username and password used for the web connector, QWC file, and the QB Framework $user = 'QBAPI Username'; $pass = 'QBAPI Password'; //Configure the logging level $log_level = QUICKBOOKS_LOG_DEVELOP; //Pure-PHP SOAP server $soapserver = QUICKBOOKS_SOAPSERVER_BUILTIN; ...
php
{ "resource": "" }
q256087
QuickBooks_SOAP_Server._requestFactory
test
protected function _requestFactory($request) { $class = 'QuickBooks_WebConnector_Request_' . ucfirst(strtolower($request)); $file = '/QuickBooks/WebConnector/Request/' . ucfirst(strtolower($request)) . '.php'; // Make sure that class gets loaded QuickBooks_Loader::load($file, false); if (class_exists($...
php
{ "resource": "" }
q256088
QuickBooks_SOAP_Server.handle
test
public function handle($raw_http_input) { // Determine the method, call the correct handler function $builtin = QuickBooks_XML::PARSER_BUILTIN; // The SimpleXML parser has a difference namespace behavior, so force this to use the builtin parser $Parser = new QuickBooks_XML_Parser($raw_http_input, $builtin);...
php
{ "resource": "" }
q256089
QuickBooks_IPP_Object.walk
test
public function walk($callback) { //print_r($this->_data); //exit; foreach ($this->_data as $key => $value) { if (is_object($value)) { $value->walk($callback); } else if (is_array($value)) { foreach ($value as $skey => $svalue) { if (is_object($svalue)) { $svalue->...
php
{ "resource": "" }
q256090
Quickbooks_Payments.charge
test
public function charge($Context, $Object_or_token, $amount, $currency = 'USD', $description = '', array $context = array()) { $capture = true; return $this->_chargeOrAuth($Context, $Object_or_token, $amount, $currency, $capture, $description, $context); }
php
{ "resource": "" }
q256091
Quickbooks_Payments.getCharge
test
public function getCharge($Context, $id) { $resp = $this->_http($Context, QuickBooks_Payments::URL_CHARGE . '/' . $id, null); $data = json_decode($resp, true); $ignore_declines = true; if ($this->_handleError($data, $ignore_declines)) { return false; } return new QuickBooks_Payments_Transaction($da...
php
{ "resource": "" }
q256092
Quickbooks_Payments.getDebit
test
public function getDebit($Context, $id) { $resp = $this->_http($Context, QuickBooks_Payments::URL_ECHECK . '/' . $id, null); $data = json_decode($resp, true); $ignore_declines = true; if ($this->_handleError($data, $ignore_declines)) { return false; } return new QuickBooks_Payments_Transaction($dat...
php
{ "resource": "" }
q256093
Quickbooks_Payments.refund
test
public function refund($Context, $id, $amount, $context = array()) { $url = str_replace('<id>', $id, QuickBooks_Payments::URL_REFUND); $payload = array( 'amount' => $amount, 'context' => array( 'mobile' => false, 'isEcommerce' => false, 'recurring' => false, ), ); $resp = $this->_http(...
php
{ "resource": "" }
q256094
Quickbooks_Payments.storeCard
test
public function storeCard($Context, $id, $Object) { $id = str_replace(array('{', '}', '-'), '', $id); $url = str_replace('<id>', $id, QuickBooks_Payments::URL_CARD); if ($Object instanceof QuickBooks_Payments_CreditCard) { $payload = $Object->toArray(); } else { $this->_setError(); return fals...
php
{ "resource": "" }
q256095
Quickbooks_Payments.storeCardFromToken
test
public function storeCardFromToken($Context, $id, $token) { $id = str_replace(array('{', '}', '-'), '', $id); $url = str_replace('<id>', $id, QuickBooks_Payments::URL_CARD . '/createFromToken'); $payload = array( 'value' => $token ); $resp = $this->_http($Context, $url, json_encode($payload)); $dat...
php
{ "resource": "" }
q256096
Quickbooks_Payments.getCard
test
public function getCard($Context, $id, $card_id) { $id = str_replace(array('{', '}', '-'), '', $id); $url = str_replace('<id>', $id, QuickBooks_Payments::URL_CARD . '/' . $card_id); $resp = $this->_http($Context, $url); $data = json_decode($resp, true); if ($this->_handleError($data)) { return false...
php
{ "resource": "" }
q256097
Quickbooks_Payments.getCards
test
public function getCards($Context, $id) { $id = str_replace(array('{', '}', '-'), '', $id); $url = str_replace('<id>', $id, QuickBooks_Payments::URL_CARD); $resp = $this->_http($Context, $url, null); $data = json_decode($resp, true); if ($this->_handleError($data)) { return false; } $cards = ar...
php
{ "resource": "" }
q256098
Quickbooks_Payments.deleteCard
test
public function deleteCard($Context, $id, $card_id) { $id = str_replace(array('{', '}', '-'), '', $id); $url = str_replace('<id>', $id, QuickBooks_Payments::URL_CARD . '/' . $card_id); $resp = $this->_http($Context, $url, null, 'DELETE'); $data = json_decode($resp, true); if ($this->_handleError($data)) ...
php
{ "resource": "" }
q256099
Quickbooks_Payments._handleError
test
protected function _handleError($data, $ignore_declines = false) { if (!$data) { // Check for 401/other errors $info = $this->_last_httpinfo; if ($info['http_code'] == QuickBooks_HTTP::HTTP_401) { $this->_setError($info['http_code'], 'Unauthorized.'); return true; } else if ($info['http_...
php
{ "resource": "" }