def is_valid(self, request): """ Returns True if the payment method is valid. This is calculated via the attached criteria. """ from muecke.criteria import utils as criteria_utils return criteria_utils.is_valid(self, request)
def is_valid(self, request, product=None): """ The shipping price is valid if it has no criteria or if all assigned criteria are true. If product is given the product is tested otherwise the whole cart. """ return criteria_utils.is_valid(self, request, product)
def get_valid_shipping_methods(request, product=None): """Returns a list of all valid shipping methods for the passed request. """ result = [] for sm in ShippingMethod.objects.filter(active=True): if criteria_utils.is_valid(request, sm, product): result.append(sm) return result
def is_valid(self, request, product=None): """ The shipping method is valid if it has no criteria or if all assigned criteria are true. If product is given the product is tested otherwise the whole cart. """ from muecke.criteria import utils as criteria_utils return criteria_utils.is_valid(self, request, product)
def get_valid_payment_methods(request): """ Returns all valid payment methods (aka. selectable) for given request as list. """ result = [] for pm in PaymentMethod.objects.filter(active=True): if criteria_utils.is_valid(request, pm): result.append(pm) return result