Continued from page 1
I admit that I discovered this by trial and error - and a lucky guess or two. Your merchant account gateway software may have radically different behavior than mine, but here's what I've learned:
The gateway uses
POST method to send
customer to your specified return URL (which can be a script as well as a web page). It also POSTs most of its input data items at
same time. They are usually ignored, but your script can read them if you want to!
Use
names given to
form inputs. Have your script extract
values of these "named parameters" at
time it creates
download page. Record what you want to save about
transaction in your orders file or database.
Now here's
real secret to foiling
thieves. Inside
script, check to see that
variables you extract contain non-empty values. Did you get that? Here's an example:
if ($email eq "") {exit;}
In this example,
script expects to get an email address. If it contains no characters,
script quits instantly. By testing for
presence of some data in such fields as customer name, email address, item #, price, etc., you can tell whether
script was called after a successful transaction - or by a thief...
Put all your security checks prior to
code that creates
download page. If any test fails,
script exits and
thief is left empty- handed. If your form-handling script can convert a product name to a product ID that's never visible to a browser, this provides even more security. This will be POSTed back to
script and you can check for it before allowing
download.
Close these security holes and you'll make more money. You may even sleep a little better knowing that people can't steal that product you worked so hard to create. I know I do!
