Bitcoin Forum
May 24, 2024, 02:59:55 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Best practice for accepting bitcoin payments?  (Read 1039 times)
jl6 (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


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

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?

Thanks,
James
bluecmd
Newbie
*
Offline Offline

Activity: 14
Merit: 0


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

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.
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



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

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.

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!