예제 #1
0
 /**
  * 
  * 
  *
  */
 public function handle($return = false, $debug = false)
 {
     if ($this->_transport_in->ready()) {
         $this->_bridge();
     } else {
         parent::handle($return, $debug);
     }
 }
예제 #2
0
// See the comments in the QuickBooks/Server/Handlers.php file
$driver_options = array();
$callback_options = array();
//$dsn = 'mysql://*****:*****@localhost/efapcom_quickbooks'; //Original Line
$dsn = 'mysql://*****:*****@192.168.129.116/efapcom_quickbooks';
define('QB_QUICKBOOKS_DSN', $dsn);
if (!QuickBooks_Utilities::initialized($dsn)) {
    // Initialize creates the neccessary database schema for queueing up requests and logging
    QuickBooks_Utilities::initialize($dsn);
    // This creates a username and password which is used by the Web Connector to authenticate
    QuickBooks_Utilities::createUser($dsn, $user, $pass);
}
// Create a new server and tell it to handle the requests
// __construct($dsn_or_conn, $map, $errmap = array(), $hooks = array(), $log_level = QUICKBOOKS_LOG_NORMAL, $soap = QUICKBOOKS_SOAPSERVER_PHP, $wsdl = QUICKBOOKS_WSDL, $soap_options = array(), $handler_options = array(), $driver_options = array(), $callback_options = array()
$Server = new QuickBooks_Server($dsn, $map, $errmap, $hooks, $log_level, $soapserver, QUICKBOOKS_WSDL, $soap_options, $handler_options, $driver_options, $callback_options);
$response = $Server->handle(true, true);
/**
 * Catch and handle a "that string is too long for that field" error (err no. 3070) from QuickBooks
 * 
 * @param string $requestID			
 * @param string $action
 * @param mixed $ID
 * @param mixed $extra
 * @param string $err
 * @param string $xml
 * @param mixed $errnum
 * @param string $errmsg
 * @return void
 */
function _quickbooks_error_stringtoolong($requestID, $user, $action, $ID, $extra, &$err, $xml, $errnum, $errmsg)
{
예제 #3
0
            mysql_query($sql) or die(trigger_error(mysql_error()));
        }
    } else {
        die('Could not locate "./example.sql" to create the demo SQL schema!');
    }
    // Create the database tables
    QuickBooks_Utilities::initialize($dsn);
    // Add the default authentication username/password
    QuickBooks_Utilities::createUser($dsn, $user, $pass);
}
// Initialize the queue
QuickBooks_Queue_Singleton::initialize($dsn);
// Create a new server and tell it to handle the requests
// __construct($dsn_or_conn, $map, $errmap = array(), $hooks = array(), $log_level = QUICKBOOKS_LOG_NORMAL, $soap = QUICKBOOKS_SOAPSERVER_PHP, $wsdl = QUICKBOOKS_WSDL, $soap_options = array(), $handler_options = array(), $driver_options = array(), $callback_options = array()
$Server = new QuickBooks_Server($dsn, $map, $errmap, $hooks, $log_level, $soapserver, QUICKBOOKS_WSDL, $soap_options, $handler_options, $driver_options, $callback_options);
$response = $Server->handle(TRUE, TRUE);
// If you wanted, you could do something with $response here for debugging
$fp = fopen('/vservers/horsdoeuvres/htdocs/qbwc/qb_xml.xml', 'a+');
fwrite($fp, $response);
fclose($fp);
/**
 * Login success hook - perform an action when a user logs in via the Web Connector
 *
 * 
 */
function _quickbooks_hook_loginsuccess($requestID, $user, $hook, &$err, $hook_data, $callback_config)
{
    // For new users, we need to set up a few things
    // Fetch the queue instance
    $Queue = QuickBooks_Queue_Singleton::getInstance();
    $date = '1983-01-02 12:01:01';