PHP: What should I consider when integrating XML Payment in PHP (ie user abort, connection handling, session lock etc)?
I'm using PHP as the integrating language; I am swapping from a Redirect model with Worldpay to an XML integrated payment processing with RealEx. The XML requests with cUrl pose no real threat, but I am not yet sure how to design the process from the checkout-confirmation-page to the thank-you page.
At the checkout confirmation, I have all the values to request the payment, including the customer's card details etc. If the user/customer decides to send of the request, a few things could happen:

- the payment process is successful, but the result cannot be written to the database because the database connection cannot be established. How would you go about caching that; and what should be presented to the user? I was thinking about a "lock" variable in the session that is set right before the payment is being sent - and maybe even stored in the database; if then the payment result can't be written, the result gets cached for manual recovery later and the user cannot login before that happened. Are there any better ways?
- user abort (on closing the browser, using the back button etc) should probably be ignored; do I have to pay attention to anything in particular when using PHP's connection-handling features? Are there better ways to "control" the user's behaviour?
- how would I go best about a "processing-your-payment-please-wait" page? It appears that ideally the cUrl process should run completely seperate from the user-initiated PHP process to make it run independently, and to have a holding page with a refresh-header to point to another php page that tries to evaluate any result that cUrl might have brought back in the meantime. Unfortunately, I haven't got a clue how to go about that.

This may well be too broad a question to be answered - but I'm struggling to condense it or make it more specific because I'm still in the early design stages and struggle to find a workable concept. You could also help me out with an example of applications that need to be equally controlled regarding connection handling/race conditions etc where I might be able to "steal" a few ideas.

Thanks in advance,
Stefan
PHP: What should I consider when integrating XML Payment in PHP (ie user abort, connection handling, session lock etc)?
===

I'm using PHP as the integrating language; I am swapping from a Redirect model with Worldpay to an XML integrated payment processing with RealEx. The XML requests with cUrl pose no real threat, but I am not yet sure how to design the process from the checkout-confirmation-page to the thank-you page.
At the checkout confirmation, I have all the values to request the payment, including the customer's card details etc. If the user/customer decides to send of the request, a few things could happen:

- the payment process is successful, but the result cannot be written to the database because the database connection cannot be established. How would you go about caching that; and what should be presented to the user? I was thinking about a "lock" variable in the session that is set right before the payment is being sent - and maybe even stored in the database; if then the payment result can't be written, the result gets cached for manual recovery later and the user cannot login before that happened. Are there any better ways?
- user abort (on closing the browser, using the back button etc) should probably be ignored; do I have to pay attention to anything in particular when using PHP's connection-handling features? Are there better ways to "control" the user's behaviour?
- how would I go best about a "processing-your-payment-please-wait" page? It appears that ideally the cUrl process should run completely seperate from the user-initiated PHP process to make it run independently, and to have a holding page with a refresh-header to point to another php page that tries to evaluate any result that cUrl might have brought back in the meantime. Unfortunately, I haven't got a clue how to go about that.

This may well be too broad a question to be answered - but I'm struggling to condense it or make it more specific because I'm still in the early design stages and struggle to find a workable concept. You could also help me out with an example of applications that need to be equally controlled regarding connection handling/race conditions etc where I might be able to "steal" a few ideas.

Thanks in advance,
Stefan