当前位置: 首页>>代码示例>>PHP>>正文


PHP QuickBooks_Utilities::createUser方法代码示例

本文整理汇总了PHP中QuickBooks_Utilities::createUser方法的典型用法代码示例。如果您正苦于以下问题:PHP QuickBooks_Utilities::createUser方法的具体用法?PHP QuickBooks_Utilities::createUser怎么用?PHP QuickBooks_Utilities::createUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QuickBooks_Utilities的用法示例。


在下文中一共展示了QuickBooks_Utilities::createUser方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_index

 /**
  * Houses the instance of the soap server and creates the mappings for errors, function callbacks
  * @author Jayson Lindsley <jay.lindsley@gmail.com>
  */
 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;
     //we can turn this off
     $handler_options = array('deny_concurrent_logins' => false, 'deny_reallyfast_logins' => false);
     // The next three params $map, $errmap, and $hooks are callbacks which
     // will be called when certain actions/events/requests/responses occur within
     // the framework
     // Maps inbound requests to functions
     $map = array(QUICKBOOKS_ADD_CUSTOMER => array(array($this, '_quickbooks_customer_add_request'), array($this, '_quickbooks_customer_add_response')), QUICKBOOKS_MOD_CUSTOMER => array(array($this, '_quickbooks_customer_mod_request'), array($this, '_quickbooks_customer_mod_response')));
     //Map error handling to functions
     $errmap = array(3070 => array($this, '_quickbooks_error_stringtoolong'), 3140 => array($this, '_quickbooks_reference_error'), '*' => array($this, '_quickbooks_error_handler'));
     //Login success callback
     $hooks = array(QuickBooks_WebConnector_Handlers::HOOK_LOGINSUCCESS => array(array($this, '_quickbooks_hook_loginsuccess')));
     //MySQL database name containing the QuickBooks tables is named 'quickbooks' (if the tables don't exist, they'll be created for you)
     $dsn = 'mysql://username:password@host/databasename';
     QuickBooks_WebConnector_Queue_Singleton::initialize($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);
         // Initial test case customer
         $primary_key_of_new_customer = 512;
         // Fire up the Queue
         $Queue = new QuickBooks_WebConnector_Queue($dsn);
         // Drop the directive and the customer into the queue
         $Queue->enqueue(QUICKBOOKS_ADD_CUSTOMER, $primary_key_of_new_customer);
         // Also note the that ->enqueue() method supports some other parameters:
         // 	string $action				The type of action to queue up
         //	mixed $ident = null			Pass in the unique primary key of your record here, so you can pull the data from your application to build a qbXML request in your request handler
         //	$priority = 0				You can assign priorities to requests, higher priorities get run first
         //	$extra = null				Any extra data you want to pass to the request/response handler
         //	$user = null				If you're using multiple usernames, you can pass the username of the user to queue this up for here
         //	$qbxml = null
         //	$replace = true
     }
     //To be used with singleton queue
     $driver_options = array();
     //Callback options, not needed at the moment
     $callback_options = array();
     //nothing needed here at the moment
     $soap_options = array();
     //construct a new instance of the web connector server
     $Server = new QuickBooks_WebConnector_Server($dsn, $map, $errmap, $hooks, $log_level, $soapserver, QUICKBOOKS_WSDL, $soap_options, $handler_options, $driver_options, $callback_options);
     //instruct server to handle responses
     $response = $Server->handle(true, true);
 }
开发者ID:djeraseit,项目名称:quickbooks-php,代码行数:58,代码来源:quickbooks.php

