public static function e3200_editsequence($requestID, $user, $action, $ID, $extra, &$err, $xml, $errnum, $errmsg, $config) { switch ($action) { case QUICKBOOKS_MOD_CUSTOMER: // EditSequence for this customer is out-of-date, query for the customer to get the latest EditSequence, and re-send return QuickBooks_Callbacks_Integrator_Callbacks::integrateQueryCustomer($ID); default: return false; } }
/** * * * @param string $method * @param string $action * @param mixed $ID * @param string $err * @param string $qbxml * @param QuickBooks_Iterator $Iterator * @param resource $qbres * @return boolean */ public static function getCustomerByName($method, $action, $ID, $err, $qbxml, $Iterator, $qbres) { $API = QuickBooks_API_Singleton::getInstance(); $Integrator = QuickBooks_Integrator_Singleton::getInstance(); if ($Iterator->count() == 1) { // If we found the customer in QuickBooks, create a mapping with the ListID value $Customer = $Iterator->next(); if ($API->createMapping(QUICKBOOKS_OBJECT_CUSTOMER, $ID, $Customer->getListID(), $Customer->getEditSequence())) { // Let's make sure that this customer is up-to-date return QuickBooks_Callbacks_Integrator_Callbacks::integrateModCustomer($ID); } } else { if ($Iterator->count() == 0) { // Otherwise, we need to queue up an add request to add this cart item to QuickBooks return QuickBooks_Callbacks_Integrator_Callbacks::integrateAddCustomer($ID); } } return false; }