Permalink
Browse files

Revert "Merge pull request #218 from odorcicd/moneris_fraud"

This reverts commit df93d86, reversing
changes made to 147648e.
  • Loading branch information...
1 parent d42ca07 commit f509a42eed467f1e97bcec6e9dd720e8b8462d33 @jduff jduff committed Mar 7, 2012
@@ -101,9 +101,7 @@ def debit_params(money, creditcard, options = {})
:amount => amount(money),
:pan => creditcard.number,
:expdate => expdate(creditcard),
- :crypt_type => options[:crypt_type] || @options[:crypt_type],
- :cvv => creditcard.verification_value,
- :billing_address => options[:address] || options[:billing_address]
+ :crypt_type => options[:crypt_type] || @options[:crypt_type]
}
end
@@ -131,9 +129,7 @@ def commit(action, parameters = {})
Response.new(successful?(response), message_from(response[:message]), response,
:test => test?,
- :authorization => authorization_from(response),
- :avs_result => {:code => response[:avs_result_code]},
- :cvv_result => response[:cvd_result_code] && response[:cvd_result_code].last
+ :authorization => authorization_from(response)
)
end
@@ -176,32 +172,10 @@ def post_data(action, parameters = {})
actions[action].each do |key|
transaction.add_element(key.to_s).text = parameters[key] unless parameters[key].blank?
end
-
- add_avs_info(transaction, parameters)
- add_cvd_info(transaction, parameters)
-
+
xml.to_s
end
-
- def add_avs_info(transaction, parameters)
- if address = parameters[:billing_address]
- street_number, street_name = address[:address1].split(' ', 2)
-
- avs_info = transaction.add_element('avs_info')
- avs_info.add_element('avs_street_number').text = street_number
- avs_info.add_element('avs_street_name').text = street_name
- avs_info.add_element('avs_zipcode').text = address[:zip]
- end
- end
-
- def add_cvd_info(transaction, parameters)
- if cvd_value = parameters[:cvv]
- cvd_info = transaction.add_element('cvd_info')
- cvd_info.add_element('cvd_indicator').text = '1'
- cvd_info.add_element('cvd_value').text = cvd_value
- end
- end
-
+
def message_from(message)
return 'Unspecified error' if message.blank?
message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
@@ -5,7 +5,7 @@ def setup
Base.mode = :test
@gateway = MonerisGateway.new(fixtures(:moneris))
- @amount = 1010
+ @amount = 100
@credit_card = credit_card('4242424242424242')
@options = {
:order_id => generate_unique_id,
@@ -79,16 +79,4 @@ def test_failed_purchase_from_error
assert_failure response
assert_equal 'Declined', response.message
end
-
- def test_avs_results
- response = @gateway.authorize(@amount, @credit_card, @options)
- assert_success response
- assert_equal "A", response.avs_result["code"]
- end
-
- def test_cvd_results
- response = @gateway.authorize(@amount, @credit_card, @options)
- assert_success response
- assert_equal "M", response.cvv_result["code"]
- end
end
@@ -42,23 +42,7 @@ def test_refund
@gateway.expects(:parse).returns({})
@gateway.refund(@amount, "123;456", @options)
end
-
- def test_avs_result
- @gateway.expects(:ssl_post).returns(successful_purchase_response_with_avs_and_cvd)
-
- assert response = @gateway.authorize(100, @credit_card, @options)
- assert_success response
- assert_equal 'M', response.avs_result["code"]
- end
-
- def test_cvd_result
- @gateway.expects(:ssl_post).returns(successful_purchase_response_with_avs_and_cvd)
-
- assert response = @gateway.authorize(100, @credit_card, @options)
- assert_success response
- assert_equal 'M', response.cvv_result["code"]
- end
-
+
def test_amount_style
assert_equal '10.34', @gateway.send(:amount, 1034)
@@ -151,33 +135,7 @@ def successful_purchase_response
RESPONSE
end
-
- def successful_purchase_response_with_avs_and_cvd
- <<-RESPONSE
-<?xml version="1.0"?>
-<response>
- <receipt>
- <ReceiptId>1026.1</ReceiptId>
- <ReferenceNum>661221050010170010</ReferenceNum>
- <ResponseCode>027</ResponseCode>
- <ISO>01</ISO>
- <AuthCode>013511</AuthCode>
- <TransTime>18:41:13</TransTime>
- <TransDate>2008-01-05</TransDate>
- <TransType>00</TransType>
- <Complete>true</Complete>
- <Message>APPROVED * =</Message>
- <TransAmount>1.00</TransAmount>
- <CardType>V</CardType>
- <TransID>58-0_3</TransID>
- <TimedOut>false</TimedOut>
- <AvsResultCode>M</AvsResultCode>
- <CvdResultCode>1M</CvdResultCode>
- </receipt>
-</response>
- RESPONSE
- end
-
+
def failed_purchase_response
<<-RESPONSE
<?xml version="1.0"?>

0 comments on commit f509a42

Please sign in to comment.