Skip to content

Commit

Permalink
Merge branch 'master' into intechnic
Browse files Browse the repository at this point in the history
* master: (49 commits)
  Fixes docblock
  Avoid naming conflict with other package
  Fixes a bug where payment failures due to Intuit load balancer issues were inadvertantly reported as successes.
  Fix to allow all employee earnings to sync using the sql mirror
  Update Utilities.php
  Add user to *_import_response $Queue->enqueue calls
  Add missing "extra" parameter to import example
  Make sure the requests get queued up as authenticated userin web connector import example
  Update Bill add schema
  Fixes consolibyte#197, adds ecommerce and mobile indicator flags to QBMS legacy gateway.
  Fixes consolibyte#197, adds ecommerce and mobile indicator flags to QBMS legacy gateway.
  Fixes consolibyte#197, adds ecommerce and mobile indicator flags to QBMS legacy gateway.
  Fixes consolibyte#195, ability to pass the CONTEXT params to Intuit Payments.
  Update IDS.php
  Update TaxAgency.php
  Create TaxAgency.php
  Create TaxAgency.php
  Create EffectiveTaxRate.php
  Update README.md
  Missing object QuickBooks/IPP/Object/TDSLineDetail.
  ...

# Conflicts:
#	QuickBooks/IPP.php
#	QuickBooks/IPP/IDS.php
  • Loading branch information
Alexander Obuhovich committed Feb 1, 2019
2 parents bda79a8 + 002997c commit 3a97a8b
Show file tree
Hide file tree
Showing 47 changed files with 3,360 additions and 2,338 deletions.
1 change: 1 addition & 0 deletions QuickBooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@
define('QUICKBOOKS_ADD_OTHERNAME', 'OtherNameAdd');
define('QUICKBOOKS_MOD_OTHERNAME', 'OtherNameMod');
define('QUICKBOOKS_QUERY_OTHERNAME', 'OtherNameQuery');
define('QUICKBOOKS_IMPORT_OTHERNAME', 'OtherNameImport');

