Method: ActiveMerchant::Billing::TransactProGateway#refund

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

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



81
82
83
84
85
86
87
88
89
90
# File 'lib/active_merchant/billing/gateways/transact_pro.rb', line 81

def refund(amount, authorization, options = {})
  identifier, original_amount = split_authorization(authorization)

  post = PostData.new
  add_credentials(post, :account_guid)
  post[:init_transaction_id] = identifier
  post[:amount_to_refund] = amount(amount || original_amount)

  commit('refund', post)
end