using asp to open a secure socket

cz007j

Freshman
Joined
Jul 28, 2004
Messages
26
Hello people

I'm creating a web form that takes credit card info. This info then as to be sent open a secure socket to a third party for validation and processing.
my question is

how do I capture a response from my form?

is there some function such as fsockopen in php in asp or vb?

I can if there is, I could perhaps disguise a string of the info as a page and send it over

thank you very much in advance
 
Credit Card services that I have used return the response either as a string or as a web page. This is a framework of how I dealt with the response.

HttpWebRequest request;
HttpWebResponse pageResponse;
ASCIIEncoding encoding = new ASCIIEncoding();
string tempData = string.Empty;

request = (HttpWebRequest)WebRequest.Create(url);
request.KeepAlive = false;
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";

//create string to send - tempData

byte[] data = encoding.GetBytes(tempData);
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
stream.Write(data, 0, data.Length);
stream.Close();

pageResponse = (HttpWebResponse)request.GetResponse();

streamReader responseStream = new StreamReader(pageResponse.GetResponseStream(), Encoding.ASCII);

responseText = responseStream.ReadToEnd();
responseStream.Close();

//parse response
 
Diesel said:
Credit Card services that I have used return the response either as a string or as a web page. This is a framework of how I dealt with the response.

HttpWebRequest request;
HttpWebResponse pageResponse;
ASCIIEncoding encoding = new ASCIIEncoding();
string tempData = string.Empty;

request = (HttpWebRequest)WebRequest.Create(url);
request.KeepAlive = false;
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";

//create string to send - tempData

byte[] data = encoding.GetBytes(tempData);
request.ContentLength = data.Length;
Stream stream = request.GetRequestStream();
stream.Write(data, 0, data.Length);
stream.Close();

pageResponse = (HttpWebResponse)request.GetResponse();

streamReader responseStream = new StreamReader(pageResponse.GetResponseStream(), Encoding.ASCII);

responseText = responseStream.ReadToEnd();
responseStream.Close();

//parse response

Thanks a bunch
 
Back
Top