Avoid credit recharge when clicking "back"

Well, you most definitely want to not rely on JavaScript for this.

It’s one thing giving a “need your ____” type of message to help the user, but never use it alone for security or anything else critical in nature.

I think for this, a SESSION would work. i.e. once the “cart” has been submitted, destroy the SESSION

eg. various “product” pages check for / set SESSION
→ “cart review” submit page, check for SESSION but do not set it if it doesn’t already exist
→ “thank you” page, destroy SESSION