authorize.net生产帐户接受测试信用卡号

时间:2011-05-27 10:59:42

标签: authorize.net

我正在使用authorize.net的arb。我也处于生产模式。但是当我输入测试信用卡号码时,它会在现场网站上接受并让用户注册。其他错误的信用卡号码不被接受。

如果有任何想法,请与我分享。

我的代码如下:

$_CONFIG['Authorize']['g_apihost'] =    "api.authorize.net";
$_CONFIG['Authorize']['g_apipath'] =    "/xml/v1/request.api";

function create_subscription($name,$amount,$refId,$length,$unit,$startDate,$totalOccurrences,$cardNumber,$expirationDate,$firstName,$lastName,$email,$trialOccurrences=0,$trialAmount=0){


//echo $name."<br>".$amount."<br>".$refId."<br>".$length."<br>".$unit."<br>".$startDate."<br>".$totalOccurrences."<br>".$cardNumber."<br>".$expirationDate."<br>".$firstName."<br>".$lastName."<br>".$trialOccurrences."<br>".$trialAmount;exit;
//API SETTING

global $_CONFIG, $mySession;

$loginname=$_CONFIG['Authorize']['g_loginname'];
$transactionkey=$_CONFIG['Authorize']['g_transactionkey'];


$host = $_CONFIG['Authorize']['g_apihost'] ; 



$path = "/xml/v1/request.api";

//END OF API SETTING

//build xml to post
$content =
        "<?xml version=\"1.0\" encoding=\"utf-8\"?>" .
        "<ARBCreateSubscriptionRequest xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\">" .
        "<merchantAuthentication>".
        "<name>" . $loginname . "</name>".
        "<transactionKey>" . $transactionkey . "</transactionKey>".
        "</merchantAuthentication>".
        "<refId>" . $refId . "</refId>".
        "<subscription>".
        "<name>" . $name . "</name>".
        "<paymentSchedule>".
        "<interval>".
        "<length>". $length ."</length>".
        "<unit>". $unit ."</unit>".
        "</interval>".
        "<startDate>" . $startDate . "</startDate>".
        "<totalOccurrences>". $totalOccurrences . "</totalOccurrences>".
        "<trialOccurrences>". $trialOccurrences . "</trialOccurrences>".
        "</paymentSchedule>".
        "<amount>". $amount ."</amount>".
        "<trialAmount>" . $trialAmount . "</trialAmount>".
        "<payment>".
        "<creditCard>".
        "<cardNumber>" . $cardNumber . "</cardNumber>".
        "<expirationDate>" . $expirationDate . "</expirationDate>".
        "</creditCard>".
        "</payment>".
        "<customer>".
        "<email>" . $email . "</email>".
        "</customer>".
        "<billTo>".
        "<firstName>". $firstName . "</firstName>".
        "<lastName>" . $lastName . "</lastName>".
        "</billTo>".
        "</subscription>".
        "</ARBCreateSubscriptionRequest>";

//send the xml via curl
$response = send_request_via_curl($host,$path,$content);
    if ($response){
    list ($refId, $resultCode, $code, $text, $subscriptionId) =parse_return($response);
    $re['refId']=$refId;
    $re['resultCode']=$resultCode;
    $re['code']=$code;
    $re['text']=$text;
    $re['subscriptionId']=$subscriptionId;

    }else{
    $re['refId']=$refId;
    $re['resultCode']=$resultCode;
    $re['code']=$code;
    $re['text']=$text;
    $re['subscriptionId']=$subscriptionId;

    }

    return $re;
}

2 个答案:

答案 0 :(得分:1)

Authorize.NET接受实时模式下的测试信用卡号。我验证了这个客户支持,客户支持经理和他们的开发人员。但他们向我保证交易会被拒绝,这是正确的。不幸的是,没有人希望的那么有用。

答案 1 :(得分:0)

如果正在接受测试信用卡号,那么您没有使用实时服务器或处于测试模式。双击您的代码并验证您没有硬编码测试URL或在任何地方设置测试模式。看起来您的所有代码都没有显示在您的问题中,因为我看不到您的cURL代码位于何处。