Esempio n. 1
0
 def isValid(self, product=None):
     """Returns true if the corresponding payment validator is not False and
     all contained criteria are True.
     """
     # First we check the general validity. For that we try to get the
     # corresponding payment validator.
     type   = IType(self.context).getType()
     pm     = IPaymentManagement(IShopManagement(self.context).getShop())
     method = pm.getPaymentMethod(type)
     
     # Only if we find one, we check validity. If we didn't find one, we
     # consider the general validity as fulfilled.
     if method and IValidity(method).isValid() == False:
         return False
     
     # If the non-validity isn't proved we check the criteria of context
     # (a customer payment method)
     return super(CustomerPaymentValidityManagement, self).isValid(product)
Esempio n. 2
0
    def isValid(self, product=None):
        """Returns true if the corresponding payment validator is not False and
        all contained criteria are True.
        """
        # First we check the general validity. For that we try to get the
        # corresponding payment validator.
        type = IType(self.context).getType()
        pm = IPaymentManagement(IShopManagement(self.context).getShop())
        method = pm.getPaymentMethod(type)

        # Only if we find one, we check validity. If we didn't find one, we
        # consider the general validity as fulfilled.
        if method and IValidity(method).isValid() == False:
            return False

        # If the non-validity isn't proved we check the criteria of context
        # (a customer payment method)
        return super(CustomerPaymentValidityManagement, self).isValid(product)