Je travaille avec le SDK Infusionsoft. J'ai atteint un barrage routier en essayant de faire des appels API.J'ai un objet, mais l'erreur indique que je fais un appel de fonction sur un non-objet
Tout appel que je fais se retrouve avec la même erreur Call to a member function getRefreshToken() on a non-object
(pas toujours getRefreshToken()
cependant).
Quand je var_dump, je vois que c'est un objet .. Alors, qu'est-ce qui donne?
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
qui est l'erreur que je reçois de l'exécution d'un appel comme ...
var_dump($infusionsoft); $infusionsoft->refreshAccessToken();
ou
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>';
}