lib/active_merchant/billing/gateways/trans_first.rb in activemerchant-1.2.1 vs lib/active_merchant/billing/gateways/trans_first.rb in activemerchant-1.3.0
- old
+ new
@@ -1,13 +1,9 @@
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class TransFirstGateway < Gateway
URL = 'https://webservices.primerchants.com/creditcard.asmx/CCSale'
-
- attr_reader :url
- attr_reader :response
- attr_reader :options
self.supported_countries = ['US']
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
self.homepage_url = 'http://www.transfirst.com/'
self.display_name = 'TransFirst'
@@ -92,21 +88,16 @@
response
end
def commit(params)
- if result = test_result_from_cc_number(params[:CardNumber])
- return result
- end
-
- data = ssl_post URL, post_data(params)
-
- @response = parse(data)
- success = @response[:status] == "Authorized"
+ response = parse( ssl_post(URL, post_data(params)) )
- Response.new(success, message_from(@response), @response,
+ Response.new(response[:status] == "Authorized", message_from(response), response,
:test => test?,
- :authorization => @response[:trans_id]
+ :authorization => response[:trans_id],
+ :avs_result => { :code => response[:avs_code] },
+ :cvv_result => response[:cvv2_code]
)
end
def message_from(response)
case response[:message]