Disable back button while payment transaction occurs

久未见 提交于 2019-12-10 20:22:37

问题


I have an XHTML page which is called after a successful credit card payment. But when the user hits the back button, he's charged again. How can I handle the issue, by either disabling the back button or invalidating his session when he hits back space or back button.

I am using Spring3/JSF but this problem has no relevance to this reference as this is a browser issue.


回答1:


Thats the wrong design. Don't try to manipulate the client from doing bad things - prevent the client from being able to do bad things.

Case in point, use a unique token for each transaction so that if the user clicks back and resubmits the transaction it will be rejected and the user can be notified that the transaction has already gone through.



来源:https://stackoverflow.com/questions/8756848/disable-back-button-while-payment-transaction-occurs

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