Exemplo n.º 1
0
 def _process_args(self):
     matches = re.search(r'r(\d+)$', request.values['orderID'])
     if matches is None:
         raise BadRequest
     self.registration = Registration.find_first(id=matches.group(1))
     if self.registration is None:
         raise BadRequest
Exemplo n.º 2
0
 def _process_args(self):
     # TODO: Validation?
     # Stripe-specific form data.
     self.stripe_token = request.form['stripeToken']
     self.stripe_token_type = request.form['stripeTokenType']
     self.stripe_email = request.form['stripeEmail']
     # Indico-specific form data.
     self.token = request.args['token']
     self.registration = Registration.find_first(uuid=self.token)
     if not self.registration:
         raise BadRequest
Exemplo n.º 3
0
    def _process_args(self):
        registration_uuid = request.args['registration_uuid']
        self.registration = Registration.find_first(uuid=registration_uuid)
        if not self.registration:
            raise BadRequest("Registration UUID not provided in callback")

        use_event_api_keys = self._get_event_settings('use_event_api_keys')
        stripe.api_key = (self._get_event_settings('sec_key')
                          if use_event_api_keys else
                          current_plugin.settings.get('sec_key'))

        self.session = stripe.checkout.Session.retrieve(
            request.args['session_id'])
        if not self.session:
            raise BadRequest("Invalid stripe session")
Exemplo n.º 4
0
 def _checkParams(self):
     self.token = request.args['token']
     self.registration = Registration.find_first(uuid=self.token)
     if not self.registration:
         raise BadRequest
Exemplo n.º 5
0
 def _checkParams(self):
     self.token = request.args['token']
     self.registration = Registration.find_first(uuid=self.token)
     if not self.registration:
         raise BadRequest
Exemplo n.º 6
0
 def _process_args(self):
     self.registration = Registration.find_first(uuid=request.args['token'])
     if not self.registration:
         raise BadRequest
     self.token = (
         self.registration.transaction.data['Init_PP_response']['Token'])