authorize.net 响应 url 返回您的脚本在我们尝试 post 交易结果时超时

authorize.net response url returning Your script timed out while we were trying to post transaction results to it

我正在尝试将 authorize.net 的 DPM api 集成到我的项目中。我 运行 遇到的问题是响应 url。我知道网上已经有很多关于此的内容,但对我来说都是胡言乱语。错误信息是:

An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card. 

      This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.

我在这个沙盒帐户的电子邮件中收到以下错误消息:

Your script timed out while we were trying to post transaction results to it.

在我的沙盒帐户中我有

http://myIp:8080/myProject/shoppingCart/authorizePayment      Default Receipt URL   Edit
http://myIp:8080/myProject/shoppingCart/paymentAuthorizing    Default Relay Response URL    Edit

我已经验证我可以通过使用该 IP 浏览我的网站来从外部世界访问 myIp。

在我发送给他们的表格上:

<input name="x_relay_url" value="http://myIp:8080/myProject/shoppingCart/paymentAuthorizing">

在我的 shippingCart 控制器中

def paymentAuthorizing(){
    [params: params]
}

我的 paymentAuthorizing 操作 gsp 页面:

<meta name="layout" content="main">
<div>
    Payment Authorizing.  Please Wait
    <g:javascript>
        window.location.href = '<g:createLink action="authorizePayment" params="${params}"></g:createLink>';
    </g:javascript>
</div>  

这是在

发布的第一期

http://community.developer.authorize.net/t5/The-Authorize-Net-Developer-Blog/5-Most-Common-Errors/ba-p/35655

但似乎不相关

我已经确认我可以通过 chrome 休息客户端

访问我的服务器

rhldr在他的评论中解释了错误的原因。

您遇到的错误和一些疑难解答在 here 文档中进行了描述 Authorize.net。这是相关部分:

If the merchant’s Web server is not available on the public Internet, has authentication enabled, or if the Relay URL uses a non-standard port for HTTP or HTTPS traffic, Relay Response timeouts will occur. Authorize.Net will not have any means to connect to your server or authenticate itself on your server, and can only use ports 80 and 443 for all Web traffic.

我建议尝试使用端口 80 或 443,看看是否可行。

Authorize.Net DPM 提供的错误可能非常具有误导性。根据我的经验,我发现超时通常不是超时,而只是无效响应。 我的以下所有 都导致了您描述的错误消息:

  • 中继目标上的自签名证书。在我们的开发环境中,我强制中继 URL 为非 SSL 以解决此问题。
  • 非 HTTP 200 响应,因此处理中继响应的代码中的任何错误都可能导致此问题,这可能很难调试,因为网关没有 return 该错误的任何详细信息。
  • 未在网关注册的中继 URL。网关需要提前知道您将要使用的所有 URL,这也意味着您不能在 URL.
  • 上使用任意 GET 参数