Provide price to calculator to meet new requirements of FlatPercentItemTotal

This commit is contained in:
Rohan Mitchell
2016-08-10 12:35:30 +10:00
parent b0eebc2e45
commit 5b964ef502

View File

@@ -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