def loadPlugins(self, initSorted=True): self.payMods = {} epaymentModules = PluginLoader.getPluginsByType("EPayment") for mod in epaymentModules: self.payMods[mod.__name__] = mod.epayment.getPayMod() self._p_changed = 1 if initSorted: self.initSortedModPay()
def process(self, params): from MaKaC.plugins import PluginLoader epaymentModules = PluginLoader.getPluginsByType("EPayment") module = None for mod in epaymentModules: params2 = copy(params) if mod.webinterface.rh.preprocessParams(params2) and \ mod.MODULE_ID == params2.get("EPaymentName","No module name"): module = mod break if module: rhmod = module.webinterface.rh rhmod.preprocessParams(params) requestTag = params.get("requestTag", "No requestTag") rh = rhmod.getRHByTag(rhmod, requestTag) if rh: return rh(self._req).process(params) return ""
def process(self, params): from MaKaC.plugins import PluginLoader epaymentModules = PluginLoader.getPluginsByType("EPayment") module = None for mod in epaymentModules: if mod.MODULE_ID == params.get("EPaymentName","No module name"): module = mod break if module: try: rhmod = module.webinterface.rh except: raise MaKaCError("%s"%module) requestTag = params.get("requestTag", "No requestTag") rh = rhmod.getRHByTag(rhmod, requestTag) if rh: return rh(self._req).process(params) return "Request handler not found" return "Module not found"
def process(self, params): from MaKaC.plugins import PluginLoader epaymentModules = PluginLoader.getPluginsByType("EPayment") module = None for mod in epaymentModules: if mod.MODULE_ID == params.get("EPaymentName", "No module name"): module = mod break if module: try: rhmod = module.webinterface.rh except: raise MaKaCError("%s" % module) requestTag = params.get("requestTag", "No requestTag") rh = rhmod.getRHByTag(rhmod, requestTag) if rh: return rh(self._req).process(params) return "Request handler not found" return "Module not found"
def updatePlugins(self, initSorted=True): epaymentModules = PluginLoader.getPluginsByType("EPayment") changed = False for mod in epaymentModules: name = mod.MODULE_ID if name not in self.payMods: self.payMods[name] = mod.epayment.getPayMod() changed = True else: # this seems to be some kind of replacement mechanism # no idea of its use though... if not isinstance(self.payMods[name], mod.epayment.getPayModClass()): newMod = mod.epayment.getPayMod() self.payMods[mod.MODULE_ID] = newMod changed = True if changed: self._p_changed = 1 if initSorted: self.initSortedModPay()
def getAvailablePlugins(): mods = PluginLoader.getPluginsByType("RoomBooking") return mods