1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

set operator_profile_id after payment

This commit is contained in:
Du Peng 2022-08-26 14:07:18 +02:00
parent 5030f5e1bc
commit 8d52768031

View File

@ -18,6 +18,7 @@ module Payments::PaymentConcern
def payment_success(order, payment_method = '')
ActiveRecord::Base.transaction do
WalletService.debit_user_wallet(order, order.statistic_profile.user)
order.operator_profile_id = order.statistic_profile.user.invoicing_profile.id if order.operator_profile.nil?
order.payment_method = if order.total == order.wallet_amount
'wallet'
else