i am using arb of authorize.net. I am also in production mode. but when i enter test credit card numbers it accepts on live site and let the user do register. other wrong credit card numbers are not accepted.
if any body has idea, please share with me.
my code is as follows:
$_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;
}