0
votes

I am using the quickbooks-php from GitHub. The version is quickbooks-php-master\docs\partner_platform\quickbooks-php-master\docs\partner_platform\example_app_ipp_v3.

I used this version 3 or 4 years ago and it work OK. Recently I wanted to try it again for a project. Since the last time I used it they only used OAUTH1 now they are using OAUTH2 for login and I'm not able to connect to my Sandbox account. I get a general error when the php coded tries to return the company name.

My question is do I need to make changes to the quickbooks-php-master\docs\partner_platform\example_app_ipp_v3 version in order to get it working again. I have the Development Keys (Client ID and Client Secret) from the developers site.

The config.php file is where you place these keys: $token = 'xxx'; oauth_consumer_key = 'xxx'; `$oauth_consumer_secret = 'xxx';

The names of these keys have changed so it is a bit confusion as to whether these can work this way.

So the main question is does example_app_ipp_v3 work with OAUTH2 and if so can you direct me to the changes I need to make.

Any help on this would be great. If this version doesn't work with OAUTH2 I just need to know if that is the case so I can try something else.

1

1 Answers

0
votes

OAuth2.0 support is being rolled out now. Check out the migration guide here:

And the most recent updates. More updates to come. The configuration code changes a bit to accommodate the new OAuth 2.0 requirements:

$oauth_client_id = 'Q0ql65UCww8oAoiXfNdVyZ5WHoZ0kJ43XqstMhxGtM2UuA5WKu';
$oauth_client_secret = 'S60VXMXFygEOcb08DleS8iePUFyH81i4FhVrKaAB';

$sandbox = true;     // When you're using development tokens

// This is the URL of your OAuth auth handler page
$quickbooks_oauth_url = 'http://sandbox.test/quickbooks-php/docs/partner_platform/example_app_ipp_v3/oauth.php';

// This is the URL to forward the user to after they have connected to IPP/IDS via OAuth
$quickbooks_success_url = 'http://sandbox.test/quickbooks-php/docs/partner_platform/example_app_ipp_v3/success.php';

// This is the menu URL script
$quickbooks_menu_url = 'http://sandbox.test/quickbooks-php/docs/partner_platform/example_app_ipp_v3/menu.php';

// This is a database connection string that will be used to store the OAuth credentials
$dsn = 'mysqli://dev:password@localhost/quickbooks';

// You should set this to an encryption key specific to your app
$encryption_key = 'bcde1234';

// Scope required
$scope = 'com.intuit.quickbooks.accounting ';

$IntuitAnywhere = new QuickBooks_IPP_IntuitAnywhere(
    QuickBooks_IPP_IntuitAnywhere::OAUTH_V2,
    $sandbox,
    $scope,
    $dsn,
    $encryption_key,
    $oauth_client_id,
    $oauth_client_secret,
    $quickbooks_oauth_url,
    $quickbooks_success_url);