moved the register payment plugin function call into a check that the plugin exists, else we get a function undefined error.