Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shopping Cart Processing

Status
Not open for further replies.

melban

IS-IT--Management
Oct 23, 2002
28
0
0
US
I'm sending Credit Card info to a program that dials up a bank to verify the number and to charge the account but if the window is exited early the account is charge but the order is not sent via e-mail. Is there a way that I can keep the perl program running unil it reaches a default timeout or til the program returns the needed info? If I can make sure it runs until the e-mail is sent it would be great. Any help would be great.

Thanks
Shelby
 
I'll tell you how I approached this problem...

I wrote a separate script to handle all aspects of credit card checking and order delivery, and then I simply had the CGI script run that program and react to the information sent back to it from that program (e.g. "bad credit card order not processed", "bad email address, order not processed", "everything looks great your total is $XX.XX").

That way, if the person closes the browser after clicking "place order" the order is still placed and all parts of the job done. (We also email a receipt.)

I hope that this helps!
-- Scott David Gray
reply-to: sgray@sudval.org
 
That would be what I'm needing to do but how would I go about doing it? If I could keep the process running even if the browser was exited it would be great. I'm not quite sure how this was all set up on account that my predacessor kept no notes. Thanks for the help.

Shelby
 
Write a (non-cgi) script that handles all of the processing you need, using data submitted to it at the command line. Place it outside of your cgi-bin directory. But make sure that your cgi program will have the appropriate permissions to run the script.

Have your CGI script call that script, with all appropriate data sent. You can have your CGI script read and react to the output of your regular program.

The trick is basically to make sure that the process that does the real work is set into process and uninterruptible -- a CGI script can be interrupted by the person at her/his browser (clicking "stop" while data is still being sent is sort of like ctrl-c at the command line), so you need the CGI script itself to launch a command-line script external to the cgi script.
-- Scott David Gray
reply-to: sgray@sudval.org
 
I've tried using

sytem(test2.pl);


as a comment to run the test2.pl script but it does not seem to run corrctly. It this the appropriate command to run a seperate script? Either way will someone people comment to push me in the right direction.

thanks
shelby
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top