Hello there,
Because there are some payment gateways that don't send any kind of notification when a payment is received and sometimes it's better to know when an invoice was paid, we created a very simple WHMCS Hook to do that.
Link: https://www.hetnix.com/blog/hetnix/whmcs-hook-receive-notification-after-invoice-paid/
Feel free to customize it however you like.