Thanks, Mark,
Just after I sent the request about meta refresh, I had already realised
that I had been stupid and had found the definition on the web. The reason
why I had been avoiding CGI is that I have been using mod_perl and Apache 2
APR routines to avoid the rather larger CGI library. As a result of this,
way down the line I kept discovering that may CGI routines were incompatible
with mod_perl/Apache 2 APR libraries (too many differences) and I didn't
want to go back to using CGI.
Jim
On 07/02/07, Mark Torrance <[EMAIL PROTECTED]> wrote:
If you put <meta http-equiv="refresh" content="10"> into the <HEAD>
section of your HTML, it will cause the customer's browser to automatically
re-fetch the same page after a 10 second delay. The way you might use this
would be to write one Mason page that monitors the progress of the
transaction with the merchant, for example by looking for a file on the
disk. When the file is absent, the Mason page would display some "still
waiting..." kind of content, and include the META REFRESH. When the file
shows up, it indicates the transaction finished and it contains the results
of the transaction -- the Mason page could then just display (or redirect to
another page that would display) the information about whether the
transaction failed or succeeded.
The specific example Oliver suggested below would be for you to display a
page that says "Please wait...", and in that page include <meta
http-equiv="refresh" content="2;url=
http://yoursite.com/post_transaction.html"> or something like that. This
way, even if post_transaction.html takes many seconds to complete, the user
will be looking at the contents of the Please wait... page while they wait.
This is also easier than what I suggested above, because you can still have
the main Mason code in post_transaction.html connect to the remote merchant
and complete the transaction; you don't need to store the results in the
filesystem or a database as an intermediate step.
Now, in the spirit of "teach a man to fish", I would suggest that you
could have typed "meta refresh" into Google. The first result is a page
from About.com that does a pretty good job of explaining what this is.
More to the point, if you can figure out what other people call the thing
you're trying to do, you can probably learn what you need from the web by
just searching for it. In this particular case, I would consider what you
are looking for to be a "shopping cart design pattern" (the Sun Java page
about Session Facade is interesting), or "cgi wait for background process".
Some experience is also helpful in knowing what to query and how to
interpret the results; that will only come with time. Mason has a much
smaller user community than CGI (the oldest name for technology to process
forms on the server-side), so replacing Mason with CGI in your search string
may give you more results, though they may be in languages other than Perl.
It doesn't matter that much; in general, you can learn web programming
techniques from one language and apply them to another language.
I hope this is helpful.
--Mark Torrance
On Feb 7, 2007, at 9:48 AM, Jim Rey wrote:
Oli
That sound easier, but, sorry to be a pain, nearly all my web writing
experience has been from home, in a vaccuum. I started this website
because, although I have been a Software Engineer for about 30 years, I
suddenly found that I was unemployable when I turned 60. The problem with
this is that you are less likely to come across new techniques except by
chance, like now. So, please, what is a meta refresh?
Jim
On 07/02/07, Oliver Jeeves <[EMAIL PROTECTED]> wrote:
>
> John Cappiello wrote:
> > On Wed, Feb 07, 2007 at 05:00:17PM +0000, Jim Rey wrote:
> >> 1. Display a page that requests card details from the holder (this
> is
> >> easy).
> >> 2. Pass (POST) the data to a non-display page on the merchant's
> >> website. (How, LWP?)
> >> 3. Receive the response code(s). (How, LWP?)
> >> 4. Notify the customer of the status of the transaction. (this is
> >> easy, but how do I wait for 2 and 3?)
> >
> > You can initiate a background process and then have part 4 reload
> every few
> > seconds until the background process has indicated completion and
> return the
> > status to the client.
> >
> > Further improved with a bit of ajax to make it appear more fluid to
> the user.
> >
> > John
> >
>
> I don't think this method is the best.
>
> You should be able to make a POST request to the merchant, and recieve
> the response synchronously. That is, your perl script won't progress
> beyond that point until you either have your response, or there has been
> some error like a timeout.
>
> The script that handles the data posted from your form /can/ do this,
> but the problem is that the form page will remain on the clients screen
> until everything is finished processing, meaning that if the merchant
> site takes a while to respond, bored users might decided clicking twice,
> three times etc. on the submit button would be a good idea. Much
> badness.
>
> A better solution, is to post to a script that displays a 'please wait'
> message, and uses a meta refresh to re-direct to a page that actually
> POSTs to the merchant site, meaning that while the users wait for your
> script to get a reply from the merchant, they are looking at the 'please
> wait' page.
>
> The difficulty with this, is passing the credit card details from one
> script to another, and will require storing them somewhere temporarily.
> The benefit is that it doesn't require javascript, or the page to
> constantly reload.
>
> -Oli
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services,
> security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
>
>
--
Jim Rey
48 Laburnum Park
Bradshaw
Bolton BL2 3BU
United Kingdom
Tel: 01204 593 222
Mob: 07816 751 874
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users
-----------------------------------------------------------------------------------------------
Mark Torrance, CEO, Vinq, LLC www.vinq.com [EMAIL PROTECTED]
408 236-7701 (w) 408 420-9239 (cell) 408 516-9479 (fax)
560 S. Winchester Blvd., Suite 500, San Jose, CA 95128
--
Jim Rey
48 Laburnum Park
Bradshaw
Bolton BL2 3BU
United Kingdom
Tel: 01204 593 222
Mob: 07816 751 874
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users