为什么当我的中继响应 URL 指向 CodeIgniter 控制器时 Authorize.net 抛出错误而不是其他情况? [英] Why is Authorize.net throwing an error when my relay response URL points to a CodeIgniter controller and not otherwise?

查看:12
本文介绍了为什么当我的中继响应 URL 指向 CodeIgniter 控制器时 Authorize.net 抛出错误而不是其他情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常不是 Web 开发人员,但我是一个足够体面的编码员,我很乐意接受朋友的建议,开发他兄弟的小型企业网站.我快完成了,我一直在使用 CodeIgniter,它提供了巨大的帮助,而且很容易上手.

I'm not typically a web developer, but I'm a decent enough coder that I felt comfortable accepting a proposal from a friend to develop his brother's small business website. I'm nearly finished and I've been using CodeIgniter, which has been a huge help and was easy to jump into.

他们有一些想要通过网站购买的产品,他们的偏好是 Auth.net(我以前没有使用过),而且他们的主机不支持 SSL(nearlyfreespeech.net),所以我认为 Auth.net 的 SIM 卡是合适的.如果我在 CI 应用程序之外使用中继响应页面测试 SIM 卡,该页面只是吐出可用的事务详细信息,一切都会按预期进行.如果我尝试将中继响应页面设置为只回显字符串的 CI 控制器/方法,Auth.net 将显示以下错误":

They have a handful of products they'd like available for purchase via the site, their preference was Auth.net (which I have no previous experience with), and their host does not support SSL (nearlyfreespeech.net), so I decided that Auth.net's SIM was appropriate. If I test SIM outside of the CI application with a relay response page which simply spits out the available transaction details, everything goes as expected. If I try it with the relay response page set to a CI controller/method which simply echoes a string, Auth.net displays the following 'error':

尝试执行时出错将此交易报告给商人.一封电子邮件已经发送至商家通知他们错误.以下是结果试图收取您的信用卡.

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.

此交易已获批准.

建议您联系商户确认您将接收产品或服务.

It is advisable for you to contact the merchant to verify that you will receive the product or service.

我最初的想法是,也许我为规避必须包含 index.php 前端控制器而设置的重写规则是问题所在,因此我尝试将其包含在中继响应 URL 中而不做任何更改.我还应该注意到,有问题的控制器实现了一个 _remap() 方法,但中继响应方法不应受到它的影响,因为它与它的正则表达式不匹配.

My initial thought was that perhaps the rewrite rule I set up to circumvent having to include the index.php front controller was the issue, so I tried including it in the relay response URL with no change. I should also note that the controller in question implements a _remap() method, but the relay response method shouldn't be affected by it as it doesn't match it's regex.

任何见解将不胜感激.

推荐答案

当您的脚本在指定的时间内没有响应时,就会发生此错误.如果返回 200 成功消息以外的任何内容,它也会显示.所以基本上你的中继响应 URL 中存在错误.

This error occurs when your script doesn't respond within a specified amount of time. It also is displayed if anything other then a 200 success message is returned. So basically there is an error in your relay response URL.

您需要首先通过直接拉起页面来测试它是否有效并返回正确的标头响应.然后你可以通过向它发送一个模拟的 POST 响应来测试它,看看它是否也正确响应.如果这些工作确保脚本不会花费太长时间来响应.如果是的话,可能有办法优化慢页面以给出适当数量的响应.

You need to test this first by pulling up the page directly to see if it works and returns the proper header response. Then you can test it by sending a simulated POST response to it and see if it also responds properly. If those work make sure the script isn't taking too long to respond. If it is there probably are ways to optimize the slow page to give the response in the appropriate amount.

这篇关于为什么当我的中继响应 URL 指向 CodeIgniter 控制器时 Authorize.net 抛出错误而不是其他情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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