昨天上午,在PayPal更新其开发站点之前,我正在开发我的IPN侦听器脚本,使用模拟器能够成功发送测试IPN消息。在他们改变网站之后,模拟器现在为相同的脚本返回http 401错误。我没有改变任何东西,甚至尝试致电贝宝支持。该技术人员表示,他们在更新网站时并不知道IPN的任何问题或更改。我的脚本是经典的asp。IPN模拟器返回401错误
我还尝试使用PHP和ASP.NET中的开发站点上可用的演示脚本之一,并收到相同的401错误代码。我在一个Windows平台上与GoDaddy进行托管,但正如我所说的,在网站更改之前,一切正常。
有没有其他人有这个问题?任何建议?以下是我在我的页面上使用的代码。
<%@LANGUAGE="VBScript"%>
<%
Dim Item_name, Item_number, Payment_status, Payment_amount
Dim Txn_id, Receiver_email, Payer_email
Dim objHttp, str
'read post from PayPal system and add 'cmd'
str = Request.Form & "&cmd=_notify-validate"
'post back to PayPal system to validate
'PayPal Sandbox settings
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
'set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
'set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
'PayPal Sandbox settings
objHTTP.Open "POST", "https://www.sandbox.paypal.com/cgi-bin/webscr" , false
objHTTP.setRequestHeader "Host", "www.sandbox.paypal.com"
objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
objHttp.Send str
'assign posted variables to local variables
Item_name = Request.Form("item_name")
Item_number = Request.Form("item_number")
Payment_status = Request.Form("payment_status")
Payment_amount = Request.Form("mc_gross")
Payment_currency = Request.Form("mc_currency")
Txn_id = Request.Form("txn_id")
Receiver_email = Request.Form("receiver_email")
Payer_email = Request.Form("payer_email")
'Check notification validation
if (objHttp.status <> 200) then
'HTTP error handling
elseif (objHttp.responseText = "VERIFIED") then
'check that Payment_status=Completed
'check that Txn_id has not been previously processed
'check that Receiver_email is your Primary PayPal email
'check that Payment_amount/Payment_currency are correct
'process payment
elseif (objHttp.responseText = "INVALID") then
'log for manual investigation
else
'error
end if
Set objHttp = nothing
%>
我只是想分享一下,问题是从PayPal的一方解决的。一旦他们纠正了有关Sandbox和IPN模拟器的问题,我的HTTP 401错误就消失了。希望这可以帮助其他人的问题。 – 2013-03-14 20:59:45