Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Tested against: - [x] Single line with unique and multiple quantities; - [x] Multiple lines with random quantities; - [x] Vouchers; - [x] Without VAT.

NyanKiyoshi62f865e7dd97
diff --git a/saleor/order/models.py b/saleor/order/models.py
index 1579c6ff08..42a9390a25 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -281,7 +281,7 @@ class Payment(BasePayment):
PurchasedItem(
name=line.product_name, sku=line.product_sku,
quantity=line.quantity,
- price=line.unit_price_gross.quantize(Decimal('0.01')).amount,
+ price=line.unit_price_net.quantize(Decimal('0.01')).amount,
currency=line.unit_price.currency)
for line in self.order]
diff --git a/saleor/order/views.py b/saleor/order/views.py
index 8ff982d3e2..8dd54b0af0 100644
--- a/saleor/order/views.py
+++ b/saleor/order/views.py
@@ -94,7 +94,7 @@ def start_payment(request, order, variant):
'total': total.gross.amount,
'tax': total.tax.amount,
'currency': total.currency,
- 'delivery': order.shipping_price.gross.amount,
+ 'delivery': order.shipping_price.net.amount,
'billing_first_name': billing.first_name,
'billing_last_name': billing.last_name,
'billing_address_1': billing.street_address_1,
diff --git a/tests/test_checkout_integration.py b/tests/test_checkout_integration.py
index 86053391ab..d4ceb9eecc 100644
--- a/tests/test_checkout_integration.py
+++ b/tests/test_checkout_integration.py
@@ -135,7 +135,7 @@ def test_checkout_flow_authenticated_user(
assert payment.total == order.total.gross.amount
assert payment.tax == order.total.tax.amount
assert payment.currency == order.total.currency
- assert payment.delivery == order.shipping_price.gross.amount
+ assert payment.delivery == order.shipping_price.net.amount
assert len(payment.get_purchased_items()) == len(order.lines.all())
diff --git a/tests/test_payment.py b/tests/test_payment.py
index 6058b6e501..43923a9856 100644
--- a/tests/test_payment.py
+++ b/tests/test_payment.py
@@ -15,7 +15,7 @@ def test_get_purchased_items(order_with_lines, settings, voucher):
payment.get_purchased_items(), order_with_lines.lines.all()):
assert p.sku == o.product_sku
assert p.quantity == o.quantity
- assert p.price == o.unit_price_gross.quantize(Decimal('0.01')).amount
+ assert p.price == o.unit_price_net.quantize(Decimal('0.01')).amount
assert p.currency == o.unit_price.currency
order_with_lines.discount_name = 'Test'
@@ -32,7 +32,7 @@ def test_get_purchased_items(order_with_lines, settings, voucher):
payment.get_purchased_items()[:-1], order_with_lines.lines.all()):
assert p.sku == o.product_sku
assert p.quantity == o.quantity
- assert p.price == o.unit_price_gross.quantize(Decimal('0.01')).amount
+ assert p.price == o.unit_price_net.quantize(Decimal('0.01')).amount
assert p.currency == o.unit_price.currency
discounted = payment.get_purchased_items()[-1]