From 5b964ef502219c3d59a13f74a1c0190fb8f32ff5 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 10 Aug 2016 12:35:30 +1000 Subject: [PATCH] Provide price to calculator to meet new requirements of FlatPercentItemTotal --- lib/open_food_network/enterprise_fee_calculator.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/open_food_network/enterprise_fee_calculator.rb b/lib/open_food_network/enterprise_fee_calculator.rb index 7222abad1c..e72f643ff2 100644 --- a/lib/open_food_network/enterprise_fee_calculator.rb +++ b/lib/open_food_network/enterprise_fee_calculator.rb @@ -104,8 +104,7 @@ module OpenFoodNetwork def calculate_fee_for(variant, enterprise_fee) # Spree's Calculator interface accepts Orders or LineItems, # so we meet that interface with a struct. - # Amount is faked, this is a method on LineItem - line_item = OpenStruct.new variant: variant, quantity: 1, amount: variant.price + line_item = OpenStruct.new variant: variant, quantity: 1, price: variant.price, amount: variant.price enterprise_fee.compute_amount(line_item) end