示例2: dirname

    $file = dirname(__FILE__) . '/example.sql';
    if (file_exists($file)) {
        $contents = file_get_contents($file);
        foreach (explode(';', $contents) as $sql) {
            if (!trim($sql)) {
                continue;
            }
            mysql_query($sql) or die(trigger_error(mysql_error()));
        }
    } else {
        die('Could not locate "./example.sql" to create the demo SQL schema!');
    }
    //
    QuickBooks_Utilities::initialize($api_driver_dsn);
    // This
    QuickBooks_Utilities::createUser($api_driver_dsn, $user, $pass);
}
//
$API = new QuickBooks_API($api_driver_dsn, $user, $source_type, $source_dsn, $api_options, $source_options, $driver_options);
// Get the complete list of "Customers" from QuickBooks
//
// Unfortunately, non-US versions of QuickBooks do not yet support the use of
//	"iterators" to break up the response from QuickBooks into many smaller
//	chunks. So, if we ask for the complete customer list, the response is so
//	large that the transfer takes a long time, the Web Connector times out, or
//	the HTTP server throws an error after receiving to much data.
//
//	Thus, instead of sending just a single request, we're going to fetch the
//	list of customers by date range instead.
$seconds_in_a_day = 60 * 60 * 24;
for ($i = strtotime('2009-04-07'); $i < time(); $i = $i + $seconds_in_a_day) {
开发者ID:dsesar,项目名称:quickbooks-php-devkit,代码行数:31,代码来源:example_api_client_canadian.php

示例3: SUBSTRING

				$CustomerID AS ListObjID, 
				ordbillemail AS DataExtValue
			FROM
				isc_orders
			WHERE
				orderid = SUBSTRING($CustomerID, 3) AND 
				$CustomerID LIKE \'O:%\'
		) '), 'orderitem_additional_queries' => array(0 => '
			SELECT 
				ordershipmodule AS ShipMethodID, 
				(ordhandlingcost + ordshipcost) AS Amount,
				CONCAT(\'Shipping and Handling: \', ordshipmethod) AS Descrip,
				\'' . QUICKBOOKS_NONTAXABLE . '\' AS SalesTaxCodeName
			FROM
				isc_orders
			WHERE
				orderid = $OrderID', 1 => '
			SELECT
				CONCAT(\'Billing phone number: \', ordbillphone, \', Shipping phone number: \', ordshipphone) AS Descrip
			FROM
				isc_orders
			WHERE
				orderid = $OrderID '));
$callback_options = array();
if (!QuickBooks_Utilities::initialized($dsn)) {
    QuickBooks_Utilities::initialize($dsn);
    QuickBooks_Utilities::createUser($dsn, $user, $pass);
}
//
$Server = new QuickBooks_Server_Integrator_Interspire($dsn, $integrator_dsn, $alert, $user, $map, $onerror, $hooks, $log_level, $soap, $wsdl, $soap_options, $handler_options, $driver_options, $api_options, $source_options, $integrator_options, $callback_options);
$Server->handle(true, true);
开发者ID:dsesar,项目名称:quickbooks-php-devkit,代码行数:31,代码来源:example_interspire_server.php

示例4: set_time_limit

set_time_limit(0);
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '/Users/kpalmer/Projects/QuickBooks');
require_once 'QuickBooks.php';
if (function_exists('date_default_timezone_set')) {
    date_default_timezone_set('America/New_York');
}
$username = 'quickbooks';
$password = 'password';
error_reporting(E_ALL);
ini_set('display_errors', 1);
//rint(wtaf');
$dsn = 'mysql://root:s4p3rs3c4r3@localhost/quickbooksWIP2';
if (!QuickBooks_Utilities::initialized($dsn)) {
    header('Content-Type: text/plain');
    $driver_options = array();
    $init_options = array('quickbooks_sql_enabled' => true);
    QuickBooks_Utilities::initialize($dsn, $driver_options, $init_options);
    QuickBooks_Utilities::createUser($dsn, $username, $password);
    exit;
}
$mode = QUICKBOOKS_SERVER_SQL_MODE_READONLY;
//$mode = QUICKBOOKS_SERVER_SQL_MODE_WRITEONLY;
//$mode = QUICKBOOKS_SERVER_SQL_MODE_READWRITE;
//Delete Modes -- Remove or Flag?
//$deleteMode = QUICKBOOKS_SERVER_SQL_ON_DELETE_FLAG;
$deleteMode = QUICKBOOKS_SERVER_SQL_ON_DELETE_REMOVE;
// $dsn_or_conn, $how_often, $mode, $conflicts, $users = null,
//	$map = array(), $onerror = array(), $hooks = array(), $log_level, $soap = QUICKBOOKS_SOAPSERVER_BUILTIN, $wsdl = QUICKBOOKS_WSDL, $soap_options = array(), $handler_options = array(), $driver_options = array()
$server = new QuickBooks_Server_SQL($dsn, '1 minute', $mode, $deleteMode, QUICKBOOKS_SERVER_SQL_CONFLICT_NEWER, $username, array(), array(), array(), QUICKBOOKS_LOG_DEVELOP, QUICKBOOKS_SOAPSERVER_PHP, QUICKBOOKS_WSDL);
$server->handle(true, true);
开发者ID:Edgargm87,项目名称:efapcom,代码行数:30,代码来源:NEW_example_sql_server.php

示例5: array

 * 
 */
require_once 'QuickBooks.php';
$user = 'api';
$source_type = QUICKBOOKS_API_SOURCE_WEB;
$api_driver_dsn = 'mysql://root:root@localhost/quickbooks_api';
//$api_driver_dsn = 'pgsql://pgsql@localhost/quickbooks';
$source_dsn = 'http://quickbooks:test@localhost/path/to/server.php';
$api_options = array();
$source_options = array();
$driver_options = array();
if (!QuickBooks_Utilities::initialized($api_driver_dsn)) {
    //
    QuickBooks_Utilities::initialize($api_driver_dsn);
    //
    QuickBooks_Utilities::createUser($api_driver_dsn, 'api', 'password');
}
$API = new QuickBooks_API($api_driver_dsn, $user, $source_type, $source_dsn, $api_options, $source_options, $driver_options);
// CUSTOMERS
$fname = 'Shannon ' . mt_rand();
$lname = 'Daniels';
$Customer = new QuickBooks_Object_Customer();
$Customer->setFirstName($fname);
$Customer->setLastName($lname);
$Customer->setShipAddress('56 Cowles Road', '', '', '', '', 'Willington', 'CT');
$Customer->setMiddleName('R');
$Customer->setSalutation('Mr.');
$Customer->setPhone('1.860.634.1602');
$API->addCustomer($Customer, '_quickbooks_customer_add_callback', 15);
// INVOICES
$Invoice = new QuickBooks_Object_Invoice();
开发者ID:Edgargm87,项目名称:efapcom,代码行数:31,代码来源:example_api_client.php

示例6: date_default_timezone_set

 * This is a very simple application that allows someone to enter a customer 
 * name into a web form, and then adds the customer to QuickBooks.
 * 
 * @author Keith Palmer <keith@consolibyte.com>
 * 
 * @package QuickBooks
 * @subpackage Documentation
 */
// We need to make sure the correct timezone is set, or some PHP installations will complain
if (function_exists('date_default_timezone_set')) {
    // * MAKE SURE YOU SET THIS TO THE CORRECT TIMEZONE! *
    // List of valid timezones is here: http://us3.php.net/manual/en/timezones.php
    date_default_timezone_set('America/New_York');
}
// I always program in E_STRICT error mode...
error_reporting(E_ALL | E_STRICT);
// Require the framework
require_once dirname(__FILE__) . '/../../QuickBooks.php';
// Your .QWC file username/password
$qbwc_user = 'quickbooks';
$qbwc_pass = 'password';
// * MAKE SURE YOU CHANGE THE DATABASE CONNECTION STRING BELOW TO A VALID MYSQL USERNAME/PASSWORD/HOSTNAME *
$dsn = 'mysql://root:root@localhost/quickbooks_example_app_web_connector';
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, $qbwc_user, $qbwc_pass);
    // Create our test table
    mysql_query("CREATE TABLE my_customer_table (\n\t  id int(10) unsigned NOT NULL AUTO_INCREMENT,\n\t  name varchar(64) NOT NULL,\n\t  fname varchar(64) NOT NULL,\n\t  lname varchar(64) NOT NULL,\n\t  quickbooks_listid varchar(255) DEFAULT NULL,\n\t  quickbooks_editsequence varchar(255) DEFAULT NULL,\n\t  quickbooks_errnum varchar(255) DEFAULT NULL,\n\t  quickbooks_errmsg varchar(255) DEFAULT NULL,\n\t  PRIMARY KEY (id)\n\t) ENGINE=MyISAM");
}
开发者ID:djeraseit,项目名称:quickbooks-php,代码行数:31,代码来源:config.php

