I am investigating accepting bitcoins as payment on my website (which is nothing fancy), and it seems to me that the process looks something like this:
1. Run bitcoind.
2. Customer indicates that they wish to buy something.
3. Use getnewaddress API call to create a new address to which bitcoins can be sent.
4. Give this address to the customer, and tell them how much to pay.
5. Wait for a period of time, then use the getreceivedbyaddress API call to check whether the funds have been received to an appropriate level of confidence (say, 6 confirmations).
6. If the appropriate funds have been received, start your fulfilment process. If not, go back to step 5.
It's step 5 that bothers me; it requires a polling process to repeatedly perform the check, presumably with a timeout after which the order is cancelled. This seems inelegant and potentially resource intensive. Is there a better way?