示例#1
0
 def _process(self):
     if self._registrant.getPayed():
         flash(_('You have already paid for your registration.'), 'info')
         return redirect(
             url_for('event.confRegistrationFormDisplay', self._conf,
                     **get_registrant_params()))
     checkout_attempt_delta = None
     if not self._registrant.isCheckoutSessionAlive():
         self._registrant._checkout_attempt_dt = datetime.now()
     else:
         checkout_attempt_dt = self._registrant.getCheckoutAttemptDt()
         checkout_attempt_delta = int(
             math.ceil(
                 (datetime.now() - checkout_attempt_dt).total_seconds() /
                 60))
     event = self._conf
     amount = self._registrant.getTotal()
     currency = event_settings.get(event, 'currency')
     plugins = get_active_payment_plugins(event)
     force_plugin = plugins.items()[0] if len(
         plugins) == 1 else None  # only one plugin available
     return WPPaymentEvent.render_template(
         'event_checkout.html',
         event,
         event=event,
         registrant=self._registrant,
         plugins=plugins.items(),
         force_plugin=force_plugin,
         amount=amount,
         currency=currency,
         checkout_attempt_delta=checkout_attempt_delta,
         registrant_params=get_registrant_params())
示例#2
0
 def _process(self):
     if self.registration.state != RegistrationState.unpaid:
         flash(_("The registration doesn't need to be paid"), 'error')
         return redirect(url_for('event_registration.display_regform', self.registration.locator.registrant))
     currency = event_settings.get(self.event, 'currency')
     plugins = get_active_payment_plugins(self.event)
     force_plugin = plugins.items()[0] if len(plugins) == 1 else None  # only one plugin available
     return WPPaymentEvent.render_template('event_checkout.html', self.event, event=self.event,
                                           registration=self.registration,
                                           regform=self.registration.registration_form,
                                           plugins=plugins.items(), force_plugin=force_plugin,
                                           amount=self.registration.price, currency=currency)
示例#3
0
 def _process(self):
     if self._registrant.getPayed():
         flash(_('You have already paid for your registration.'), 'info')
         return redirect(url_for('event.confRegistrationFormDisplay', self._conf, **get_registrant_params()))
     checkout_attempt_delta = None
     if not self._registrant.isCheckoutSessionAlive():
         self._registrant._checkout_attempt_dt = datetime.now()
     else:
         checkout_attempt_dt = self._registrant.getCheckoutAttemptDt()
         checkout_attempt_delta = int(math.ceil((datetime.now() - checkout_attempt_dt).total_seconds() / 60))
     event = self._conf
     amount = self._registrant.getTotal()
     currency = event_settings.get(event, 'currency')
     plugins = get_active_payment_plugins(event)
     force_plugin = plugins.items()[0] if len(plugins) == 1 else None  # only one plugin available
     return WPPaymentEvent.render_template('event_checkout.html', event, event=event, registrant=self._registrant,
                                           plugins=plugins.items(), force_plugin=force_plugin, amount=amount,
                                           currency=currency, checkout_attempt_delta=checkout_attempt_delta,
                                           registrant_params=get_registrant_params())
示例#4
0
 def _process(self):
     conditions = event_settings.get(self._conf, 'conditions')
     return WPPaymentEvent.render_template('terms_and_conditions.html', self._conf, conditions=conditions)