mods - pretty sure this is the right spot, feel free to bump somewhere else if it's not of course.

I'm currently in the process of making my own user management, billing, helpdesk, etc system. Without going into the why (don't want to break advertising rules), it's just something I'm going to need to do all I want to.

Anyhow, the coding of it isn't really what's giving me problems, more the process. I was just curious if any of you who have made your own system could give some input, or even if you haven't, if you want to say generically how you think the process should go that's fine too.

The basics are the user puts in the account details they want, and fills in their personal info (name, address, etc). After that they're presented with an order confirmation page, and then they're shipped off to a third party processor.

Here's my problem, when do I create the user account on my system? I don't mean the CPanel/WHM account, but the one in my user system. The reason I ask is, right now I'm dumping them into the system with several flags to show them as unpaid. Then when they get sent back from the processor if it was successful it marks them as paid. But I'm worried about "stray" accounts. For instance let's say they get to the third party system and decide to close the browser window, or whatever. But they never end up back at my page, so their account just sits there in limbo until I decide to delete it.

Some possible solutions I've come up with are:
1 - Don't worry about it. When I see these accounts hanging in limbo for more then a day or so, just delete them and the associated invoice.
2 - Don't create their account until right before sending them to the processor. Currently their account is created before showing the confirmation page. Then if they hit cancel it deletes the account so they can recreate their plans. This sort of deals with the problem, but not totally.
3 - Have the account be created in a temporary set of tables, when they come back from the third party processor, they are then moved over with the real customer accounts. And then purge that table of orders that are say ... over 24 hours old daily.

Also not sure how to deal with users hitting that pesky back button. I guess I could use session variables or something to keep it all straight.

Anyhow, just looking for input. I've already scripted this up as option 2, but I'm now thinking I need to scrap that and go for something closer to option 3. Ideas? suggestions? how do you do it?