Skip to content

Commit 36a3f8e

Browse files
Keith Palmer JrKeith Palmer Jr
authored andcommitted
Added a troubleshooting script.
1 parent ef6ff89 commit 36a3f8e

File tree

2 files changed

+81
-15
lines changed

2 files changed

+81
-15
lines changed

docs/partner_platform/example_app_ipp_v3/index.php

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
$dh = opendir(dirname(__FILE__));
1010
while (false !== ($file = readdir($dh)))
1111
{
12-
if (substr($file, 0, 7) != 'example')
13-
{
14-
continue;
12+
if (substr($file, 0, 7) != 'example')
13+
{
14+
continue;
1515
}
1616

1717
$tmp = explode('_', $file);
@@ -23,7 +23,7 @@
2323
case 'add.php':
2424
$examples[$file] = 'Add a ' . implode(' ', array_slice($tmp, 1, -1));
2525
break;
26-
case 'void.php';
26+
case 'void.php';
2727
$examples[$file] = 'Void a ' . implode(' ', array_slice($tmp, 1, -1));
2828
break;
2929
case 'update.php':
@@ -58,24 +58,33 @@
5858
</h1>
5959

6060
<p>
61-
This app demos a PHP connection to QuickBooks Online via the v3 REST APIs.
61+
This app demos a PHP connection to QuickBooks Online via the v3 REST APIs.
6262
</p>
6363
<p>
6464
<strong>Please make sure you review the <a target="_blank" href="http://www.consolibyte.com/docs/index.php/PHP_DevKit_for_QuickBooks_-_Intuit_Partner_Platform_Quick-Start">quick-start tutorial</a>!</strong>
6565
</p>
66-
<p>
67-
<strong>If you need help, make sure you post your code AND the request/response!</strong> <a href="debugging.php">Don't know how to get the request/response?</a>
68-
</p>
66+
<h2>
67+
Need Help?
68+
</h2>
6969
<p>
7070
You can get support on the forums:
7171
</p>
7272
<ul>
7373
<li><a target="_blank" href="http://www.consolibyte.com/forum/">ConsoliBYTE forums</a></li>
7474
<li><a target="_blank" href="https://intuitpartnerplatform.lc.intuit.com/">Intuit Developer forums</a></li>
7575
</ul>
76+
<p>
77+
When you post, <strong>make sure that you:</strong>
78+
</p>
79+
<ul>
80+
<li>Post your code.</li>
81+
<li>Check that all of your OAuth credentials and URLs match between your code and your Intuit account.</li>
82+
<li>Post your XML request/response. <a href="debugging.php">Don't know how to get the request/response?</a></li>
83+
<li>Post the results of the <a href="troubleshooting.php">troubleshooting script</a>.</li>
84+
</ul>
7685

7786
<p>
78-
QuickBooks connection status:
87+
QuickBooks connection status:
7988

8089
<?php if ($quickbooks_is_connected): ?>
8190
<div style="border: 2px solid green; text-align: center; padding: 8px; color: green;">
@@ -108,7 +117,7 @@
108117
</tr>
109118
<tr>
110119
<td>
111-
<a href="disconnect.php">Disconnect from QuickBooks</a>
120+
<a href="disconnect.php">Disconnect from QuickBooks</a>
112121
</td>
113122
<td>
114123
(If you do this, you'll have to go back through the authorization/connection process to get connected again)
@@ -162,13 +171,13 @@
162171
You must authenticate to QuickBooks <b>once</b> before you can exchange data with it. <br>
163172
<br>
164173
<strong>You only have to do this once!</strong> <br><br>
165-
166-
After you've authenticated once, you never have to go
174+
175+
After you've authenticated once, you never have to go
167176
through this connection process again. <br>
168-
Click the button above to
177+
Click the button above to
169178
authenticate and connect.
170-
</div>
171-
<?php endif; ?>
179+
</div>
180+
<?php endif; ?>
172181

173182
</p>
174183
</div>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
ini_set('display_errors', true);
4+
error_reporting(E_ALL);
5+
6+
header('Content-Type: text/plain');
7+
8+
require_once dirname(__FILE__) . '/../../../QuickBooks.php';
9+
10+
$urls = array(
11+
QuickBooks_IPP_IntuitAnywhere::URL_REQUEST_TOKEN,
12+
QuickBooks_IPP_IntuitAnywhere::URL_CONNECT_RECONNECT,
13+
);
14+
15+
for ($i = 0; $i <= 1; $i++)
16+
{
17+
foreach ($urls as $url)
18+
{
19+
ob_start();
20+
$out = fopen('php://output', 'w');
21+
22+
$params = array(
23+
CURLOPT_RETURNTRANSFER => true,
24+
);
25+
26+
$ch = curl_init($url);
27+
curl_setopt_array($ch, $params);
28+
29+
curl_setopt($ch, CURLOPT_VERBOSE, true);
30+
curl_setopt($ch, CURLOPT_STDERR, $out);
31+
32+
if ($i == 1)
33+
{
34+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
35+
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
36+
}
37+
38+
$response = curl_exec($ch);
39+
40+
fclose($out);
41+
$debug = ob_get_clean();
42+
43+
print('Trying to hit URL: ' . $url . "\n\n");
44+
print(' Did we disable SSL checks? ' . trim(var_export((bool) $i, true)) . "\n");
45+
print($debug);
46+
print("\n\n");
47+
print($response);
48+
49+
print("\n\n\n\n\n\n\n");
50+
}
51+
}
52+
53+
print('php version: ' . phpversion() . "\n");
54+
print('mcrypt extension? ' . var_export(function_exists('mcrypt_module_open'), true) . "\n");
55+
print(' mcrypt module rijndael-256? ' . var_export(mcrypt_module_open('rijndael-256', '', 'ofb', ''), true) . "\n");
56+
print('curl extension? ' . var_export(function_exists('curl_init'), true) . "\n");
57+

0 commit comments

Comments
 (0)