Hi All,
 
I am building an e-commerce module. The flow of the application is as
follows:
 
PaymentForm --> ProcessPayment --> Receipt=Success //End
 
Or
 
PaymentForm --> ProcessPayment --> Receipt=Error --> PaymentForm
                                                            
 
The PaymentForm is loaded with a transaction control token to avoid a
double click of the submit button. The PaymentForm also implements a
JavaScript strategy that involves a submit flag, once submitted all
subsequent submit events are ignored and display a "Pleas Wait" popup
window. So should my user have JavaScript enabled my process payment
Action should never encounter an invalid token.
 
My problem lies when the client does not have JavaScript enabled and my
Action encounters an invalid token. At this point the user must be
presented with a receipt either stating success or failure with the
financial transaction. I would like to ignore the fact that the double
submit happened and just display the proper receipt. Should I forward
the user to a "transaction already processed page" they will loose their
proper receipt and never visually receive the receipt as I also send it
by e-mail.
 
I can see a couple solutions and would like some input on my ideas or
new strategies others have used. 
 
1)      Set the form target to be _blank  so a new window will appear
for every submit. This works fine in that the client will receive an new
window for each submit, one stating the proper receipt, one stating the
transaction has already been processed. The only thing I dislike with
this strategy is that on receipt error the client clicks back to correct
the error and we have this rogue window in the background somewhere.
 
2)      Have the process payment Action populate the session with a bean
containing the receipt info. If the process payment Action encounters an
invalid Token just wait until the previous submit thread populates the
session with the receipt bean and then forward to the receipt page. I
like this strategy but am not sure if it is proper to have one thread
dependant on another thread to populate the session with the bean and if
there might be other complications that might arise from this strategy.
 
Many thanks for your time,
 
Greg
 


Reply via email to