corrected credit amount to always be positive (PayPal does not accept negative credit amount)
Merges #47
This commit is contained in:
parent
f8e239e3c1
commit
11c8935aac
|
@ -26,8 +26,9 @@ class Spree::PaypalAccount < ActiveRecord::Base
|
|||
authorization = find_capture(payment)
|
||||
|
||||
amount = payment.credit_allowed >= payment.order.outstanding_balance.abs ? payment.order.outstanding_balance : payment.credit_allowed
|
||||
amount=amount.abs if amount
|
||||
|
||||
ppx_response = payment.payment_method.provider.credit(amount.nil? ? amount_in_cents(amount) : amount_in_cents(amount), authorization.params['transaction_id'])
|
||||
ppx_response = payment.payment_method.provider.credit(amount.nil? ? amount_in_cents(amount) : amount_in_cents(amount), authorization.params['transaction_id'], :currency => payment.payment_method.preferred_currency)
|
||||
|
||||
if ppx_response.success?
|
||||
record_log payment, ppx_response
|
||||
|
|
Loading…
Reference in New Issue