Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the SDK,use example_ipp_ids_6.php for adding customers.</p> <p>Here is the link to the full code on GitHub:</p> <ul> <li><a href="https://github.com/consolibyte/quickbooks-php" rel="nofollow">GitHub - open source QuickBooks PHP DevKit</a></li> </ul> <p>And a quick-start guide:</p> <ul> <li><p><a href="http://www.consolibyte.com/docs/index.php/PHP_DevKit_for_QuickBooks_-_Intuit_Partner_Platform_Quick-Start" rel="nofollow">QuickBooks ONLINE quick-start with PHP</a></p></li> <li><p><a href="http://www.consolibyte.com/docs/index.php/PHP_DevKit_for_QuickBooks_-_Quick-Start" rel="nofollow">QuickBooks for WINDOWS quick-start with PHP</a></p></li> </ul> <p>example_ipp_ids_6.php</p> <pre><code> &lt;?php // Turn on some error reporting error_reporting(E_ALL); ini_set('display_errors', 1); header('Content-Type: text/plain'); /** * Require the QuickBooks library */ require_once dirname(__FILE__) . '/../QuickBooks.php'; /** * Require some IPP/OAuth configuration data */ require_once dirname(__FILE__) . '/example_ipp_config.php'; // Set up the IPP instance $IPP = new QuickBooks_IPP($dsn); // Set up our IntuitAnywhere instance $IntuitAnywhere = new QuickBooks_IPP_IntuitAnywhere($dsn, $encryption_key, $oauth_consumer_key, $oauth_consumer_secret); // Get our OAuth credentials from the database $creds = $IntuitAnywhere-&gt;load($the_username, $the_tenant); // Tell the framework to load some data from the OAuth store $IPP-&gt;authMode( QuickBooks_IPP::AUTHMODE_OAUTH, $the_username, $creds); // Print the credentials we're using //print_r($creds); // This is our current realm $realm = $creds['qb_realm']; // Load the OAuth information from the database if ($Context = $IPP-&gt;context()) { // Set the DBID $IPP-&gt;dbid($Context, 'something'); // Set the IPP flavor $IPP-&gt;flavor($creds['qb_flavor']); // Get the base URL if it's QBO if ($creds['qb_flavor'] == QuickBooks_IPP_IDS::FLAVOR_ONLINE) { $IPP-&gt;baseURL($IPP-&gt;getBaseURL($Context, $realm)); } print('Base URL is [' . $IPP-&gt;baseURL() . ']' . "\n\n"); $CustomerService = new QuickBooks_IPP_Service_Customer(); $Customer = new QuickBooks_IPP_Object_Customer(); $Customer-&gt;setName('Willy Wonka #' . mt_rand(0, 1000)); $Customer-&gt;setGivenName('Willy'); $Customer-&gt;setFamilyName('Wonka'); $resp = $CustomerService-&gt;add($Context, $realm, $Customer); print_r($Customer); print('New customer is [' . $resp . ']' . "\n\n"); print("\n\n\n\n"); print('Request [' . $IPP-&gt;lastRequest() . ']'); print("\n\n\n\n"); print('Response [' . $IPP-&gt;lastResponse() . ']'); print("\n\n\n\n"); } else { die('Unable to load a context...?'); } </code></pre> <p>Configure your keys and username in example_ipp_config.php</p> <pre><code>&lt;?php /** * Intuit Partner Platform configuration variables * * See the scripts that use these variables for more details. * * @package QuickBooks * @subpackage Documentation */ // Your OAuth token (Intuit will give you this when you register an Intuit Anywhere app) $token = 'c640731cb411db4132b8475b4198a7efae08'; // Your OAuth consumer key and secret (Intuit will give you both of these when you register an Intuit app) // // IMPORTANT: // To pass your tech review with Intuit, you'll have to AES encrypt these and // store them somewhere safe. // // The OAuth request/access tokens will be encrypted and stored for you by the // PHP DevKit IntuitAnywhere classes automatically. $oauth_consumer_key = 'qyprdzUiOLX60UK4cMwYhg1QVGfOGT'; $oauth_consumer_secret = '32mIB75pqqPreOADcxRvryC0fBduJhnRr52JfUdf'; // This is the URL of your OAuth auth handler page $this_url = 'http://localhost/quick/docs/example_ipp_oauth.php'; // This is the URL to forward the user to after they have connected to IPP/IDS via OAuth $that_url = 'http://localhost/quick/docs/example_ipp_ids_6.php'; // This is a database connection string that will be used to store the OAuth credentials // $dsn = 'pgsql://username:password@hostname/database'; // $dsn = 'mysql://username:password@hostname/database'; $dsn = 'mysql://root:@localhost/quickbooks'; // You should set this to an encryption key specific to your app $encryption_key = 'abcd1234'; // The user that's logged in $the_username = 'test@gmail.com'; // The tenant that user is accessing within your own app $the_tenant = 12345; // Initialize the database tables for storing OAuth information if (!QuickBooks_Utilities::initialized($dsn)) { // Initialize creates the neccessary database schema for queueing up requests and logging QuickBooks_Utilities::initialize($dsn); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload