mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
Add payment method fees to order during checkout
The fee is displayed as "Transaction fee".
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user