Public API to verify transactions to a unique address as they occur? I'm creating a WordPress plugin for bitcoin donations. I want it to behave similar to the checkout process for many bitcoin shopping carts, where the QR code is displayed then once the user scans and sends bitcoin to the address, it swaps out with a "thank you" message.

I was thinking of using messages attached to the donation, or a specific amount for each donation, but it's getting complicated. How can I have a single receiving address for each donation, yet have the system know when the user Joe has donated vs when Bob donated, so they both get thank you message at the appropriate time. 

Is this possible, or do I need to generate a middleman address for every transaction, and just check the balance on that one?

I only want to go this route so I'm not responsible for a screw up if someone donates, the site glitches, and the private key to the middleman address is lost before the funds can be forwarded on to the final receiving address.
Yes you can.


If you're using a third party service to store your coins, they usually allow you to add a callback address when generating a new address, where they trigger a POST request to your server with a JSON object containing transaction details. Here are some examples:


Coinbase's API: https://developers.coinbase.com/api#callbacks
Blockchain.info's API: https://blockchain.info/api/api_receive

If you're rolling your own addresses, you can use some block explorers to notify you of new transactions to existing addresses. One I know of is Chain.com's notification system. I haven't used this, but Chain is quite a developer friendly service.


Personally, I've only used Coinbase's API, and It worked quite well for me. I trust Coinbase to take care of my coins better than myself, but if you're more paranoid and better at security than I am, use Chain.

IMHO I don't recommend Blockchain.info for anything. Their service really isn't that polished from all I've seen, and I just get a bad vibe from them. Coinbase has very nice support and a developer community where you can talk about all the problems you face.