код карты не проходит проверку в authorize.net

Я разрабатываю веб-приложение. Здесь я реализовал платежный шлюз authorize.net. Но здесь код пещеры не проверяется правильно. Если я укажу неправильный код карты, платеж будет успешным, но мне нужен результат, так как платеж отклонен

Кто-нибудь знает это? посмотреть код

                    "x_version"         => "3.1",

                    "x_delim_data"      => "TRUE",

                    "x_delim_char"      => "|",

                    "x_relay_response"  => "FALSE",

                    "x_type"            => "AUTH_CAPTURE",

                    "x_method"          => "CC",

                    "x_card_num"        => $card_number,

                    "x_exp_date"        => $exp_date,

                    "x_amount"          => $amount,

                    "x_description"     => "Live Transaction",

                    "x_card_code"       => $ccv,



                    "x_first_name"      => $bill_name,

                    "x_address"         => $bill_address,

                    "x_city"            => $bill_city,

                    "x_state"           => $bill_state,

                    "x_zip"             => $bill_zip,

                    "x_country"         => $bill_country,

                    "x_phone"           => $bill_phone,

                    "x_email"           => $email,



                   "x_ship_to_first_name"       => $ship_name,

                    "x_ship_to_address"         => $ship_address,

                    "x_ship_to_city"            => $ship_city,

                    "x_ship_to_state"           => $ship_state,

                    "x_ship_to_zip"             => $ship_zip,

                    "x_ship_to_country"         => $ship_country,

                    "x_ship_to_phone"           => $ship_phone

                    // Additional fields can be added here as outlined in the AIM integration

                    // guide at: http://developer.authorize.net

                );



                // 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, "& " );




                // The following section provides an example of how to add line item details to
                // the post string.  Because line items may consist of multiple values with the
                // same key/name, they cannot be simply added into the above array.
                //
                // This section is commented out by default.





                foreach( $line_items as $value )
                    { $post_string .= "&x_line_item=" . urlencode( $value ); }


                // 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);

person Histack    schedule 26.02.2011    source источник
comment
Вы сделали что-то не так. Вам нужно опубликовать код или что-то подобное, чтобы кто-то помог вам с что вы сделали неправильно.   -  person Lasse V. Karlsen    schedule 26.02.2011


Ответы (2)


Это не ошибка кода. Если вы хотите, чтобы платеж был отклонен, когда номер CVV неверен, вам необходимо установить его в панели управления Authorize.Net. Он находится в настройках безопасности.

person John Conde    schedule 26.02.2011

Ваша проблема может быть связана с некоторыми неправильными настройками в учетной записи authorize.net. Проверьте следующее:

  1. Убедитесь, что установлена ​​версия транзакции 3.1. Вы можете сделать это с Settings->Transaction Version->Submit

  2. Задайте параметры отклонения Card Code Verification и выберите параметры N и U. Для этого перейдите на Settings->Card Code Verification

  3. Убедитесь, что в поле x_version установлено значение «3.1», а в поле x_card_code указан номер CCV.

Надеюсь это поможет.

Дополнительные сведения: https://support.authorize.net/authkb/index?page=content&id=A546&impressions=false

person Mar Lu    schedule 05.09.2012