我正在使用 paypal 和沙箱环境的立即订阅按钮进行测试,并使用 ASP.net MVC3 作为开发环境。 付款完成后,我检查了 IPN 历史记录,响应显示为 200,网址为 如我所料。
我在 Home Controller 中创建了监听器,如下所示。
[HttpPost]
public ActionResult paypalCallback()
{
//Doing some hardcoded DB insertions.
DodbInsertion("Received");
//Writing log file
WriteLog("Ipn Log");
Dictionary<string, string> result = new Dictionary<string, string>();
result.Add("Status", "Success");
return Json(result, JsonRequestBehavior.AllowGet);
数据库中没有任何内容在写,博客中也没有任何内容发生。 然后我使监听器函数成为 GET 方法并从浏览器调用,然后记录和数据库插入正在发生。即数据库插入和日志功能将正常工作。但是当它从 Paypal IPN Listener 调用时它不起作用。
然后我添加了 Response.StatusCode = 500;到监听器功能。然后在 ipn 历史中它显示状态为 500; 我的应用程序发布在 godady 上。我不知道是否与许可或那里有任何关系。 请帮助我提前致谢。 赛亚姆S
最佳答案
我觉得问题可能出在您的托管环境上 请检查以下内容 http://helpnshareidea.blogspot.in/2013/11/mvc3-applications-in-windows-shared.html
关于c# - C# 中的 Paypal IPN 监听器问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19533042/