Want to make payment status paid automatically after payment done

Hi

I have implemented knet payment gateway with invoiceplane. Can you
please help me to make the status paid automatically(some piece of code
may help me). Please help me out as payments are now going successful.

Thanks and waiting for your reply