diff --git a/app/models/trade/model/payment.rb b/app/models/trade/model/payment.rb index 3695d4c17..d26d2e081 100644 --- a/app/models/trade/model/payment.rb +++ b/app/models/trade/model/payment.rb @@ -181,7 +181,7 @@ def confirm last.state = 'confirmed' last.order.compute_received_amount - self.compute_checked_amount + compute_checked_amount end def confirm!(params = {}) diff --git a/app/models/trade/model/payment/wallet_payment.rb b/app/models/trade/model/payment/wallet_payment.rb index 998b1af59..c4bf1ea82 100644 --- a/app/models/trade/model/payment/wallet_payment.rb +++ b/app/models/trade/model/payment/wallet_payment.rb @@ -3,7 +3,7 @@ module Model::Payment::WalletPayment extend ActiveSupport::Concern included do - belongs_to :wallet + belongs_to :wallet, inverse_of: :wallet_payments has_many :wallet_logs, ->(o){ where(wallet_id: o.wallet_id) }, as: :source has_many :refunds, class_name: 'WalletRefund', primary_key: [:id, :wallet_id], foreign_key: [:payment_id, :wallet_id]