public IHttpActionResult Install(PluginInfoModel model) { //first find the plugin var pluginInfo = _pluginFinderService.FindPlugin(model.SystemName); if (pluginInfo == null) { //was it a correct plugin? VerboseReporter.ReportError("The plugin doesn't exist", "plugin"); return(RespondFailure()); } //install the plugin _pluginInstallerService.Install(pluginInfo); VerboseReporter.ReportSuccess("The plugin has been installed", "plugin"); return(RespondSuccess()); }
private IPaymentProcessorPlugin GetPluginInstance(string pluginSystemName) { var isInstalled = false; var pluginInfo = _pluginFinder.FindPlugin(pluginSystemName); if (pluginInfo != null && pluginInfo.Installed) { isInstalled = true; } //is installed if (!isInstalled) { return(null); } var plugin = pluginInfo.LoadPluginInstance <IPaymentProcessorPlugin>(); return(plugin); }