需要得到CardNonce并且不能得到回调?

问题描述:

我想以此为榜样提交信用卡信息,并取回一个CardNonce。

I'm trying to follow this example to submit credit card information and get back a CardNonce.

https://docs.connect.sq​​uareup.com/articles/adding - 付款形式/

形式的作品。我可以在所有的信息输入。我preSS的按钮和功能requestCardNonce()获取调用,因为我插入了一个调试语句,弹出一个消息框window.alert(IN requestCardNonce);它显示了后,我按一下按钮。

The form works. I can enter in all the information. I press the button and the function requestCardNonce() IS getting called because I inserted a debug statement to bring up a message box window.alert("IN requestCardNonce"); and it shows up after I click the button.

不过,我似乎无法得到cardNonceResponseReceived我点击按钮后上班。我把windows.alert消息框的功能,它永远不会触发。浏览器在处理像它连接到服务器,并在文本框中复位,但我似乎无法得到cardNonceResponseReceived()回调火。

HOWEVER, I cannot seem to get cardNonceResponseReceived to work after I click the button. I put in windows.alert message boxes in that function and it never fires. The browser processes like it's connecting to the server and the text boxes reset but I can't seem to get the cardNonceResponseReceived() callback to fire.

什么可能我会丢失?我和消息框提示外复制的例子几乎一字不差。我插入我的applicationID从广场,即使我没有,我仍然期望回调火,但填充错误。

What might I be missing? I copied the example almost verbatim with the exception of message box alerts. I inserted my applicationId from Square, and even if I didn't, I would still expect the callback to fire but populate errors.

看起来像这个问题是我把平时生成的表单ASP.NET在我的页面元素以下code以及导致的问题。

Looks like the problem was I was putting the following code usually generated form ASP.NET around my page elements and that was causing the issue.

<form id="form1" runat="server">
</form>

我删除后,它开始工作。

After I removed that, it started working.