Showing results for 
Search instead for 
Did you mean: 

Integration using AIM method not directing to post url in sandbox account after submit button

Hi i am newbie in , i am using AIM method to integrate with my website payment page. but after hitting on   Pay Now button i am not directing to for payment but all the response is successful , payment is done but why my payment got done without going to this link this is my issue because same thing may happen with live . may be i am doing some mistake placing action here is my code sniffet 

in check_out.php and my payment.php contain is like this

form action="payment.php" method="post" name="payform" id="payform


and payment.php contain is 

$post_values = array(
"x_login" => "$LOGINKEY",
"x_tran_key" => "$TRANSKEY",
"x_version" => "3.1",
"x_delim_data" => "TRUE",
"x_delim_char" => "|",
"x_relay_response" => "FALSE",
//"x_market_type" => "2",
"x_device_type" => "1",
"x_type" => "AUTH_CAPTURE",
"x_method" => "CC",
"x_card_num" => $creditCardNumber,
"x_invoice_num" => $invoice_number,
"x_exp_date" => $date,
"x_amount" => $amount,
//"x_description" => "Sample Transaction",
"x_first_name" => $firstName,
"x_last_name" => $lastName,
"x_address" => $address1,
"x_state" => $state,
"x_city" =>$city,
"x_country" =>$country,
"x_company" =>$company,
"x_email" =>$email,
"x_phone" =>$phone,

"x_response_format" => "1",
"x_zip" => $zip
// Additional fields can be added here as outlined in the AIM integration
// guide at:

//echo '<pre>'; echo 'Request values'; print_r($post_values);
//comment the above line. i have given this just for testing purpose.

$post_string = "";
foreach( $post_values as $key => $value )$post_string .= "$key=" . urlencode( $value ) . "&";
$post_string = rtrim($post_string,"& ");

//for test mode use the followin url
$post_url = "";
//for live use this url
//$post_url = "";

$request = curl_init($post_url); // initiate curl object
curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
$post_response = curl_exec($request); // execute curl post and store results in $post_response
// additional options may be required depending upon your server configuration
// you can find documentation on curl options at
curl_close ($request); // close curl object

// This line takes the response and breaks it into an array using the specified delimiting character
$response_array = explode($post_values["x_delim_char"],$post_response);

//echo '<br><br> Response Array'; print_r($response_array);
//remove this line. i have used this just print the response array

echo '<b>Payment Failure</b>. <br>';
echo '<b>Error String</b>: '.$response_array[3];

echo '<br><br>Press back button to go back to the previous page';
$ptid = $response_array[6];
$ptidmd5 = $response_array[7];

echo "$ptid "."Payment Success";

where i am making mistake while in defining action or missing something Please advice


Accepted Solutions

this is AIM

that how it work, you don't use the for payment because you are using credit present.

View solution in original post


this is AIM

that how it work, you don't use the for payment because you are using credit present.