Search code examples
phpquickbooks

Consolibyte Quickbooks Connection Problem


I'm trying to connect my website (in Developer Mode, so Sandbox True, non https) to Intuit from the Consolibyte "docs/partner_platform/example_app_ipp_v3/index.php" file, but I keep getting the following error:

Uh oh, there’s a connection problem. Sorry, but the app didn’t connect. Please try again later, or contact customer support for help.

View error details (for Developers) The redirect_uri query parameter value is invalid. Make sure it is listed in the Redirect URIs section on your app's keys tab and matches it exactly. Click here to learn more about the redirect_uri query parameter.

I've set the Redirect Uri in my intuit developer account for this app to the same Return URL in the Consolibyte config.php (docs/partner_platform/example_app_ipp_v3/success.php), but it still isn't working.

Am I doing something wrong? I followed everything in the quick start guide correctly.

config.php code:

$oauth_client_id = '***';
$oauth_client_secret = '***';

// If you're using DEVELOPMENT TOKENS, you MUST USE SANDBOX MODE!!!  If you're in PRODUCTION, then DO NOT use sandbox.
$sandbox = true;     // When you're using development tokens
//$sandbox = false;    // When you're using production tokens

// This is the URL of your OAuth auth handler page
$quickbooks_oauth_url = 'http://www.***.com/quickbooks/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://www.***.com/quickbooks/docs/partner_platform/example_app_ipp_v3/success.php';

// This is the menu URL script
$quickbooks_menu_url = 'http://www.***.com/quickbooks/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 = 'pgsql://username:password@hostname/database';
// $dsn = 'mysql://username:password@hostname/database';
$dsn = 'mysqli://***_intuit:***@localhost/***_quickbooks';

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

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

// The tenant that user is accessing within your own app
$the_tenant = 12345;

Solution

  • Your redirect URL doesn't match.

    • In Intuit's control panel it ends with success.php.
    • In your configuration, it ends with oauth.php.

    The two URLs have to match exactly.

    Also, make sure you're using the latest code from https://github.com/consolibyte/quickbooks-php - if you're using the latest code, you should have a config_oauthv2.php file and not just config.php.