This can be implemented by using AGI (Asterisk Gateway Interface)script. This AGI will handle IVR and getting user keytone pressed. From here, user can enter their credit card info such as card number, expired, CVV2 code, and number to pay. Also, it can be protected by user pin for its validation. You should use current existing payment gateway such as [login to view URL] or Paypal. We could use their sandbox account so you could evaluate how it really works on your system without worry to pay anything. If you are located on USA or UK, you can use Paypal Developer account for this sandbox purpose. I ever worked with this kind of system, so I know it well. One day work can be reached with my current experience. I could use my own freepbx box such as Elastix, Trixbox, or pure Asterisk box. Let me know