Php 消息:从请求令牌获取应用程序时出错
我试图将QuickBooks Online与PHP连接起来。我使用的是Xampp服务器Windows操作系统 我遵循了ConsoleByte的API。我下载了Quickbooks PHP主存储库,并对config.PHP文件进行了更改 我有一个关于Intuit开发的应用程序,有3把钥匙 当我运行index.php页面时,一切正常 但当我点击“连接到quickbooks”按钮时。出现错误: 错误代码:内部错误 消息:从请求令牌获取应用程序时出错Php 消息:从请求令牌获取应用程序时出错,php,integration,quickbooks,Php,Integration,Quickbooks,我试图将QuickBooks Online与PHP连接起来。我使用的是Xampp服务器Windows操作系统 我遵循了ConsoleByte的API。我下载了Quickbooks PHP主存储库,并对config.PHP文件进行了更改 我有一个关于Intuit开发的应用程序,有3把钥匙 当我运行index.php页面时,一切正常 但当我点击“连接到quickbooks”按钮时。出现错误: 错误代码:内部错误 消息:从请求令牌获取应用程序时出错 error_reporting(E_ALL); in
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Require the library code
require_once dirname(__FILE__) . '/../../../QuickBooks.php';
$token = '76ac0cdabc168b42c2bb997bba4ef0beb2c0';
$oauth_consumer_key = 'qyprdkDO0aY2NHrrk9xx6JZB3xbrIB';
$oauth_consumer_secret = 'eqcBAjc8SnOpVsz49Nf6H5ms58Ns2Up4PJPAe8o5';
$sandbox = true;
$quickbooks_oauth_url = 'http://localhost:81/quickbooks-php- master/docs/partner_platform/example_app_ipp_v3/oauth.php';
$quickbooks_success_url = 'http://localhost:81/quickbooks-php-master/docs/partner_platform/example_app_ipp_v3/success.php';
$quickbooks_menu_url = 'http://localhost:81/quickbooks-php-master/docs/partner_platform/example_app_ipp_v3/menu.php';
$dsn = 'mysqli://root:@localhost/test';
$encryption_key = 'bcde1234';
$the_username = 'DO_NOT_CHANGE_ME';
$the_tenant = 12345;
if (!QuickBooks_Utilities::initialized($dsn))
{
QuickBooks_Utilities::initialize($dsn);
}
$IntuitAnywhere = new QuickBooks_IPP_IntuitAnywhere($dsn, $encryption_key, $oauth_consumer_key, $oauth_consumer_secret, $quickbooks_oauth_url, $quickbooks_success_url);
if ($IntuitAnywhere->check($the_username, $the_tenant) and
$IntuitAnywhere->test($the_username, $the_tenant))
{
$quickbooks_is_connected = true;
$IPP = new QuickBooks_IPP($dsn);
$creds = $IntuitAnywhere->load($the_username, $the_tenant);
$IPP->authMode(
QuickBooks_IPP::AUTHMODE_OAUTH,
$the_username,
$creds);
if ($sandbox)
{
$IPP->sandbox(true);
}
$realm = $creds['qb_realm'];
$Context = $IPP->context();
$CompanyInfoService = new QuickBooks_IPP_Service_CompanyInfo();
$quickbooks_CompanyInfo = $CompanyInfoService->get($Context, $realm);
}
else
{
$quickbooks_is_connected = false;
}
有什么解决办法吗
疑难解答.php文件的响应
尝试点击URL:https://oauth.intuit.com/oauth/v1/get_request_token
我们是否禁用了SSL检查?假的
警告:curl_setopt():无法在第30行的C:\xampp\htdocs\quickbook2\quickbooks php master\docs\partner\u platform\example\u app\u ipp\u v3\troubleshooting.php中将类型输出流表示为STDIO文件*
正在尝试点击URL:https://appcenter.intuit.com/api/v1/Connection/Reconnect
我们是否禁用了SSL检查?假的
警告:curl_setopt():无法在第30行的C:\xampp\htdocs\quickbook2\quickbooks php master\docs\partner\u platform\example\u app\u ipp\u v3\troubleshooting.php中将类型输出流表示为STDIO文件*
正在尝试点击URL:https://oauth.intuit.com/oauth/v1/get_request_token
我们是否禁用了SSL检查?真的
警告:curl_setopt():无法在第30行的C:\xampp\htdocs\quickbook2\quickbooks php-master\docs\partner\u platform\example\u app\u ipp\u v3\troubleshooting.php中将类型输出流表示为STDIO文件*。
oauth_问题=参数_缺席&oauth_参数_缺席=oauth_签名
正在尝试点击URL:https://appcenter.intuit.com/api/v1/Connection/Reconnect
我们是否禁用了SSL检查?真的
警告:curl_setopt():无法在第30行的C:\xampp\htdocs\quickbook2\quickbooks php master\docs\partner\u platform\example\u app\u ipp\u v3\troubleshooting.php中将类型输出流表示为STDIO文件*
需要身份验证
22
2017-03-23T13:08:09.853153Z
php版本:5.6.30
mcrypt分机?真的
mcrypt模块rijndael-256?无效的
卷曲延伸?真的
根据您上面发布的内容,您的PHP安装似乎没有正确验证SSL证书
试试这个:
如果(true),则将此行更改为:
如果(true)
,则将此行更改为:
再试一次。如果修复了它,那么您就知道您的PHP安装被破坏了——它无法正确验证SSL证书
然后,您应该考虑修复PHP安装:
发布您的代码。在Intuit的网站上发布您的沙盒凭证的屏幕截图。检查以确保您有curl和mcrypt扩展。检查以确保您使用的是沙盒凭据,您将$sandbox设置为TRUE。你好,Keith。谢谢你的回复。我所做的是用错误信息和按键图像编辑我的问题。我还添加了config.php文件代码。我正在使用quickbooks上的试用帐户。所以在我的quickbooks帐户上没有一家真正的公司。我只是想先试用一下,而不是和真正的公司合作。如果你需要的话,我可以给你我的Intuit开发者证书。我刚刚在repo上签了一个'troubleshooting.php'脚本。你能把它拉出来,然后把文件的输出发出去吗?你好,基思:我重新编辑了我原来的问题。我已经添加了troubleshooting.php文件的响应。请在我的原始问题中查找troubleshooting.php文件标题的响应。非常感谢Keith。以上两行代码解决了这个问题。它现在已连接。我现在可以运行各种查询。我还希望quickbooks中的数据能够保存在MySQL中。是否有一种在mysqli中为客户、供应商等创建数据表的方法。谷歌“如何用php和mysql创建表”
Trying to hit URL: https://oauth.intuit.com/oauth/v1/get_request_token
Did we disable SSL checks? false
<br />
<b>Warning</b>: curl_setopt(): cannot represent a stream of type Output as a STDIO FILE* in <b>C:\xampp\htdocs\quickbook2\quickbooks-php-master\docs\partner_platform\example_app_ipp_v3\troubleshooting.php</b> on line <b>30</b><br />
Trying to hit URL: https://appcenter.intuit.com/api/v1/Connection/Reconnect
Did we disable SSL checks? false
<br />
<b>Warning</b>: curl_setopt(): cannot represent a stream of type Output as a STDIO FILE* in <b>C:\xampp\htdocs\quickbook2\quickbooks-php-master\docs\partner_platform\example_app_ipp_v3\troubleshooting.php</b> on line <b>30</b><br />
Trying to hit URL: https://oauth.intuit.com/oauth/v1/get_request_token
Did we disable SSL checks? true
<br />
<b>Warning</b>: curl_setopt(): cannot represent a stream of type Output as a STDIO FILE* in <b>C:\xampp\htdocs\quickbook2\quickbooks-php- master\docs\partner_platform\example_app_ipp_v3\troubleshooting.php</b> on line <b>30</b><br />
oauth_problem=parameter_absent&oauth_parameters_absent=oauth_signature
Trying to hit URL: https://appcenter.intuit.com/api/v1/Connection/Reconnect
Did we disable SSL checks? true
<br />
<b>Warning</b>: curl_setopt(): cannot represent a stream of type Output as a STDIO FILE* in <b>C:\xampp\htdocs\quickbook2\quickbooks-php-master\docs\partner_platform\example_app_ipp_v3\troubleshooting.php</b> on line <b>30</b><br />
<?xml version="1.0" encoding="utf-8"?>
<PlatformResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://platform.intuit.com/api/v1">
<ErrorMessage>Authentication required</ErrorMessage>
<ErrorCode>22</ErrorCode>
<ServerTime>2017-03-23T13:08:09.853153Z</ServerTime>
</PlatformResponse>
php version: 5.6.30
mcrypt extension? true
mcrypt module rijndael-256? NULL
curl extension? true