Skip to content

Commit

Permalink
Fixing commit to work with newer versions of active merchant.
Browse files Browse the repository at this point in the history
  • Loading branch information
ylansegal committed Mar 8, 2012
1 parent a37cd00 commit d3e647f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/authorize_net_cim_gateway_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,14 @@ def commit(action, request)
message = response_params['messages']['message']['text']
test_mode = test? || message =~ /Test Mode/
success = response_params['messages']['result_code'] == 'Ok'

response = ActiveMerchant::Billing::Response.new(success, message, response_params,
response_params['direct_response'] = parse_direct_response(response_params['direct_response']) if response_params['direct_response']
transaction_id = response_params['direct_response']['transaction_id'] if response_params['direct_response']
ActiveMerchant::Billing::Response.new(success, message, response_params,
:test => test_mode,
:authorization => response_params['customer_profile_id'] || (response_params['profile'] ? response_params['profile']['customer_profile_id'] : nil)
:authorization => transaction_id || response_params['customer_profile_id'] || (response_params['profile'] ? response_params['profile']['customer_profile_id'] : nil)
)

response.params['direct_response'] = parse_direct_response(response) if response.params['direct_response']
response
end

private

def test_credit_card(number = '4242424242424242', options = {})
Expand Down

0 comments on commit d3e647f

Please sign in to comment.