Sites like coinbase and inputs.io make it really easy. But I'll talk about the proccess on inputs.io but the proccess is fairly similiar to coinbase.
To start accepting payments all you have to do is add one of these
<script src='https://inputs.io/js/buttons.js'></script>
<a href='https://inputs.io/pay?to=messagecoin' class='inputsio-alt' data-to='messagecoin'>Buy Now</a>
With that code this will appear.
Although that be a buy button for me, see the actual inputs.io or coinbase page on how to make a button for precise code.
You add a note to label the transaction to be able to recognize it, inputs.io lets you disable the field so that user can't change it. So let's say a user makes a buy on a button labeled "website buy for user: torba", inputs.io will then visit a url you specify on the settings page with GET data saying that a transaction with amount x, with note "website buy for user: torba" has completed. You just make a script that responds to inputs.io visiting a certain page and thats it.
Again read inputs.io or coinbase documentation on this, I'm just providing the general idea. Coinbase let's you get btc addresses with custom callback links through their api.