define('QUICKBOOKS_OBJECT_PAYMENTMETHOD', 'PaymentMethod');
define('QUICKBOOKS_ADD_PAYMENTMETHOD', 'PaymentMethodAdd');
Expand Down
86 changes: 4 additions & 82 deletions QuickBooks/Callbacks.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static public function callAuthenticate($Driver, $callback, $username, $password
if ($Driver)
{
// Log the callback for debugging
$Driver->log('Calling auth callback [' . $type . ']: ' . print_r($callback, true), null, QUICKBOOKS_LOG_DEVELOP);
$Driver->log('Calling auth callback [type=' . $type . ']', null, QUICKBOOKS_LOG_DEVELOP);
}

// Backward compat
Expand Down Expand Up @@ -128,7 +128,7 @@ static public function callAuthenticate($Driver, $callback, $username, $password
{
if ($Driver)
{
$Driver->log('Unsupported callback type for callback: ' . print_r($callback, true), null, QUICKBOOKS_LOG_VERBOSE);
$Driver->log('Unsupported auth callback type: [gettype=' . gettype($callback) . ']', null, QUICKBOOKS_LOG_VERBOSE);
}
}

Expand All @@ -141,84 +141,6 @@ static public function callAuthenticate($Driver, $callback, $username, $password
return $ret;
}

static public function callSAMLCallback($Driver, $callback, $auth_id, $ticket, $target_url, $realm_id_pseudonym, $config, &$err)
{
/**** */



//$err = '';

// Determine the type of hook
$type = QuickBooks_Callbacks::_type($callback, $Driver, $ticket);

if ($Driver)
{
// Log the callback for debugging
$Driver->log('Calling SAML callback [' . $type . ']: ' . print_r($callback, true), $ticket, QUICKBOOKS_LOG_DEVELOP);
}

// The 6th (start at 0: 0, 1, 2, 3, 4, 5) param is the error handler
$which = 5;

// 0 1 2 3 4 5
$vars = array( $auth_id, $ticket, $target_url, $realm_id_pseudonym, $config, &$err );
if ($type == QUICKBOOKS_CALLBACKS_TYPE_OBJECT_METHOD) // Object instance method hook
{
$object = $callback[0];
$method = $callback[1];

if ($Driver)
{
$Driver->log('Calling hook instance method: ' . get_class($callback[0]) . '->' . $callback[1], $ticket, QUICKBOOKS_LOG_VERBOSE);
}

$ret = QuickBooks_Callbacks::_callObjectMethod( array( $object, $method ), $vars, $err, $which);
//$ret = call_user_func_array( array( $object, $method ), array( $requestID, $user, $hook, &$err, $hook_data, $callback_config) );
}
else if ($type == QUICKBOOKS_CALLBACKS_TYPE_FUNCTION) // Function hook
{
$err = '';

if ($Driver)
{
$Driver->log('Calling hook function: ' . $callback, $ticket, QUICKBOOKS_LOG_VERBOSE);
}

$ret = QuickBooks_Callbacks::_callFunction($callback, $vars, $err, $which);
//$ret = $callback($requestID, $user, $hook, $err, $hook_data, $callback_config);
// $requestID, $user, $action, $ident, $extra, $err, $xml, $qb_identifier
}
else if ($type == QUICKBOOKS_CALLBACKS_TYPE_STATIC_METHOD) // Static method hook
{
if ($Driver)
{
$Driver->log('Calling hook static method: ' . $callback, $ticket, QUICKBOOKS_LOG_VERBOSE);
}

//$tmp = explode('::', $callback);
//$class = trim(current($tmp));
//$method = trim(end($tmp));

$ret = QuickBooks_Callbacks::_callStaticMethod($callback, $vars, $err, $which);
//$ret = call_user_func_array( array( $class, $method ), array( $requestID, $user, $hook, &$err, $hook_data, $callback_config) );
}
else
{
$err = 'Unsupported callback type for callback: ' . print_r($callback, true);
return false;
}

//QuickBooks_Callbacks::_callFunction($function, &$vars, &$err, $which = null)
//QuickBooks_Callbacks::_callStaticMethod();
//QuickBooks_Callbacks::_callObjectMethod();

// Pass on any error messages
$err = $vars[$which];

return $ret;
}

/**
* Call a callback function
*
Expand Down Expand Up @@ -370,7 +292,7 @@ static protected function _type(&$callback, $Driver = null, $ticket = null)
if ($Driver)
{
// Log this...
$Driver->log('Could not determine callback type for: ' . print_r($callback, true), $ticket, QUICKBOOKS_LOG_NORMAL);
$Driver->log('Could not determine callback type: ' . gettype($callback), $ticket, QUICKBOOKS_LOG_NORMAL);
}

return false;
Expand Down Expand Up @@ -511,7 +433,7 @@ static public function callHook($Driver, &$hooks, $hook, $requestID, $user, $tic
if ($Driver)
{
// Log the callback for debugging
$Driver->log('Calling callback [' . $type . ']: ' . print_r($callback, true), $ticket, QUICKBOOKS_LOG_DEVELOP);
$Driver->log('Calling callback [' . $type . ']: ' . gettype($callback), $ticket, QUICKBOOKS_LOG_DEVELOP);
}

$vars = array( $requestID, $user, $hook, &$err, $hook_data, $callback_config );
Expand Down
5 changes: 5 additions & 0 deletions QuickBooks/Callbacks/SQL/Callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -10662,6 +10662,9 @@ protected static function _transformToSQLObjects($curpath, $Node, &$objects, $cu
$extra['EntityListID'] = $extra['ListID'];
$extra['EntityType'] = 'Employee';
break;
case 'employeeret employeepayrollinfo earnings':
$extra['EntityType'] = 'Earnings';
break;
case 'estimateret':
if (!isset($extra['TxnID']))
{
Expand Down Expand Up @@ -10984,6 +10987,8 @@ protected static function _transformToSQLObjects($curpath, $Node, &$objects, $cu
case 'Service':
case 'SubscribedServices':
case 'TaxLineInfoRet':
case 'EmployeePayrollInfo':
case 'Earnings':

// * * * WARNING WARNING WARNING * * *
// The next line of code causes problems with some responses
Expand Down
Loading

0 comments on commit 3a97a8b

Please sign in to comment.