Bitcoin Forum
November 20, 2017, 02:44:36 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Best practice for accepting bitcoin payments?  (Read 897 times)
jl6
Newbie
*
Offline Offline

Activity: 4


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

Posts: 1511145876

View Profile Personal Message (Offline)

Ignore
1511145876
Reply with quote  #2

1511145876
Report to moderator
Join ICO Now Coinlancer is Disrupting the Freelance marketplace!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1511145876
Hero Member
*
Offline Offline

Posts: 1511145876

View Profile Personal Message (Offline)

Ignore
1511145876
Reply with quote  #2

1511145876
Report to moderator
bluecmd
Newbie
*
Offline Offline

Activity: 14


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: 574



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.

15UFyv6kfWgq83Pp3yhXPr8rknv9m6581W
Pages: [1]
  Print  
 
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!