Hi ,
I have not understood your reply.
Below is the code I am using. This is downloaded from Sample code form Authorize.net only.
<?php
include('includes/application_top.php');
include ("data.php");
include ("authnetfunction.php");
#echo "<pre>"; print_r($_SESSION); echo "</pre>";exit;
$ord_qry = "SELECT MemFN ,MemLN ,MemEmail,MemCCType ,MemCCNo ,MemCVV ,MemCCName ,MemBillAdd ,MemBillCity ,MemBillState ,MemBillZip ,MemCCExpMonth ,MemCCExpYear ,MemDOB ,MemSOC ,MemSign ,MemSignupAmt ,MemDate ,MemStatus ,MemSubStartDate from ". TABLE_MEMBER ." where MemID='".$_SESSION['OrdMemID']."' Limit 1";
$order_rs= mysql_query($ord_qry);
$order_values = mysql_fetch_assoc($order_rs);
//define variables to send
$amount = '79.95';
$refId = 'REFFID'.$_SESSION['OrdMemID'];
$name = 'creditfirm.net-First Work Fee';
$length = 1;
$unit = 'months';
$startDate = $order_values['MemSubStartDate'];
$totalOccurrences = 999;
$trialOccurrences = 1;
$trialAmount = $order_values['MemSignupAmt'];
$cardNumber = $order_values['MemCCNo'];
$expirationDate = $order_values['MemCCExpYear'].'-'.$order_values['MemCCExpMonth'];
$cardCode= $order_values['MemCVV'];
$firstName = $order_values['MemFN'];
$lastName = $order_values['MemLN'];
$address = $order_values['MemBillAdd'];
$city = $order_values['MemBillCity'];
$state = $order_values['MemBillState'];
$zip = $order_values['MemBillZip'];
$country = 'USA';
$loginname="87PW9rVqK"; //API_LOGIN_ID
$transactionkey="55z3wADb7uY4R5yf";//TRANSACTION_KEY
$host = "apitest.authorize.net";
$path = "/xml/v1/request.api";
echo "Results <br><br>";
//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>".
"<cardCode>" . $cardCode . "</cardCode>".
"</creditCard>".
"</payment>".
"<billTo>".
"<firstName>". $firstName . "</firstName>".
"<lastName>" . $lastName . "</lastName>".
"<address>" . $address . "</address>".
"<city>" . $city . "</city>".
"<state>" . $state . "</state>".
"<zip>" . $zip . "</zip>".
"<country>" . $country . "</country>".
"</billTo>".
"</subscription>".
"</ARBCreateSubscriptionRequest>";
//send the xml via curl
$response = send_request_via_curl($host,$path,$content);
//if curl is unavilable you can try using fsockopen
/*
$response = send_request_via_fsockopen($host,$path,$content);
*/
//if the connection and send worked $response holds the return from Authorize.net
if ($response)
{
/*
a number of xml functions exist to parse xml results, but they may or may not be avilable on your system
please explore using SimpleXML in php 5 or xml parsing functions using the expat library
in php 4
parse_return is a function that shows how you can parse though the xml return if these other options are not avilable to you
*/
list ($refId, $resultCode, $code, $text, $subscriptionId) =parse_return($response);
echo " Response Code: $resultCode <br>";
echo " Response Reason Code: $code<br>";
echo " Response Text: $text<br>";
echo " Reference Id: $refId<br>";
echo " Subscription Id: $subscriptionId <br><br>";
echo " Data has been written to data.log<br><br>";
echo $loginname;
echo "<br />";
echo $transactionkey;
echo "<br />";
echo "amount:";
echo $amount;
echo "<br \>";
echo "refId:";
echo $refId;
echo "<br \>";
echo "name:";
echo $name;
echo "<br \>";
echo "amount: ";
echo $HTTP_POST_VARS[amount];
echo "<br \>";
echo "<br \>";
echo $content;
echo "<br \>";
echo "<br \>";
$fp = fopen('data.log', "a");
fwrite($fp, "$refId\r\n");
fwrite($fp, "$subscriptionId\r\n");
fwrite($fp, "$amount\r\n");
fclose($fp);
}
else
{
echo "Transaction Failed. <br>";
}
?>