Я пытался обновить настройки AVS и отклонить все транзакции без или с неверным адресом выставления счета.
Я пытаюсь решить эту проблему, но до сих пор не могу понять это.
Вот мои текущие настройки AVS.
Пожалуйста, посмотрите на мой код и посмотрите, что с ним не так.
$post_url = "https://test.authorize.net/gateway/transact.dll";
$CC_API = "*****";
$CC_KEY = "*****";$amount = number_format($formData[total_amt],2);$post_values = array(
// the API Login ID and Transaction Key must be replaced with valid values
"x_login" => $CC_API,
"x_tran_key" => $CC_KEY,
"x_version" => "3.1",
"x_delim_data" => "TRUE",
"x_delim_char" => "|",
"x_relay_response" => "FALSE",
"x_type" => "AUTH_ONLY",
"x_method" => "CC",
"x_card_num" => $formData[cc_num],
"x_exp_date" => $formData[cc_expM].$formData[cc_expY],
"x_amount" => $amount ,
"x_description" => "Test Order",
"x_first_name" => $formData[cc_fname],
"x_last_name" => $formData[cc_lname],
"x_company" => $Data[cust_bill_company_name],
"x_address" => $Data[cust_bill_street_address],
"x_city" => $Data[cust_bill_city],
"x_state" => $Data[cust_bill_state],
"x_zip" => $Data[cust_bill_postcode],
"x_country" => $Data[cust_bill_country],
"x_email" => $Data[cust_email],
//shipping
"x_ship_to_first_name" => $Data[cust_ship_fname],
"x_ship_to_last_name" => $Data[cust_ship_lname],
"x_ship_to_company" => $Data[cust_ship_company_name],
"x_ship_to_address" => $Data[cust_ship_street_address],
"x_ship_to_city" => $Data[cust_ship_city],
"x_ship_to_state" => $Data[cust_ship_state],
"x_ship_to_zip" => $Data[cust_ship_zip],
"x_ship_to_country" => $Data[cust_ship_country]);
// This section takes the input fields and converts them to the proper format
// for an http post. For example: "x_login=username&x_tran_key=a1B2c3D4"$post_string = "";
foreach( $post_values as $key => $value )
{ $post_string .= "$key=" . urlencode( $value ) . "&"; }
$post_string = rtrim( $post_string, "& " );
// This sample code uses the CURL library for php to establish a connection,
// submit the post, and record the response.
// If you receive an error, you may want to ensure that you have the curl
// library enabled in your php configuration
$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 http://www.php.net/curl_setopt
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);
return ($response_array[0]=="1" && $response_array[1]=="1") ? "ok" : $response_array[3];
Песочница имитирует только соединение с платежным процессором. Чтобы сгенерировать конкретные условия ошибки, вам нужно использовать руководство по генерации ошибок по адресу http://developer.authorize.net/tools/errorgenerationguide
Других решений пока нет …