Hi ,
Im begineer , anyone please tell me how i can integrate Automated Recurring Billing with Advanced integegration.
As i have following code :
Do tell me what should i have to add in it
try
{
// for real accounts (even in test mode), please make sure that you are
// posting to: https://secure.authorize.net/gateway/transact.dll
String url = "https://test.authorize.net/gateway/transact.dll";
Dictionary<string, string> values = new Dictionary<string, string>();
values.Add("x_login", "zzzz");
values.Add("x_tran_key", "zzzzz");
values.Add("x_delim_data", "TRUE");
values.Add("x_delim_char", "|");
values.Add("x_relay_response", "FALSE");
values.Add("x_type", "AUTH_CAPTURE");
values.Add("x_method", "CC");
values.Add("x_card_num", "4111111111111111");
values.Add("x_exp_date", "0115");
values.Add("x_amount", "19.99");
values.Add("x_description", "Sample Transaction");
values.Add("x_first_name", cus.FirstName);
values.Add("x_last_name", cus.LastName);
values.Add("x_address", ship.StreetAddress);
values.Add("x_state", ship.State);
values.Add("x_zip", ship.PostalCode);
string dataTosend = "";
foreach (var item in values)
{
dataTosend += item.Key + "=" + HttpUtility.UrlEncode(item.Value) + "&";
}
dataTosend = dataTosend.TrimEnd('&');
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = dataTosend.Length;
strm = request.GetRequestStream();
swr = new StreamWriter(strm);
swr.WriteLine(dataTosend);
response =(HttpWebResponse) request.GetResponse();
strm = response.GetResponseStream();
srdr = new StreamReader(strm);
string dataReceived = "";
dataReceived = srdr.ReadToEnd();
Array arr = dataReceived.Split('|');
swr.Close(); response.Close();
return (string) arr.GetValue(3);
}
04-04-2013 10:27 AM
anyone please reply
04-04-2013 11:56 AM
look and see at the sample code
04-04-2013 12:19 PM