mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
(fix) cant pay order with coupon
This commit is contained in:
parent
d98082a2c4
commit
6d2239bc15
@ -11,7 +11,7 @@ class Checkout::PaymentService
|
||||
|
||||
raise Cart::InactiveProductError unless Orders::OrderService.new.all_products_is_active?(order)
|
||||
|
||||
CouponService.new.validate(coupon_code, order.statistic_profile.user)
|
||||
CouponService.new.validate(coupon_code, order.statistic_profile.user.id)
|
||||
|
||||
amount = debit_amount(order)
|
||||
if operator.privileged? || amount.zero?
|
||||
|
@ -10,7 +10,7 @@ module Payments::PaymentConcern
|
||||
end
|
||||
|
||||
def debit_amount(order, coupon_code = nil)
|
||||
total = CouponService.new.apply(order.total, coupon_code, order.statistic_profile.user)
|
||||
total = CouponService.new.apply(order.total, coupon_code, order.statistic_profile.user.id)
|
||||
wallet_debit = get_wallet_debit(order.statistic_profile.user, total)
|
||||
total - wallet_debit
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user