Need to get CardNonce and CANNOT get Callback?

女生的网名这么多〃 提交于 2020-01-07 08:22:06

问题


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

https://docs.connect.squareup.com/articles/adding-payment-form/

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.

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.

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.


回答1:


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.



来源:https://stackoverflow.com/questions/37054021/need-to-get-cardnonce-and-cannot-get-callback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!