【问题标题】:aggcat php sample is not workingaggcat php 示例不工作
【发布时间】:2013-07-15 08:32:20
【问题描述】:

我正在使用以下配置: Apache/2.2.22 (Win32) PHP/5.4.17

执行 php 示例时,我收到以下错误消息:

注意:未定义的偏移量:1 在 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\class.aggcatauth.php 199 行 $ResponseKVPairs[$OneKVPair[0]] = $OneKVPair[1];

注意:未定义索引:C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\class.aggcatauth.php 中的 oauth_token 位于第 202 行 $oauth_token = $ResponseKVPairs['oauth_token'];

注意:未定义索引:C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\class.aggcatauth.php 中的 oauth_token_secret 位于第 203 行 $oauth_token_secret = $ResponseKVPairs['oauth_token_secret'];

警告:第 65 行 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\example.php 中为 foreach() 提供的参数无效 foreach($xmlObj as $OneInstitution)

我认为原因是从 https://oauth.intuit.com/oauth/v1/get_access_token_by_saml 收到了空令牌(我检查了这个)

我的 Config.php:

<?php

define('SIMPLESAML_PATH',  'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/phplibs/simplesamlphp-1.11.0');
define('SIMPLEOAUTH_PATH',  'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/phplibs');

define('OAUTH_CONSUMER_KEY',   'qyprdM8VUKLwmWSytg83gPmnRSGLWJ');
define('OAUTH_SHARED_SECRET',  'yWdb7SHKubxEKxxFnkliGfDAKnehuwh9fkRmfAYk');

define('SAML_IDENTITY_PROVIDER_ID',  'accountingsuite.12359.cc.dev-intuit.ipp.prod');
define('SAML_X509_CERT_PATH',        'C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit keys\intuit.crt');
define('SAML_X509_PRIVATE_KEY_PATH', 'C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit keys\intuit.key');
define('SAML_NAME_ID',               '001');  // Up to you; just "keep track" of what you use

define('OAUTH_SAML_URL', 'https://oauth.intuit.com/oauth/v1/get_access_token_by_saml');
define('FINANCIAL_FEED_HOST', 'financialdatafeed.platform.intuit.com');
define('FINANCIAL_FEED_URL', 'https://'.FINANCIAL_FEED_HOST.'/');

require_once(SIMPLESAML_PATH . "/lib/xmlseclibs.php");
require_once(SIMPLESAML_PATH . "/lib/SimpleSAML/Utilities.php");
require_once(SIMPLEOAUTH_PATH . "/OAuthSimple.php");

提供的键非常适用于 C# 示例。 (但我使用了 p12 文件)。

那么为什么它不起作用?期待您的回答。

【问题讨论】:

  • 您能否尝试使用 'isset' 检查 $ResponseKVPairs['oauth_token'] 是否已设置。 isset($ResponseKVPairs['oauth_token']) 如果它删除了这个通知,请告诉我。
  • 二手Isset。它修复了通知,但没有解决问题。未收到令牌。警告:在 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\example.php 第 65 行为 foreach() 提供的参数无效 foreach($xmlObj as $OneInstitution) 结果为空。
  • 如果可能请分享example.php文件的代码。您可以使用 apiexplorer developer.intuit.com/docs/0020_customeraccountdata/… 验证 .crt 和 .p12 文件还检查是否在 SAML 中执行了以下步骤[虽然它是一个 ref frm java devkit .. 但步骤相同] developer.intuit.com/docs/0020_customeraccountdata/devkits/… 最后一个建议:)请确保 php devkit 能够指向您的 pvt 密钥文件(p12/jks)
  • 对于提供的示例 (github.com/pleslie/phpaggcat),据我了解,我无法提供 p12 文件的密码,因此我定义了 crt 文件的路径。定义('SAML_X509_PRIVATE_KEY_PATH','C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit keys\intuit.key');这是正确的吗?
  • .p12 文件在 apiexplorer 中工作,但在这个示例 (config.php) 中我不能使用它,因为没有密码字段。

标签: intuit-partner-platform customer-account-data-api


【解决方案1】:

我在启动 PHP 示例应用程序并开始正​​常工作时遇到了麻烦。经过一些调试后,我必须更改以下内容才能使其正常工作:

• OAuthSimple.php 文件不是我按照phpaggcat example 中的说明下载的SimpleSAML 包的一部分。我在这里找到了 OAuthSimple.php 文件:OAuthSimple.php download。

• curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 在 class.aggcatauth.php 中从 true 更改为 false

• curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 在 example.php curl options 中添加了这一行

• set_time_limit(120); // 在 example.php 的开头添加了这个,因为银行下载花费的时间超过了默认的 30 秒

• 在 php.ini 中更改了 max_input_vars = 2500

完成这些更改后,我就可以连接 API 并使其正常工作。

【讨论】:

    猜你喜欢
    • 2012-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多