简体   繁体   English

magento 1.3.1未结帐警告错误,仅适用于信用卡,不适用于贝宝

[英]magento 1.3.1 undefined alert error in checkout only for credit card but not for paypal

i am using magento 1.3.1. 我正在使用magento 1.3.1。 While making payment with credit card I am getting a javascript alert called "undefined".I am using ANZ as payment gateway.The money is getting deducted.but not getting reflected in admin panel also.Interestingly when i am using paypal for payment it is working perfectly. 使用信用卡付款时,我收到了一个名为“ undefined”的JavaScript警报。我正在使用ANZ作为付款网关。这笔钱被扣除了。但也没有反映在管理面板中。有趣的是,当我使用贝宝付款时,这是工作完美。

Please can you tell me how i can solve this problem? 请您告诉我如何解决这个问题?

The error is caused by an AJAX response not returning valid JSON. 该错误是由AJAX响应未返回有效JSON引起的。 Get something like Firebug or Chrome like Alan suggested and watch the network view to see AJAX request being made as you step through checkout. 获取类似Alan建议的Firebug或Chrome之类的内容,并观看网络视图,以查看在结帐时逐步提出的AJAX请求。 On saveOrder (the last step, where you get the error) check it's content, instead of JSON I bet you will see a PHP error and stack trace. saveOrder (最后一步,出现错误)上检查它的内容,而不是JSON(我敢打赌),您会看到一个PHP错误和堆栈跟踪。 This is a clue to where the problem is but if you cannot understand add it to your question. 这是问题出在哪里的线索,但是如果您不明白,请将其添加到问题中。

Logically the error must be happening after ANZ charges the credit card but before Magento commits the transaction to it's database, because an error occurs the transaction is rolled back. 从逻辑上讲,该错误必须在ANZ向信用卡收费之后但在Magento将交易提交到其数据库之前发生,因为发生了错误,交易被回滚了。

To fix this problem you should think about contacting the author of ANZ eGate (Fontis) and ask for help in debugging. 要解决此问题,您应该考虑与ANZ eGate (Fontis)的作者联系,并寻求调试帮助。

That's a javascript alert, right? 那是JavaScript警报,对不对? If so ... 如果是这样的话 ...

Inject some JavaScript into you page rendering that overrides the alert function (not a Magento override, a javascript override. 向您的页面呈现中注入一些覆盖警报功能的JavaScript(而不是Magento覆盖,JavaScript覆盖)。

var originalAlert = alert;
alert = function(a)
{
    originalAlert("Woah, science!");
    originalAlert(a);
}

Add a 添加一个

debugger;

statement to your new alert function. 对新警报功能的声明。

var originalAlert = alert;
alert = function(a)
{
    debugger;
    originalAlert(a);
}

Perform the action that triggers the alert with a browser that has a debugger attached (Firebug, Chrome) 使用已连接调试器的浏览器(Firebug,Chrome)执行触发警报的操作

When the debugger triggers, you'll see the alert in context. 当调试器触发时,您将在上下文中看到警报。 Step out of the alert and try to figure out why there's an undefined variable in the alert. 退出警报并尝试找出警报中为什么存在未定义变量的原因。 That will point to your problem. 那将指出您的问题。

(searching the codebase for JavaScript alerts would be worth a try, but the above is the best way to ensure you find the right one.) (在代码库中搜索JavaScript警报是值得尝试的方法,但是以上是确保找到正确警报的最佳方法。)

If you don't know how to do anything in this post, you have new questions to ask here. 如果您不知道如何在本文中做任何事情,请在这里提出新的问题。

If you're not willing to do the above, this isn't the community you're looking for. 如果您不愿意执行上述操作,那么这不是您想要的社区。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM