def _process(self): methods = get_payment_plugins() enabled_methods = [method for method in methods.itervalues() if method.event_settings.get(self.event, 'enabled')] return WPPaymentEventManagement.render_template('management/payments.html', self.event, settings=payment_event_settings.get_all(self.event), methods=methods.items(), enabled_methods=enabled_methods)
def _process(self): current_event_settings = payment_event_settings.get_all(self.event) defaults = FormDefaults(current_event_settings, **payment_settings.get_all()) form = EventSettingsForm(prefix='payment-', obj=defaults) if form.validate_on_submit(): payment_event_settings.set_multi(self.event, form.data) flash(_('Settings saved'), 'success') return jsonify_data() return jsonify_form(form)
def _process(self): current_event_settings = payment_event_settings.get_all(self.event) defaults = FormDefaults(current_event_settings, **payment_settings.get_all()) form = EventSettingsForm(prefix='payment-', obj=defaults) if form.validate_on_submit(): payment_event_settings.set_multi(self.event, form.data) flash(_('Settings saved'), 'success') return jsonify_data() return jsonify_form(form)