Bitcoin Forum
May 27, 2024, 10:11:47 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Programming Newbie Looking For Some Answers  (Read 943 times)
DPony13 (OP)
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
December 26, 2012, 12:53:24 PM
 #1

Hey guys, I'm new to programming/scripting
and I'd like to ask,

How do other websites/services do this

Customer on website:
0.00 balance

Website > Generates/Shows Customer a bitcoin address
Customer > Deposits 1.00 to bitcoin address
Website > receives bitcoins and automatically changes customer's stats:

Customer on website:
1.00 balance


Is it possible to have an example and an explanation to it too?
thanks.

EndTheFed123, if you had just taken the money it wouldn't have ended like this Sad
BTW this hasn't been the real DPony13 since he "came back", I just hacked this account, SirLolicon is the real DPony13 I think.
Xenland
Legendary
*
Offline Offline

Activity: 980
Merit: 1003


I'm not just any shaman, I'm a Sha256man


View Profile
December 26, 2012, 01:20:23 PM
 #2

The balances are normally attributed to a user_id that the user can login with and check their balance. When a user would like to deposit an address the website code would query the Bitcoin client through JSON command that will generate an address. The newly generated address will be attributed to the user_id as a deposit address. The user then sends the Bitcoins to the address, and the website will ping the Bitcoin client every so often to see if any new bitcoins have been received, If there are new bitcoins the information can be extract to that particular transaction information like "+1 Bitcoin deposited" type of information. You take that information and increase the users current balance value.

I'm working on a Bitcoin Development Kit library for PHP that facilitates all these kind of convinces, checking new balances is a planned feature but I'm going to make it official and post it on the github "issues" page. (https://github.com/Xenland/Bitcoin-Development-Kit/issues/5)


Update: This feature of updating balances has been added to the to-do list instead
(https://github.com/Xenland/Bitcoin-Development-Kit/wiki/%28%29-To-Do-Features-%28Notes-to-contributing-developers%29)
davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1007


1davout


View Profile WWW
December 26, 2012, 01:29:12 PM
 #3

the website will ping the Bitcoin client every so often
Use the monitortx patch instead, much better.

Xenland
Legendary
*
Offline Offline

Activity: 980
Merit: 1003


I'm not just any shaman, I'm a Sha256man


View Profile
December 26, 2012, 02:00:27 PM
 #4

the website will ping the Bitcoin client every so often
Use the monitortx patch instead, much better.

Thanks Davout!
davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1007


1davout


View Profile WWW
December 26, 2012, 02:07:49 PM
 #5

Thanks Davout!
No worries!
With this solution you can mix some websocket magic to instantly push all balance updates to the browser.
That's what Instawallet uses.

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!