php - I have an object, but error says I'm making a function call on a non-object -
i'm working infusionsoft sdk. i've reached roadblock in trying make api calls.
any call make ends same call member function getrefreshtoken() on non-object
error (not getrefreshtoken()
though).
when var_dump, see object.. so, gives?
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 member function getrefreshtoken() on non-object in /users/krsna/sites/benjamin_redden/wp-content/plugins/ajaxisform/vendor/infusionsoft/php-sdk/src/infusionsoft/infusionsoft.php on line 261
that error running call like...
var_dump($infusionsoft); $infusionsoft->refreshaccesstoken();
or
function get_those_ids($infusionsoft){ var_dump($infusionsoft); // form ids $formids = $infusionsoft->webforms()->getmap(); // make 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 $formid => $formname){ echo '<option value="'. $formid .'">'. $formname .'</option>'; } echo '</select>'; }
figured out!
i setting token actual string contains token, apparently rather have entire object token (containing refresh token, redirect uri, end of life, , everything)
so, ended being $infusionsoft->settoken($unserializedtoken);
instead of $infusionsoft->settoken($tokenstring);
which worked great, until tried saving information custom post type in wp, , guzzle errors... =(
Comments
Post a Comment