Esempio n. 1
0
 def _verify_amount(self):
     expected_amount = self.registration.price
     expected_currency = self.registration.currency
     amount = float(request.form['mc_gross'])
     currency = request.form['mc_currency']
     if expected_amount == amount and expected_currency == currency:
         return True
     current_plugin.logger.warning("Payment doesn't match event's fee: %s %s != %s %s",
                                   amount, currency, expected_amount, expected_currency)
     notify_amount_inconsistency(self.registration, amount, currency)
     return False
Esempio n. 2
0
 def _verify_amount(self):
     expected_amount = self.registration.price
     expected_currency = self.registration.currency
     amount = float(request.form['mc_gross'])
     currency = request.form['mc_currency']
     if expected_amount == amount and expected_currency == currency:
         return True
     current_plugin.logger.warning("Payment doesn't match event's fee: %s %s != %s %s",
                                   amount, currency, expected_amount, expected_currency)
     notify_amount_inconsistency(self.registration, amount, currency)
     return False
Esempio n. 3
0
 def _verify_amount(self, transaction_data):
     """Verify the amount and currency of the payment; sends an email but still registers incorrect payments"""
     expected_amount = float(self.registration.price)
     expected_currency = self.registration.currency
     amount = float(transaction_data['AMOUNT'])
     currency = transaction_data['CURRENCY']
     if to_small_currency(
             expected_amount,
             expected_currency) == amount and expected_currency == currency:
         return True
     current_plugin.logger.warning(
         "Payment doesn't match events fee: %s %s != %s %s", amount,
         currency, to_small_currency(expected_amount,
                                     expected_currency), expected_currency)
     notify_amount_inconsistency(self.registration,
                                 to_large_currency(amount, currency),
                                 currency)
     return False
Esempio n. 4
0
    def _verify_amount(self, assert_data):
        """Verify the amount and currency of the payment.

        Sends an email but still registers incorrect payments.
        """
        expected_amount = float(self.registration.price)
        expected_currency = self.registration.currency
        amount = float(assert_data['Transaction']['Amount']['Value'])
        currency = assert_data['Transaction']['Amount']['CurrencyCode']
        if (to_small_currency(expected_amount, expected_currency) == amount
                and expected_currency == currency):
            return True
        current_plugin.logger.warning(
            "Payment doesn't match events fee: %s %s != %s %s", amount,
            currency, to_small_currency(expected_amount,
                                        expected_currency), expected_currency)
        notify_amount_inconsistency(self.registration,
                                    to_large_currency(amount, currency),
                                    currency)
        return False