I would like to get some feedback. I am new to the bitcoin development and I don't want to misunderstand something important before I start designing the application. I am working on bitcoin online-store integration. We are planning to show btc payment instructions to customers after order acknowledgment page so that they can send the payment from their private wallets.
We want to create one address per transaction. (take Transaction No = "abc"). My plan:
- First call getaddressesbyaccount("abc"). If it returns blank address list, then call getnewaddress("abc") to create new address for this order. (Then create QR code and show to customer with expected amount).
- Otherwise, if the getaddressesbyaccount("abc") returns an address, use that returning address.
This page says "getaccountaddress will return the same address until coins are received on that address; once coins have been received, it will generate and return a new address.".
I am planning not to use this function because if we expect 1 btc from the customer and he sends 0.5 btc, I don't want to create a new address. This is just to keep things simplified (1 address per 1 account). getaddressesbyaccount function returns a list of addressess associated with the account "abc". I find getaccountaddress redundant for my needs. Is there any benefit to "getaccountaddress" creating new address if the current address has balance on it? Do you see any pitfall with my logic. Your feedback is appreciated.