Charge money as a part of a form complition

I need to collect information from users with a form - I know how, and I know how to connect it to DB. But I need also to collect money for a service provided on the website. How can I connect the payment verification to the whole process of collecting the data? The best would be if I can get an input to the database if Yes/No paid.

Thank you !