1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

(bug) admin cannot pay order by card

This commit is contained in:
Du Peng 2022-11-07 18:51:49 +01:00
parent 42be9ae3e7
commit ac2de3d22e

View File

@ -18,16 +18,14 @@ class Checkout::PaymentService
CouponService.new.validate(coupon_code, order.statistic_profile.user.id) CouponService.new.validate(coupon_code, order.statistic_profile.user.id)
amount = debit_amount(order) amount = debit_amount(order)
if operator.privileged? || amount.zero? if (operator.privileged? && operator != order.statistic_profile.user) || amount.zero?
Payments::LocalService.new.payment(order, coupon_code) Payments::LocalService.new.payment(order, coupon_code)
elsif operator.member? elsif Stripe::Helper.enabled? && payment_id.present?
if Stripe::Helper.enabled? Payments::StripeService.new.payment(order, coupon_code, payment_id)
Payments::StripeService.new.payment(order, coupon_code, payment_id) elsif PayZen::Helper.enabled?
elsif PayZen::Helper.enabled? Payments::PayzenService.new.payment(order, coupon_code)
Payments::PayzenService.new.payment(order, coupon_code) else
else raise Error('Bad gateway or online payment is disabled')
raise Error('Bad gateway or online payment is disabled')
end
end end
end end