How do I track incoming payments by txid if they haven't made a payment yet?
I'm assuming you'll have some sort of invoice id so you can attach a payment address to that invoice record to start. Then once a payment comes in and has enough confirmations you can create a record in a payments_received table and that should use address-txid as the primary key.
How do I generate a new address? I don't think I need to worry about large quantities at this point, since I don't expect very many transactions in the beginning.
just call the json-rpc command 'getnewaddress'. From the command line it'd just be "bitcoind getnewaddress".
I'm assuming listtransactions can take an address as an argument?
listtransactions doesn't actually take addresses as an argument. What you can do though is tell it to show the last 500 transactions and if volume is low as you assume, then you'll never miss one. I've used this method on several sites and it works.
for example: bitcoind listtransactions "*" 500
If I get something basic working, I will definitely release as an NPM module.
Good to know. Good luck!