Abhi
Abhi

Reputation: 6578

Disable back button while payment transaction occurs

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.

Upvotes: 3

Views: 2954

Answers (1)

synthesizerpatel
synthesizerpatel

Reputation: 28036

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.

Upvotes: 6

Related Questions