user12594: If I want to have a website that can credit bitcoins to a user's account when they deposit bitcoins, how can I have the website automatically detect when the bitcoins have been received into to the wallet address given to that customer (belonging to me), and consequently update the website to reflect their new balance automatically - without having to manually check my wallet.
I'm not interested in using existing payment services for this, but rather I'm interested in the coding principles required.

user8717: You'd have to get your hands wet with JSON-RPC and the bitcoind API. This way you can programmatically, and automatically run specific wallet functionality like sending coins to some address once a specific condition is met.
More specifically I suggest you look at the raw HTTP calls being sent to the bitcoind server. 

user12889: http://blockchain.info/de/api/api_receive
First you get a new bitcoin-adress from blockchain and on the same way you send them a callback url
The new bitcoin-adress you can send your custormer to pay
blockchain.info calls your callback procedure every time something changed in the payment-process. First time, when the customer send your bitcoins. In the Parameters you can find the amount of Bitcoins (in Satoshi = 1/100.000.000 BTC) and the number of confimations.
The Number of confirmations counting up every call from blockchain.ino to your callback procedure. The calls  don't stop until you return ok...!
When you think you have enough confirmations you can mark your Payment as done and return ok The bitcoins booked on the bitcoin-address ($my_address) you send to blockchain.info in the first call.
This are only a few statements as you see in my link at hte beginning of my text.
blockchain.info calls your callbackprocedure with its own parameters and returns the parameter you send to blockchain.info. For this you can (not must) send your secret key. So you can detect spam-calls to your callback-funktion from other persons.
Regards heinz
www.btcloc.com

user12896: Might be wise to wait until 3 or 4 new blocks have been created (after payment detected) before assuming the transaction to be trustworthy.

user11121: If you're going to be running bitcoind, what you're looking for is the walletnotify configuration setting in bitcoin.conf.
If you enable walletnotify, you run an app like curl to post the data to a web page.  The data that you'll receive is the transaction id of an incoming transaction for an address in your wallet.  From that you can use bitcoind's json-rpc commands to get the address that received the transaction as well as other transaction details like the amount.
Walletnotify will execute twice.  It will execute the first time that a transaction appears, and then will get called again when a block is published that includes the transaction. You can use either or both of these notifications depending on your needs.
This is the curl command that I use in walletnofify.  You should make any changes for your own environment.
curl -X POST -H "Content-Type:application/json" -d '{"transactionId":"%s"}' http://127.0.0.1:81/api/v1/transactions


12594: <p>If I want to have a website that can credit bitcoins to a user's account when they deposit bitcoins, how can I have the website automatically detect when the bitcoins have been received into to the wallet address given to that customer (belonging to me), and consequently update the website to reflect their new balance automatically - without having to manually check my wallet.</p>

<p>I'm not interested in using existing payment services for this, but rather I'm interested in the coding principles required.</p>
 8717: <p>You'd have to get your hands wet with <a href="http://json-rpc.org/" rel="nofollow">JSON-RPC</a> and the <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow">bitcoind API</a>. This way you can programmatically, and automatically run specific wallet functionality like sending coins to some address once a specific condition is met.</p>

<p>More specifically I suggest you look at the <a href="https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29#Command_line_.28cURL.29" rel="nofollow">raw HTTP calls</a> being sent to the bitcoind server. </p>
 12889: <p><a href="http://blockchain.info/de/api/api_receive" rel="nofollow">http://blockchain.info/de/api/api_receive</a></p>

<p>First you get a new bitcoin-adress from blockchain and on the same way you send them a callback url</p>

<p>The new bitcoin-adress you can send your custormer to pay</p>

<p>blockchain.info calls your callback procedure every time something changed in the payment-process. First time, when the customer send your bitcoins. In the Parameters you can find the amount of Bitcoins (in Satoshi = 1/100.000.000 BTC) and the number of confimations.</p>

<p>The Number of confirmations counting up every call from blockchain.ino to your callback procedure. The calls  don't stop until you return <em>ok</em>...!</p>

<p>When you think you have enough confirmations you can mark your Payment as done and return <em>ok</em> The bitcoins booked on the bitcoin-address ($my_address) you send to blockchain.info in the first call.</p>

<p>This are only a few statements as you see in my link at hte beginning of my text.</p>

<p>blockchain.info calls your callbackprocedure with its own parameters and returns the parameter you send to blockchain.info. For this you can (not must) send your secret key. So you can detect spam-calls to your callback-funktion from other persons.</p>

<p>Regards heinz
www.btcloc.com</p>
 12896: <p>Might be wise to wait until 3 or 4 new blocks have been created (after payment detected) before assuming the transaction to be trustworthy.</p>
 11121: <p>If you're going to be running bitcoind, what you're looking for is the walletnotify <a href="https://en.bitcoin.it/wiki/Running_Bitcoin" rel="nofollow">configuration setting</a> in bitcoin.conf.</p>

<p>If you enable walletnotify, you run an app like curl to post the data to a web page.  The data that you'll receive is the transaction id of an incoming transaction for an address in your wallet.  From that you can use bitcoind's json-rpc commands to get the address that received the transaction as well as other transaction details like the amount.</p>

<p>Walletnotify will execute twice.  It will execute the first time that a transaction appears, and then will get called again when a block is published that includes the transaction. You can use either or both of these notifications depending on your needs.</p>

<p>This is the curl command that I use in walletnofify.  You should make any changes for your own environment.</p>

<pre><code>curl -X POST -H "Content-Type:application/json" -d '{"transactionId":"%s"}' http://127.0.0.1:81/api/v1/transactions
</code></pre>
