I'm getting the Soap error also. And tried to follow Drew's suggestion. Is this correct, Drew?
class SoapClientHMAC extends SoapClient {
function __doRequest($request, $location, $action, $version, $one_way = NULL) {
global $context;
$mode_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_TRANSACTION_MODE'");
$trans_mode = tep_db_fetch_array($mode_query);
$show_mode = implode($trans_mode);
if ($show_mode == 'Test') { // Demo server
$hkey_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_DEMO_MD5_HASH'");
$hkey = tep_db_fetch_array($hkey_query);
$idkey_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_DEMO_TRANSACTION_KEY'");
$idkey = tep_db_fetch_array($idkey_query);
} else { // Live Server
$hkey_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_MD5_HASH'");
$hkey = tep_db_fetch_array($hkey_query);
$idkey_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_TRANSACTION_KEY'");
$idkey = tep_db_fetch_array($idkey_query);
}
$show_hkey = implode($hkey);
$hmackey = "$show_hkey"; // HMAC Key
$show_key = implode($idkey);
$keyid = "$show_key"; // API Key ID
$hashtime = date("c");
$hashstr = "POST\ntext/xml; charset=utf-8\n" . sha1($request) . "\n" . $hashtime . "\n" . parse_url($location,PHP_URL_PATH);
$authstr = base64_encode(hash_hmac("sha1",$hashstr,$hmackey,TRUE));
ini_set("user_agent", "PHP-SOAP/" . PHP_VERSION . "\r\nAuthorization: GGE4_API " . $keyid . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request));
return parent::__doRequest($request, $location, $action, $version, $one_way);
}
}
class gge4_cc_aim extends SoapClientHMAC {
var $code, $title, $description, $enabled;
// class constructor