0

我一直在尝试解决将 Sagepay 服务器集成到 ac#.net 站点的问题。起初我认为 Sagepay 模拟器没有发回 POST。

从那以后,我发现(在记录期间)模拟器正在将值发布回站点,但随后又丢失了它们。我认为这可能是 global.asax 中的一个问题。

我已经尝试注释掉 global.asax 中的所有内容,并且模拟器中的值仍然丢失。

我一直在使用log4net来跟踪阶段,这是来自模拟器的调用之一,以及我的 log4net 如何将其放入数据库:

Application_BeginRequest
Application_BeginRequest Request.UrlReferrer :
Application_BeginRequest Request.ServerVariables.Count : 49
Application_BeginRequest: Form count = 16
Application_AuthenticateRequest
Application_EndRequest
Application_PreSendRequestHeaders
Application_PreSendRequestContent
Application_End Appliction
Started
Application_BeginRequest
Application_BeginRequest Request.UrlReferrer :
Application_BeginRequest Request.ServerVariables.Count Begin
= 48 Application_Begin Request.Form
形式:
Application_AuthenticateRequest
Application_AuthorizeRequest
Application_ResolveRequestCache

这一切都在几秒钟内发生。在加载页面时,它丢失了帖子数据。

这是我们在 sagepay 模拟器上得到的回报:

Raw Reponse from your Notification URL
Your Notification URL returned the following information in the response part of the POST. It has been formatted to wrap every 100 characters to make it more readable.

    <form method="post" action="/(A(ubPhPgmAzQEkAAAANzA1MTdhOTctZTJiZi00NzU3LWEyZjItODcxMzI2NW<BR>I3ZjA20))/PaymentGateway/SagePayServerReturn2.aspx" id="ctl00"><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMzIwOTI4NzM3ZGR7QWh08mOnnMUf7wtZMkwEWKknSW6n2TMurN5RJnAIbw==" />

我们重新使用 .asp 来检查模拟器是否返回了 POST 并且它可以与 .asp 一起使用。我们真的很困惑为什么它不应该在 .aspx 中工作。任何帮助将不胜感激。

安德鲁

我已经设法从圣人页面更新并获得至少一个有效的响应。

Status=INVALID
StatusDetail=Unable to find the transaction in our database.
RedirectURL=/PaymentGateway/SagePayOrderFailed.aspx?reasonCode=001

但它仍然会丢失一些发布数据,因为它会触发 Application_BeginRequest 两次。(我不知道这是否有帮助)

找出 Application_BeginRequest 触发两次的原因。当 sage pay 将数据发送到页面时,它会被重定向到同一页面。

所以它在那里丢失了数据,但是我已经删除了我们所有的重定向规则,它仍在这样做。我们的解决方案中没有 Response.Redriect() 。所以我不知道下一步该去哪里寻找问题所在。

4

1 回答 1

1

我们发现了与 web 配置中的 anonymousIdentification 有关的问题。

在其中设置了 cookieless 值,这使得它成为 302 到剥离帖子值的同一页面。在我们检查服务器日志之前,没有看到它正在重新定向。

这是代码:
<anonymousIdentification enabled="true" cookieName=".ASPXANONYMOUS" cookieTimeout="100000" cookieless="UseDeviceProfile" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="None" />

因此,我们所做的只是去掉了无 cookie 的价值,而 Sagepay 现在实现了梦想。

于 2012-08-16T09:03:51.743 回答