Bitcoin Forum
June 23, 2018, 08:34:04 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: Best practice for accepting bitcoin payments?  (Read 901 times)
Offline Offline

Activity: 4
Merit: 0

View Profile
June 05, 2011, 01:47:20 PM

Hi all.

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?

The World's Betting Exchange

Bet with play money. Win real Bitcoin. 5BTC Prize Fund for World Cup 2018.

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Offline Offline

Activity: 14
Merit: 0

View Profile
June 05, 2011, 05:58:09 PM

There is some sort of monitor-patch in the merge request queue, that will probably help.

Otherwise it is not resource intensive to wait. Have a cronjob go through all pending transactions once every 10 minutes and finalize the order then.
Hero Member
Offline Offline

Activity: 588
Merit: 500

View Profile
June 05, 2011, 08:19:26 PM

Right, the monitortx patch will send a POST back to your website when a transaction comes in. You can then inform the user that payment was received and their order will be processed. After the transaction has a few confirmations (e.g. 6), you send it to the warehouse for fulfillment.

Remember that the Bitcoin payment address should be associated with the order/invoice, not merely the customer.

Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!