Added new plugin API for hooking into invoice processing