I have a web application written in VB.net. I implemented the payment via paypal. When I make a payment via pc there is no problem, but when I make a payment via mobile I have some problems. I can't read the paypal parameters on my return page.(i'm using IPN) I used httpwebrequest for read the info from paypal, but the variables request.form is empty, so the response is "INVALID".
Below my code:
Dim objHttp As HttpWebRequest
objHttp = WebRequest.Create("https://www.sandbox.paypal.com/cgi-bin/webscr")
objHttp.Method = "POST"
objHttp.ContentType = "application/x-www-form-urlencoded"
Dim param As Byte() = Request.BinaryRead(HttpContext.Current.Request.ContentLength)
Dim strRequest As String = Encoding.ASCII.GetString(param)
Dim ipnPost As String = strRequest
strRequest += "&cmd=_notify-validate"
objHttp.ContentLength = strRequest.Length
'Send the request to PayPal and get the response
Dim streamOut As New StreamWriter(objHttp.GetRequestStream(), System.Text.Encoding.ASCII)
streamOut.Write(strRequest)
streamOut.Close()
Dim streamIn As New StreamReader(objHttp.GetResponse().GetResponseStream())
Dim strResponse As String = streamIn.ReadToEnd()
streamIn.Close()
Dim myHttpWebResponse As HttpWebResponse = CType(objHttp.GetResponse(), HttpWebResponse)
Dim strIdTransazione = Request.Form("txn_id")
Dim strDscTransazione = Request.Form("payment_status")
'HttpStatusCode.myHttpWebResponse.StatusCode()
If myHttpWebResponse.StatusCode <> HttpStatusCode.OK Then
Else
end if
is there anyone who can help me??? please...