http://qs1969.pair.com?node_id=447084


in reply to Making credit processing atomic

Several things.

You can make your update/insert a transaction. Depending on your database, start the transaction, execute the statments, and commit ONLY if both succeed. Otherwise you have an error.

You can also set flags on the users end to prevent them from refreshing the page. One is to disable any buttons immediately after they are clicked and another is to set cookies to hold flags which are set when the transaction starts. These are only really useful if you REQUIRE the user to have JavaScript and/or Cookies enabled.

Any database error after transaction approval should be a system error and complete rollback. Unless, of course, you want to try again.

Are you also settling the credit card?
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."