示例7: qbwc

 /**
  * SOAP endpoint for the Web Connector to connect to
  */
 public function qbwc()
 {
     $user = $this->config->item('quickbooks_user');
     $pass = $this->config->item('quickbooks_pass');
     // Memory limit
     ini_set('memory_limit', $this->config->item('quickbooks_memorylimit'));
     // We need to make sure the correct timezone is set, or some PHP installations will complain
     if (function_exists('date_default_timezone_set')) {
         // * MAKE SURE YOU SET THIS TO THE CORRECT TIMEZONE! *
         // List of valid timezones is here: http://us3.php.net/manual/en/timezones.php
         date_default_timezone_set($this->config->item('quickbooks_tz'));
     }
     // Map QuickBooks actions to handler functions
     $map = array(QUICKBOOKS_ADD_CUSTOMER => array(array($this, '_addCustomerRequest'), array($this, '_addCustomerResponse')));
     // Catch all errors that QuickBooks throws with this function
     $errmap = array('*' => array($this, '_catchallErrors'));
     // Call this method whenever the Web Connector connects
     $hooks = array();
     // An array of callback options
     $callback_options = array();
     // Logging level
     $log_level = $this->config->item('quickbooks_loglevel');
     // What SOAP server you're using
     //$soapserver = QUICKBOOKS_SOAPSERVER_PHP;			// The PHP SOAP extension, see: www.php.net/soap
     $soapserver = QUICKBOOKS_SOAPSERVER_BUILTIN;
     // A pure-PHP SOAP server (no PHP ext/soap extension required, also makes debugging easier)
     $soap_options = array();
     $handler_options = array('deny_concurrent_logins' => false, 'deny_reallyfast_logins' => false);
     // See the comments in the QuickBooks/Server/Handlers.php file
     $driver_options = array('max_log_history' => 32000, 'max_queue_history' => 1024);
     // Build the database connection string
     $dsn = 'mysql://' . $this->db->username . ':' . $this->db->password . '@' . $this->db->hostname . '/' . $this->db->database;
     // Check to make sure our database is set up
     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);
     }
     // Set up our queue singleton
     QuickBooks_WebConnector_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_WebConnector_Server($dsn, $map, $errmap, $hooks, $log_level, $soapserver, QUICKBOOKS_WSDL, $soap_options, $handler_options, $driver_options, $callback_options);
     $response = $Server->handle(true, true);
 }
