Zend certified PHP/Magento developer

How can I make an order as paid after order status complete

I’m facing a problem with the payment gateway after the order is paid by the gateway most of the time the order status will be complete and no invoice is created and not registered as paid.

Is it possible after the order status is complete to create an invoice and make it as paid?

payment

invoice