PayPal POST付款不适用于移动浏览器Pin [英] PayPal POST payment not working on mobile browsers Pin

查看:144
本文介绍了PayPal POST付款不适用于移动浏览器Pin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用VB.net编写的Web应用程序。我通过paypal实现了付款。当我通过电脑付款时没有问题,但是当我通过手机付款时,我遇到了一些问题。我无法在返回页面上阅读paypal参数。(我正在使用IPN)我使用httpwebrequest从paypal读取信息,但变量request.form为空,因此响应为INVALID。



低于我的代码:





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



'将请求发送到PayPal并获取响应

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()



如果myHttpWebResponse.StatusCode<> HttpStatusCode.OK然后



否则



结束如果







有谁可以帮助我???请...

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...

推荐答案

您已在 http://www.codeproject.com/Messages/4923394/PayPal-POST-payment-not-working-on-mobile-browsers.aspx [ ^ 。请仅在一个论坛发帖。
You already posted this at http://www.codeproject.com/Messages/4923394/PayPal-POST-payment-not-working-on-mobile-browsers.aspx[^]. Please post in one forum only.


这篇关于PayPal POST付款不适用于移动浏览器Pin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