String strTransactionID = Request.QueryString["tx"].ToString();
string sOut = "";
string MyIDToken = "MyIdentityToken";
string transactionID = Request.QueryString["tx"].ToString();
string sCmd = "_notify-synch";
string serverURL = "https: //www. paypal. com/cgi-bin/webscr";
try
{
string strFormValues = Request.Form.ToString();
string strPassValue;
string strResponse;
// Create the request back
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(serverURL);
// Set values for the request back
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
//Append the transaction ID, ID Token, and command
//to the form
strPassValue = strFormValues + "&cmd = _notify-synch&at = " + MyIDToken + "&tx = " + transactionID;
req.ContentLength = strPassValue.Length;
// Write the request back IPN strings
StreamWriter stOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
stOut.Write(strPassValue);
stOut.Close();
// Do the request to PayPal and get the response
StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream());
strResponse = stIn.ReadToEnd();
stIn.Close();
sOut = Server.UrlDecode(strResponse);
}
catch (Exception x)
{
}
ASKER
ASKER
ASKER
The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications
TRUSTED BY
string serverURL = "https: //www. paypal. com/cgi-bin/webscr";
remove space between https: and //