Skip to content

Commit 198f348

Browse files
committed
patch order breakdown discount
1 parent a6f87f5 commit 198f348

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/models/solidus_paypal_commerce_platform/paypal_order.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def breakdown
9292
item_total: price(@order.item_total),
9393
shipping: price(@order.shipment_total),
9494
tax_total: price(@order.additional_tax_total),
95-
discount: price(@order.all_adjustments.promotion.sum(&:amount).abs)
95+
discount: price(@order.promo_total.abs)
9696
}
9797
end
9898

spec/models/solidus_paypal_commerce_platform/paypal_order_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@
7070
)
7171
end
7272
end
73+
74+
context 'when an order has an inapplicable promo adjustment' do
75+
it 'does not include it in the paypal order break' do
76+
# TODO
77+
end
78+
end
7379
end
7480

7581
private

0 commit comments

Comments
 (0)