If you’re getting the error message “CAPTCHA challenge issued by server” when using Magento while trying to add products to Google Base, here’s the solution we found. As always, BACK UP!
In the file: /app/code/core/Mage/GoogleBase/Model/Service.php
Find this line:
// Create an authenticated HTTP client
$errorMsg = Mage::helper(’googlebase’)->__(’Unable to connect to Google Base. Please, check Account settings in configuration.’);
try {
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, Zend_Gdata_Gbase::AUTH_SERVICE_NAME, null, ”,
$loginToken, $loginCaptcha,
Zend_Gdata_ClientLogin::CLIENTLOGIN_URI,
$type
);
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
Change it to read this:
// Create an authenticated HTTP client
$errorMsg = Mage::helper(’googlebase’)->__(’Unable to connect to Google Base. Please, check Account settings in configuration.’);
try {
if (!Mage::registry(’GAPI_CLIENT’)) {
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, Zend_Gdata_Gbase::AUTH_SERVICE_NAME, null, ”,
$loginToken, $loginCaptcha,
Zend_Gdata_ClientLogin::CLIENTLOGIN_URI,
$type
);
Mage::register(’GAPI_CLIENT’, $client);
} else {
$client = Mage::registry(’GAPI_CLIENT’);
}
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
That should take care of the problem “CAPTCHA challenge issued by server” using Google Base in Magento
