Skip to content

Commit

Permalink
support for refunds
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Mar 25, 2010
1 parent 40babd1 commit ea30bff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/active_merchant/billing/gateways/authorize_net_cim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class AuthorizeNetCimGateway < Gateway
:auth_only => 'profileTransAuthOnly',
:capture_only => 'profileTransCaptureOnly',
:prior_auth_capture => 'profileTransPriorAuthCapture',
:void => 'profileTransVoid'
:void => 'profileTransVoid',
:refund => 'profileTransRefund'
}

CIM_VALIDATION_MODES = {
Expand Down Expand Up @@ -518,7 +519,7 @@ def add_transaction(xml, transaction)
xml.tag!('customerProfileId', transaction[:customer_profile_id])
xml.tag!('customerPaymentProfileId', transaction[:customer_payment_profile_id])
xml.tag!('approvalCode', transaction[:approval_code]) if transaction[:type] == :capture_only
xml.tag!('transId', transaction[:transaction_id]) if [:prior_auth_capture, :void].include?(transaction[:type])
xml.tag!('transId', transaction[:transaction_id]) if [:prior_auth_capture, :void, :refund].include?(transaction[:type])
add_order(xml, transaction[:order]) if transaction[:order]
end
end
Expand Down

0 comments on commit ea30bff

Please sign in to comment.