Method: ActiveMerchant::Billing::PayTraceGateway#refund

Defined in:
lib/active_merchant/billing/gateways/pay_trace.rb

#refund(money, authorization, options = {}) ⇒ Object



114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/active_merchant/billing/gateways/pay_trace.rb', line 114

def refund(money, authorization, options = {})
  # currently only support full and partial refunds of settled transactions via a transaction ID
  post = {}
  add_amount(post, money, options)
  if options[:check_transaction]
    post[:check_transaction_id] = authorization
    endpoint = ENDPOINTS[:ach_refund]
  else
    post[:transaction_id] = authorization
    endpoint = ENDPOINTS[:transaction_refund]
  end
  response = commit(endpoint, post)
  check_token_response(response, endpoint, post, options)
end