(13) 商户登录ID或密码无效或账户无效.(authorize.net使用aim方法) [英] (13) The merchant login ID or password is invalid or the account is inactive.(usig Aim method for authorize.net)

查看:32
本文介绍了(13) 商户登录ID或密码无效或账户无效.(authorize.net使用aim方法)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,当我将 action 定义为 payment.php 时一切正常,但是一旦我定义 action post_url,它就会给我这个错误.所以请帮助我.测试帐户的所有登录凭据都正常并已检查.

这是我的 checkout.php 表单操作

<?php include_once('payment.php');?><form method="post" action='<?php echo $post_url;?>'>

这是我的payment.php文件,包含所有关于url和键值的信息

"$LOGINKEY",x_tran_key" =>"$TRANSKEY",x_version" =>"3.1",x_delim_data"=>真的",x_delim_char" =>"|",x_relay_response" =>错误的",//"x_market_type" =>"2",x_device_type" =>"1",x_type" =>"AUTH_CAPTURE",x_method" =>"抄送",x_card_num" =>$信用卡号,x_invoice_num" =>$invoice_number,x_exp_date"=>$日期,x_amount" =>金额,//"x_description" =>"示例交易",x_first_name" =>$名字,x_last_name" =>$姓,x_address" =>$地址1,x_state" =>$状态,"x_city" =>$city,"x_country" =>$country,"x_company" =>$company,"x_email" =>$email,"x_phone" =>$phone,x_response_format" =>"1",x_zip" =>$zip//可以在此处添加其他字段,如 AIM 集成中所述//指南:http://developer.authorize.net);//echo '

';echo '请求值';打印_r($post_values);//注释上面的行.我给出这个只是为了测试目的.$post_string = "";foreach( $post_values as $key => $value )$post_string .= "$key=" .urlencode( $value ) ."&";$post_string = rtrim($post_string,"&");//对于测试模式使用以下网址$post_url = "https://test.authorize.net/gateway/transact.dll";//对于真实账户(即使在测试模式下),请确保您发布到//$post_url = "https://secure.authorize.net/gateway/transact.dll";$request = curl_init($post_url);//启动 curl 对象curl_setopt($request, CURLOPT_HEADER, 0);//设置为 0 以消除响应中的标头信息curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);//返回响应数据而不是 TRUE(1)curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);//使用 HTTP POST 发送表单数据curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);//如果您没有收到网关响应,请取消注释此行.$post_response = curl_exec($request);//执行 curl post 并将结果存储在 $post_response 中//根据您的服务器配置,可能需要其他选项//您可以在 http://www.php.net/curl_setopt 上找到有关 curl 选项的文档curl_close ($request);//关闭卷曲对象//此行获取响应并使用指定的分隔符将其分解为数组$response_array =explode($post_values["x_delim_char"],$post_response);//echo '

响应数组';打印_r($response_array);//删除这一行.我用过这个只是打印响应数组if($response_array[0]==2||$response_array[0]==3){//成功echo '<b>支付失败</b>.<br>';echo '<b>错误字符串</b>: '.$response_array[3];echo '<br><br>按返回键返回上一页';}别的{$ptid = $response_array[6];$ptidmd5 = $response_array[7];$status=$response_array[0];echo "$ptid "."支付成功";回声$状态";}如果($状态== 1){require_once('Rescue_soap.php');$new_soap = new Rescuesoap();$new_soap->check_contacts($_REQUEST);}?>

感谢帮助

解决方案

我在这里找到解决方案:https://support.authorize.net/authkb/index?page=content&id=A415

如果简而言之描述该决定,您很可能正在尝试发送有关测试证书的实时数据.

//对于测试模式使用以下网址$post_url = "https://test.authorize.net/gateway/transact.dll";//对于真实账户(即使在测试模式下),请确保您发布到//$post_url = "https://secure.authorize.net/gateway/transact.dll";

将 $post_url 更改为 "https://secure.authorize.net/gateway/transact.dll"

So when i am defining action as payment.php all working fine but as soon as i define action post_url its giving me this error. So please assist me. all the log in credential for test account is ok and checked.

here is my check out.php form action

<?php  include_once('payment.php');  ?> 
<form  method="post" action='<?php echo $post_url; ?>'>

here is my payment.php file contain all the information about url and key values

<?php


        //log in credentials and key values 

        $LOGINKEY = '24Xd2WdY';// x_login


        $TRANSKEY = 'xxxx';//x_tran_key

        $firstName =urlencode( $_POST['first_name']);

        $lastName =urlencode($_POST['last_name']);

        $creditCardType =urlencode( $_POST['card_type']);

        $creditCardNumber = urlencode($_POST['cardnumber']);

        $expDateMonth =urlencode( $_POST['cardmonth']); 

        // Month must be padded with leading zero
        $padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT);

        $expDateYear =urlencode( $_POST['cardyear']);

        $cvv2Number = urlencode($_POST['cardsecuritycode']);

        $address1 = urlencode($_POST['street1']);

        $city = urlencode($_POST['city']);

        $state =urlencode( $_POST['state']);

        $zip = urlencode($_POST['zipcode']);

        $country = urlencode($_POST['country']);

        $company = urlencode($_POST['company']);

        $email = urlencode($_POST['email']);

        $phone = urlencode($_POST['phone']);

        $invoice_number=urlencode($_POST['order_id']);

        $amount = urlencode($_POST['amount_charged']);

        $currencyCode="USD";

        $paymentType="Sale";

        $date = $expDateMonth.$expDateYear;


    $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: http://developer.authorize.net
    );

    //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 = "https://test.authorize.net/gateway/transact.dll";
    //for real accounts (even in test mode), please make sure that you are posting to 
    //$post_url = "https://secure.authorize.net/gateway/transact.dll"; 

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


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

    if($response_array[0]==2||$response_array[0]==3) 
    {
        //success 
        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';
    }
    else
    {
        $ptid = $response_array[6];
        $ptidmd5 = $response_array[7];
        $status=$response_array[0];


        echo "$ptid "."Payment Success";
        echo"$status";
    }
    if ($status==1) {

        require_once('Rescue_soap.php');
        $new_soap = new Rescuesoap();
        $new_soap->check_contacts($_REQUEST);
        }
?>

thanks for help

解决方案

I Find solution here: https://support.authorize.net/authkb/index?page=content&id=A415

if in short describe the decision, it is likely that you are trying to send live data on the test certificate.

//for test mode use the followin url
$post_url = "https://test.authorize.net/gateway/transact.dll";
//for real accounts (even in test mode), please make sure that you are posting to 
//$post_url = "https://secure.authorize.net/gateway/transact.dll"; 

Change $post_url to "https://secure.authorize.net/gateway/transact.dll"

这篇关于(13) 商户登录ID或密码无效或账户无效.(authorize.net使用aim方法)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