Add payment method fees to order during checkout

The fee is displayed as "Transaction fee".
This commit is contained in:
Maikel Linke
2016-05-18 15:40:08 +10:00
parent e4f855b64a
commit 0af8377844
9 changed files with 48 additions and 4 deletions

View File

@@ -62,8 +62,11 @@ Darkswarm.factory 'Checkout', (CurrentOrder, ShippingMethods, PaymentMethods, $h
shippingPrice: ->
@shippingMethod()?.price || 0.0
paymentPrice: ->
@paymentMethod()?.price || 0.0
paymentMethod: ->
PaymentMethods.payment_methods_by_id[@order.payment_method_id]
cartTotal: ->
@shippingPrice() + @order.display_total
@order.display_total + @shippingPrice() + @paymentPrice()

View File

@@ -4,5 +4,6 @@ Darkswarm.factory "PaymentMethods", (paymentMethods)->
payment_methods_by_id: {}
constructor: ->
for method in @payment_methods
method.price = parseFloat(method.price)
@payment_methods_by_id[method.id] = method