Thank you for the explanation. I will probably use a third-party database (firebase) for payments.
Using firebase, different operations can be done on the client side, without disturbing the main server. I think this is very useful for a smoother user experience.
I'm not sure if I understand your question exactly, but you can write a plugin to listen to a new route (URL endpoint) or interprocess communication and load and call NodeBB libraries.
You may consider using this plugin Git repo as a bootstrap to get you started quickly. Remember that the plugin.json, package.json, and library.js are the first files to work with. The plugin repo name / directory name will need to match the glob nodebb-plugin-* and it needs to be directly under the node_modules/ directory which is at the root of your NodeBB directory.
If you're referring to the master-branch the problem is that you cache the value of
var userExt = settings.get('strings.extensions');
(and some further operations) once at plugin-start and don't refresh those values after settings.sync(); (within a callback).
So you need to re-calculate the regex variable within a callback for settings.sync.