Unfortunately, I don't have the time to switch the files from SIM to AIM.
Also, I would still like to use AIM and according to everything I've read, the code should work.
here is the complete script of the processing page:
<?
$authNetURL = "https://secure.authorize.net/gateway/transact.dll";
// Set Array for all data to be sent to Authorize.net
$post_array = array(
//variables that are defined in this page
"x_Test_Request" => "TRUE",
"x_Login" => "xxxxxxxxxx",
"x_Password" => "xxxxxxxxxx",
"x_Version" => "3.1",
"x_Type" => "AUTH_CAPTURE",
"x_Method" => "CC",
"x_Email_Customer" => "TRUE",
"x_Customer_IP" => $HTTP_SERVER_VARS['REMOTE_ADDR'],
"x_Delim_Char" => "'",
"x_Delim_Data" => "TRUE",
"x_Encap_Char" => "",
//variables that are received from an outside form
"x_Amount" => trim($HTTP_POST_VARS['x_Amount']),
"x_Description" => trim($HTTP_POST_VARS['x_Description']),
"x_Card_Num" => trim($HTTP_POST_VARS['x_Card_Num']),
"x_Exp_Date" => trim($HTTP_POST_VARS['x_Exp_Date']),
"x_First_Name" => trim($HTTP_POST_VARS['x_First_Name']),
"x_Last_Name" => trim($HTTP_POST_VARS['x_Last_Name']),
"x_Company" => trim($HTTP_POST_VARS['x_Company']),
"x_Address" => trim($HTTP_POST_VARS['x_Address']),
"x_City" => trim($HTTP_POST_VARS['x_City']),
"x_State" => trim($HTTP_POST_VARS['x_State']),
"x_Zip" => trim($HTTP_POST_VARS['x_Zip']),
"x_Country" => trim($HTTP_POST_VARS['x_Country']),
"x_Email" => trim($HTTP_POST_VARS['x_Email']),
"x_Ship_To_First_Name" => trim($HTTP_POST_VARS['x_Ship_To_First_Name']),
"x_Ship_To_Last_Name" => trim($HTTP_POST_VARS['x_Ship_To_Last_Name']),
"x_Ship_To_Company" => trim($HTTP_POST_VARS['x_Ship_To_Company']),
"x_Ship_To_Address" => trim($HTTP_POST_VARS['x_Ship_To_Address']),
"x_Ship_To_Address_2" => trim($HTTP_POST_VARS['x_Ship_To_Address_2']),
"x_Ship_To_City" => trim($HTTP_POST_VARS['x_Ship_To_City']),
"x_Ship_To_State" => trim($HTTP_POST_VARS['x_Ship_To_State']),
"x_Ship_To_Zip" => trim($HTTP_POST_VARS['x_Ship_To_Zip']),
"x_Ship_To_Country" => trim($HTTP_POST_VARS['x_Ship_To_Country']),
"x_Phone" => trim($HTTP_POST_VARS['x_Phone']),
"Fax" => trim($HTTP_POST_VARS['fax']),
"username" => trim($HTTP_POST_VARS['username']),
"job_title" => trim($HTTP_POST_VARS['job_title']),
"business_type" => trim($HTTP_POST_VARS['business_type'])
);
$data = "";
reset($post_array);
while (list ($key, $val) = each($post_array)) {
$data .= $key . "=" . urlencode($val) . "&";
}
// strip the trailing '&'
$data = preg_replace("/&$/", '', $data);
// initiate connection and set parameters
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $authNetURL);
curl_setopt($ch, CURLOPT_USERAGENT, "X-Cart");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// execute curl and return values
$return_string = curl_exec($ch);
// close connection
curl_close($ch);
// split $return_string by the separating ','
$response = explode(",",$return_string);
// add 1 value to the front of $response so that
// $response index matches up with Authorize.net Response Positions
array_unshift($response,"blank");
if($response[1] == 1){
// successful transaction actions
}else{
// unsuccessful transaction actions
}
?>
I have no idea why I still get the "(92) The gateway no longer supports the requested method of integration." error.
This is driving me crazy.
Thanks, justin