Automation of Sales Order and payments

I am new to frappe and ERPNext v15. First of all thanks for the awesome developers and community people behind the development, support and guidance. I have setup some services as items. How to automate the sale flow completely if a sale order is created. My requirement is that I integrate payment system or payment gateway for customer payments, automatically update payment entry once the payment is completed successfully and in final automatically create a sale invoice with paid status, and updating the sales order completed. I went through the https://docs.frappe.io/erpnext, but couldn’t exactly figure out what to do. Requesting for help and guidance related to the same and inconveniences regretted if it feels like a beginner question