Commit c84ea56f by Renzo Lucioni

Be consistent about not requiring shipping

parent 374db800
...@@ -8,7 +8,7 @@ Basket = get_model('basket', 'Basket') ...@@ -8,7 +8,7 @@ Basket = get_model('basket', 'Basket')
Product = get_model('catalogue', 'Product') Product = get_model('catalogue', 'Product')
Selector = get_class('partner.strategy', 'Selector') Selector = get_class('partner.strategy', 'Selector')
Free = get_class('shipping.methods', 'Free') NoShippingRequired = get_class('shipping.methods', 'NoShippingRequired')
OrderNumberGenerator = get_class('order.utils', 'OrderNumberGenerator') OrderNumberGenerator = get_class('order.utils', 'OrderNumberGenerator')
OrderTotalCalculator = get_class('checkout.calculators', 'OrderTotalCalculator') OrderTotalCalculator = get_class('checkout.calculators', 'OrderTotalCalculator')
...@@ -56,7 +56,7 @@ def get_order_metadata(basket): ...@@ -56,7 +56,7 @@ def get_order_metadata(basket):
and a Price object representing the order total. and a Price object representing the order total.
""" """
number = OrderNumberGenerator().order_number(basket) number = OrderNumberGenerator().order_number(basket)
shipping_method = Free() shipping_method = NoShippingRequired()
shipping_charge = shipping_method.calculate(basket) shipping_charge = shipping_method.calculate(basket)
total = OrderTotalCalculator().calculate(basket, shipping_charge) total = OrderTotalCalculator().calculate(basket, shipping_charge)
......
...@@ -9,7 +9,6 @@ from django.views.generic import View ...@@ -9,7 +9,6 @@ from django.views.generic import View
from oscar.apps.order.exceptions import UnableToPlaceOrder from oscar.apps.order.exceptions import UnableToPlaceOrder
from oscar.apps.partner import strategy from oscar.apps.partner import strategy
from oscar.apps.payment.exceptions import PaymentError from oscar.apps.payment.exceptions import PaymentError
from oscar.apps.shipping import methods as shipping_methods
from oscar.core.loading import get_class, get_model from oscar.core.loading import get_class, get_model
from ecommerce.extensions.checkout.mixins import EdxOrderPlacementMixin from ecommerce.extensions.checkout.mixins import EdxOrderPlacementMixin
...@@ -22,6 +21,7 @@ logger = logging.getLogger(__name__) ...@@ -22,6 +21,7 @@ logger = logging.getLogger(__name__)
Basket = get_model('basket', 'Basket') Basket = get_model('basket', 'Basket')
BillingAddress = get_model('order', 'BillingAddress') BillingAddress = get_model('order', 'BillingAddress')
Country = get_model('address', 'Country') Country = get_model('address', 'Country')
NoShippingRequired = get_class('shipping.methods', 'NoShippingRequired')
OrderTotalCalculator = get_class('checkout.calculators', 'OrderTotalCalculator') OrderTotalCalculator = get_class('checkout.calculators', 'OrderTotalCalculator')
...@@ -99,7 +99,7 @@ class CybersourceNotifyView(EdxOrderPlacementMixin, View): ...@@ -99,7 +99,7 @@ class CybersourceNotifyView(EdxOrderPlacementMixin, View):
# Note (CCB): In the future, if we do end up shipping physical products, we will need to properly implement # Note (CCB): In the future, if we do end up shipping physical products, we will need to properly implement
# shipping methods. See http://django-oscar.readthedocs.org/en/latest/howto/how_to_configure_shipping.html. # shipping methods. See http://django-oscar.readthedocs.org/en/latest/howto/how_to_configure_shipping.html.
shipping_method = shipping_methods.NoShippingRequired() shipping_method = NoShippingRequired()
shipping_charge = shipping_method.calculate(basket) shipping_charge = shipping_method.calculate(basket)
# Note (CCB): This calculation assumes the payment processor has not sent a partial authorization, thus we use # Note (CCB): This calculation assumes the payment processor has not sent a partial authorization, thus we use
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment