Plenty of stuff already on forum if you search, here is just 2
Example checkout code
(that one could benefit from a tweak to stop manipulation by adding a price check stage but that's simple enough)
Using IPN to manage/confirm/record transactions
Sure there is more, that's just the bits i added, just needs some searching
2 Likes