Martialdelastic / google-api-adwords-php

Automatically exported from code.google.com/p/google-api-adwords-php
Apache License 2.0
0 stars 0 forks source link

Undefined method AndySmithOAuthHandler::AddParamsToUrl() in [...]\awApiPHPClient\src\Google\Api\Ads\Common\Util\OAuthHandler.php on line 75 #74

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Which version of the library are you using?

3.1.0

Which version of PHP are you using?

Xampp 1.7.7 - PHP5.3.8

What steps will reproduce the problem?

Testing the OAuth to AdWords.
<?php
require_once 
'[...]awApiPHPClient/src/Google/Api/Ads/AdWords/Lib/AdWordsUser.php';

// Set the OAuth consumer key and secret. Anonymous values can be used for
// testing, and real values can be obtained by registering your application:
// http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html
$oauth_dados = array(
    'oauth_consumer_key' => 'anonymous',
    'oauth_consumer_secret' => 'anonymous'
);

// Create the AdWordsUser and set the OAuth info.
$adwords_user = new AdWordsUser();
$adwords_user->SetOAuthInfo($oauth_dados);
$adwords_user->LogAll();

// Request a new OAuth token. Web applications should pass in a callback URL
// to redirect the user to after authorizing the token.
$adwords_user->RequestOAuthToken();

header('Location: '.$adwords_user->GetOAuthAuthorizationUrl());
exit;
?>

What is the expected output? What do you see instead?

I don't know what is expected, PHP just throw this message to me:
Fatal error: Call to undefined method AndySmithOAuthHandler::AddParamsToUrl() 
in [...]\awApiPHPClient\src\Google\Api\Ads\Common\Util\OAuthHandler.php on line 
75

Please provide any additional information below.

All the [...] is there to hide our folders. Sorry.

I changed the line 75 from
return $this->AddParamsToUrl($endpoint, $params);
to
return UrlUtils::AddParamsToUrl($endpoint, $params);

and then I got redirected to the 
https://accounts.google.com/accounts/OAuthAuthorizeToken page

Thanks,
Rodrigo Saling

Original issue reported on code.google.com by rodrigos...@gmail.com on 24 May 2012 at 10:14

GoogleCodeExporter commented 8 years ago
Thanks for reporting this, I forgot to update that line. Fix is in progress.

Original comment by ekoleda+devrel@googlers.com on 29 May 2012 at 6:59

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r277.

Original comment by ekoleda+devrel@googlers.com on 29 May 2012 at 7:28