예제 #1
0
 def _process(self):
     event = self._conf
     methods = get_payment_plugins()
     enabled_methods = [method for method in methods.itervalues() if method.event_settings.get(event, 'enabled')]
     return WPPaymentEventManagement.render_template('management/payments.html', event, event=event,
                                                     settings=event_settings.get_all(event),
                                                     methods=methods.items(), enabled_methods=enabled_methods)
예제 #2
0
 def _process(self):
     event = self._conf
     currencies = {c['code']: c['name'] for c in settings.get('currencies')}
     plugins = get_payment_plugins()
     enabled_plugins = [plugin for plugin in plugins.itervalues() if plugin.event_settings.get(event, 'enabled')]
     return WPPaymentEventManagement.render_template('event_settings.html', event, event=event,
                                                     settings=event_settings.get_all(event),
                                                     currencies=currencies, plugins=plugins.items(),
                                                     enabled_plugins=enabled_plugins)
예제 #3
0
 def _process(self):
     form = AdminSettingsForm(obj=FormDefaults(**settings.get_all()))
     if form.validate_on_submit():
         settings.set_multi(form.data)
         flash(_('Settings saved'), 'success')
         return redirect(url_for('.admin_settings'))
     return WPPaymentAdmin.render_template(
         'admin_settings.html',
         form=form,
         plugins=get_payment_plugins().values())
예제 #4
0
 def _process(self):
     event = self._conf
     enabled = request.form['enabled'] == '1'
     if enabled and not get_payment_plugins():
         flash(_('There are no payment methods available. Please contact your Indico administrator.'), 'error')
         return redirect(url_for('.event_settings', event))
     if event_settings.get(event, 'enabled', None) is None:
         copy_settings = {'currency', 'conditions', 'register_email', 'success_email'}
         data = {k: v for k, v in settings.get_all().iteritems() if k in copy_settings}
         event_settings.set_multi(event, data)
     event_settings.set(event, 'enabled', enabled)
     return redirect(url_for('.event_settings', event))
예제 #5
0
 def _process(self):
     event = self._conf
     currencies = {c['code']: c['name'] for c in settings.get('currencies')}
     plugins = get_payment_plugins()
     enabled_plugins = [
         plugin for plugin in plugins.itervalues()
         if plugin.event_settings.get(event, 'enabled')
     ]
     return WPPaymentEventManagement.render_template(
         'event_settings.html',
         event,
         event=event,
         settings=event_settings.get_all(event),
         currencies=currencies,
         plugins=plugins.items(),
         enabled_plugins=enabled_plugins)
예제 #6
0
 def _process(self):
     event = self._conf
     enabled = request.form['enabled'] == '1'
     if enabled and not get_payment_plugins():
         flash(
             _('There are no payment methods available. Please contact your Indico administrator.'
               ), 'error')
         return redirect(url_for('.event_settings', event))
     if event_settings.get(event, 'enabled', None) is None:
         copy_settings = {
             'currency', 'conditions', 'register_email', 'success_email'
         }
         data = {
             k: v
             for k, v in settings.get_all().iteritems()
             if k in copy_settings
         }
         event_settings.set_multi(event, data)
     event_settings.set(event, 'enabled', enabled)
     return redirect(url_for('.event_settings', event))
예제 #7
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     try:
         self.plugin = get_payment_plugins()[request.view_args['method']]
     except KeyError:
         raise NotFound
예제 #8
0
 def _process(self):
     form = AdminSettingsForm(obj=FormDefaults(**settings.get_all()))
     if form.validate_on_submit():
         settings.set_multi(form.data)
         flash(_('Settings saved'), 'success')
         return redirect(url_for('.admin_settings'))
     return WPPaymentAdmin.render_template('admin_settings.html', form=form, plugins=get_payment_plugins().values())
예제 #9
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     try:
         self.plugin = get_payment_plugins()[request.view_args['method']]
     except KeyError:
         raise NotFound
예제 #10
0
 def plugin(self):
     from indico.modules.payment.util import get_payment_plugins
     return get_payment_plugins().get(self.provider)
예제 #11
0
 def plugin(self):
     from indico.modules.payment.util import get_payment_plugins
     return get_payment_plugins().get(self.provider)
예제 #12
0
 def _checkParams(self, params):
     RHPaymentManagementBase._checkParams(self, params)
     try:
         self.plugin = get_payment_plugins()[request.view_args['method']]
     except KeyError:
         raise NotFound