Hello I am unable to identify where I am mistaken as Trying to collect data Instant payment notification from Checkout by Amazon.
The question is how to recieve http post request made by CBA on our endpoint. My url is https:www.mysite.com/IOPNReturn.aspx.
And I have another page that runs periodically to catch wether IOPN (Instant payment notification ) is recieved or not at my.
Tried all Httpwebrequest , XMlreader , xmldoc . Ever thing is coming blank.
And the suport sayst they are successfully pushing IOPN data at our IOPNReturn.aspx.
Any guide why httpwebrequest collector is not working
I tried following two both not working.
string url = https:www.mysite.com/IOPNReturn.aspx.
public static string GetPageAsString() { string result = ""; // Create the web request HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; // Get response using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { // Get the response stream StreamReader reader = new StreamReader(response.GetResponseStream()); // Read the whole contents and return as a string result = reader.ReadToEnd(); } return result; } private string PostPage() { string result = string.Empty; WebClient client = new WebClient(); client.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); // byte[] response = client.UploadData(url, "POST", request); byte[] response = client.DownloadData(url); result = Encoding.ASCII.GetString(response); return result; }