Skip to content

Commit

Permalink
Reuse #calculate_refund_amount method
Browse files Browse the repository at this point in the history
  • Loading branch information
sauloperez committed Jul 15, 2020
1 parent a8af3a2 commit 3a64cc4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/models/spree/payment/processing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,7 @@ def credit!(credit_amount = nil)
protect_from_connection_error do
check_environment

credit_amount ||= if credit_allowed >= order.outstanding_balance.abs
order.outstanding_balance.abs
else
credit_allowed.abs
end

credit_amount = credit_amount.to_f
credit_amount = calculate_refund_amount(credit_amount)

response = if payment_method.payment_profiles_supported?
payment_method.credit(
Expand Down

0 comments on commit 3a64cc4

Please sign in to comment.