You will want to do a search for various providers, such as PayPal, etc. Each provider will have documentation on how to implement their service. Each service will be different so there is no one piece of code that will work everywhere.
Some will cost more than others so you need to do quite a bit of research before you settle on one.
There was actually a discussion on this topic today in the Lounge, see
The Lounge - CodeProject[
^]