As others have said, you need to use a payment gateway such as WorldPay or PayPal.
I personally chose Paypal because of the large amount of information on how to implement a payment system on websites using PHP, JSP, ASP.NET, etc.
Plus Paypal offers a wide range of packages according to your needs - you can also use the option "IPN" (Instant Payment Notification).
IPN Paypal will make a call to a special asp.net file that you specify on your server every time a payment is made from your website ... as part of this call, IPN will send more than a bunch of data, such as order number, recipient name and etc., you can use this data to update database tables, such as "Payment Status", a great feature!
source share