예제 #1
0
 def skip_unless_basket_requires_shipping(self, request):
     # Check to see that a shipping address is actually required.  It may
     # not be if the basket is purely downloads
     if not request.basket.is_shipping_required():
         raise exceptions.PassedSkipCondition(
             url=reverse('checkout:shipping-method')
         )
예제 #2
0
    def skip_unless_payment_is_required(self, request):
        # Check to see if payment is actually required for this order.

        shipping_charge = self.get_shipping_charge(request.basket)
        total = self.get_order_totals(request.basket, shipping_charge)

        if total.excl_tax == D('0.00'):
            raise exceptions.PassedSkipCondition(
                url=reverse('checkout:preview'))
예제 #3
0
파일: session.py 프로젝트: cglane/OCB
 def skip_unless_payment_is_required(self, request):
     # Check to see if payment is actually required for this order.
     shipping_address = self.get_shipping_address(request.basket)
     shipping_method = self.get_shipping_method(request.basket,
                                                shipping_address)
     if shipping_method:
         shipping_charge = shipping_method.calculate(request.basket)
     else:
         # It's unusual to get here as a shipping method should be set by
         # the time this skip-condition is called. In the absence of any
         # other evidence, we assume the shipping charge is zero.
         shipping_charge = prices.Price(currency=request.basket.currency,
                                        excl_tax=D('0.00'),
                                        tax=D('0.00'))
     total = self.get_order_totals(request.basket, shipping_charge)
     if total.excl_tax == D('0.00'):
         raise exceptions.PassedSkipCondition(
             url=reverse('checkout:preview'))
예제 #4
0
 def skip_payment_if_proxy(self, request):
     if not self.preview and self.checkout_session.proxy():
         raise exceptions.PassedSkipCondition(
             url=reverse('checkout:preview'))
예제 #5
0
 def skip_unless_payment_is_required(self, request):
     if settings.SKIP_PAYMENT_CHOICES:
         raise exceptions.PassedSkipCondition(
             url=reverse('checkout:preview'))