开发者ID:djeraseit,项目名称:quickbooks-php,代码行数:49,代码来源:quickbooks.php

示例8: array

//	style connection string to the database here.
$api_driver_dsn = null;
// $api_driver_dsn = 'mysql://root:@localhost/quickbooks_api';
// $api_driver_dsn = 'pgsql://pgsql@localhost/quickbooks_onlineedition';
// This is not applicable to QBOE
$source_dsn = null;
// Various API options
$api_options = array();
// Options for QBOE
$source_options = array('certificate' => '/Users/kpalmer/Projects/QuickBooks/QuickBooks/dev/test_qboe.pem', 'connection_ticket' => 'TGT-47-1sRm2nXMVfm$n8hb2MZfVQ', 'application_login' => 'test.www.academickeys.com', 'application_id' => '134476472');
// Driver options
$driver_options = array();
// If you want to log requests/responses to a database, initialize the database
if ($api_driver_dsn and !QuickBooks_Utilities::initialized($api_driver_dsn)) {
    QuickBooks_Utilities::initialize($api_driver_dsn);
    QuickBooks_Utilities::createUser($api_driver_dsn, $username, $password);
}
// Create the API instance
$API = new QuickBooks_API($api_driver_dsn, $username, $source_type, $source_dsn, $api_options, $source_options, $driver_options);
// Turn on debugging mode
//$API->useDebugMode(true);
// With QuickBooks Online Edition, the API can return values to you rather than
//	using callback functions to return values. Remember that is you use this,
//	your code will be less portable to systems using non-real-time connections
//	(i.e. the QuickBooks Web Connector).
//$API->enableRealtime(true);
// Let's get some general information about this connection to QBOE:
print 'Our connection ticket is: ' . $API->connectionTicket() . "\n";
print 'Our session ticket is: ' . $API->sessionTicket() . "\n";
print 'Our application id is: ' . $API->applicationID() . "\n";
print 'Our application login is: ' . $API->applicationLogin() . "\n";
开发者ID:dsesar,项目名称:quickbooks-php-devkit,代码行数:31,代码来源:example_online_edition.php


注:本文中的QuickBooks_Utilities::createUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。