[Javascript] Two Actions with one form
Paul Novitski
paul at novitskisoftware.com
Sun Mar 26 21:15:59 CST 2006
At 06:36 PM 3/26/2006, Matt Warden wrote:
>Paul Novitski wrote:
> > At 02:05 PM 3/26/2006, Matt Warden wrote:
> >
> >> Often you can make a return page from payment sites like paypal. These
> >> will either post back all the content, or return it to you in the
> >> query string. You might be able to do this with paypal. I would check
> >> that first.
> >
> >
> > You can do this, however if something goes wrong before the return page
> > renders -- either the user cancels the transaction or PayPal fails or
> > the return page redirect fails for any reason -- then the original
> > client's system will not know that a transaction attempt has occurred.
> >
> > Better, I think, to record the submit attempt and the paypal return
> > event to get the complete picture, so you can scoop up those customers
> > who fall through the cracks.
>
>This is exactly what I was suggesting. Paypal would return the user to a
>page on the client's site, hopfully with all the post data as payload on
>the request, where you may do what you wish with the data. Verisign's
>payflow product does, and paypal probably does as well.
Yes, PayPal does allow you to specify a return page. I wouldn't
guarantee that return succeeding, however, if I wanted to secure my customers.
> >> Your other option is to submit to the form contents to your CGI with
> >> something like XMLHTTP/AJAX, and then allow the form to post to
> >> paypal.
> >
> >
> > I had suggested using an Image object simply because I thought it would
> > be more backward- and cross-browser compatible than XmlHttpRequest.
> > Since in this case the goal of calling the CGI script is to send data
> > and not to receive it, I question the use a technology created to
> > receive data that only the latest browsers support.
>
>Actually, I question your assertion that XMLHTTP/XmlHttpRequest was
>created to receive data. It is for two-way communication, just as normal
>http requests are.
Sorry if I wasn't clear. A technology created to send and receive
data is in fact intended to receive data, and that was the portion of
the truth I was pointing to.
>Additionally, the Image.src hack will work only if limiting oneself to
>passing get request data is acceptable. And if this is the case, then
>there's no problem in the first place, as a simple http redirect will do
>the trick.
That's correct. On the other hand, if the client has images turned
off, my suggestion will fail.
Warm regards,
Paul
More information about the Javascript
mailing list