user2029890 user2029890 - 1 month ago 10
PHP Question

Quickbooks PHP API (consolibyte version). Errors connecting

I've been using this for months but out of the blue started getting errors. I re-generated the QB keys but it still happens

When I run anything I first include the config file

include 'quickbooks-php/docs/partner_platform/example_app_ipp_v3/config.php';


In the config file the script always fails at this line:

if ($IntuitAnywhere->check($the_username, $the_tenant) and
$IntuitAnywhere->test($the_username, $the_tenant)){


The errors are:

<b>Notice</b>: unserialize(): Error at offset 0 of 4 bytes in <b>/var/www/html/quickbooks-php/QuickBooks/Encryption/Aes.php</b> on line <b>82</b><br />
<br />
<b>Warning</b>: current() expects parameter 1 to be array, boolean given in <b>/var/www/html/quickbooks-php/QuickBooks/Encryption/Aes.php</b> on line <b>83</b><br />
<br />
<b>Warning</b>: mcrypt_generic_init(): Iv size incorrect; supplied length: 30, needed: 32 in <b>/var/www/html/quickbooks-php/QuickBooks/Encryption/Aes.php</b> on line <b>73</b><br />
<br />
<b>Warning</b>: mdecrypt_generic(): An empty string was passed in <b>/var/www/html/quickbooks-php/QuickBooks/Encryption/Aes.php</b> on line <b>74</b><br />
<br />
<b>Warning</b>: current() expects parameter 1 to be array, boolean given in <b>/var/www/html/quickbooks-php/QuickBooks/Encryption/Aes.php</b> on line <b>83</b><br />


I tried running diagnostics.php and receive the same error.

Would appreciate if Keith (the author who has helped me before) or others can assist. The official forums seems to be down.

Answer

Sounds like your keys got corrupted somehow in your database. Try this:

TRUNCATE quickbooks_oauth;

Then click the [Connect to QuickBooks] button to reconnect to QuickBooks.

BE AWARE THAT ANY USER CONNECTED TO YOUR APP WILL HAVE TO RECONNECT IF YOU DO THIS.

If you don't want to disconnect everyone you can instead just delete the quickbooks_oauth record for your specific realm.