我正在使用Infusionsoft SDK。我试图进行一些API调用时遇到了障碍。我有一个对象,但错误表示我正在对一个非对象进行函数调用
我发出的任何呼叫都以相同的Call to a member function getRefreshToken() on a non-object
错误结束(但并非总是getRefreshToken()
)。
当我var_dump,我看到它是一个对象..所以,什么给?
object(Infusionsoft\Infusionsoft)#182 (13) { ["url":protected]=> string(42) "https://api.infusionsoft.com/crm/xmlrpc/v1" ["auth":protected]=> string(51) "https://signin.infusionsoft.com/app/oauth/authorize" ["tokenUri":protected]=> string(34) "https://api.infusionsoft.com/token" ["clientId":protected]=> string(24) "actual client ID" ["clientSecret":protected]=> string(10) "actual secret key" ["redirectUri":protected]=> string(65) "http://benjamin_redden.dev/wp-content/plugins/ajaxIsForm/auth.php" ["apis":protected]=> array(0) { } ["debug":protected]=> bool(false) ["httpClient":protected]=> NULL ["httpLogAdapter":protected]=> NULL ["serializer":protected]=> NULL ["needsEmptyKey"]=> bool(true) ["token":protected]=> string(24) "actual token" } Fatal error: Call to a member function getRefreshToken() on a non-object in /Users/Krsna/Sites/benjamin_redden/wp-content/plugins/ajaxIsForm/vendor/infusionsoft/php-sdk/src/Infusionsoft/Infusionsoft.php on line 261
那就是我从运行的调用,比如得到错误...
var_dump($infusionsoft); $infusionsoft->refreshAccessToken();
或
function get_those_ids($infusionsoft){
var_dump($infusionsoft);
// get the form IDS
$formIDS = $infusionsoft->webForms()->getMap();
// make the dropdown
echo '<select name="infusionsoft_forms_which_form_would_you_like_to_use_" id="infusionsoft_forms_which_form_would_you_like_to_use_">';
foreach($formIDS as $formID => $formName){
echo '<option value="'. $formID .'">'. $formName .'</option>';
}
echo '</select>';
}