Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
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.pyindex 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.pyindex 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.pyindex 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.amountassert payment.tax == order.total.tax.amountassert payment.currency == order.total.currency- assert payment.delivery == order.shipping_price.gross.amount+ assert payment.delivery == order.shipping_price.net.amountassert len(payment.get_purchased_items()) == len(order.lines.all())diff --git a/tests/test_payment.py b/tests/test_payment.pyindex 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_skuassert 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')).amountassert p.currency == o.unit_price.currencyorder_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_skuassert 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')).amountassert p.currency == o.unit_price.currencydiscounted = payment.get_purchased_items()[-1]