lib/active_merchant/billing/gateways/secure_net.rb in activemerchant-1.36.0 vs lib/active_merchant/billing/gateways/secure_net.rb in activemerchant-1.37.0
- old
+ new
@@ -22,11 +22,11 @@
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
self.homepage_url = 'http://www.securenet.com/'
self.display_name = 'SecureNet'
self.test_url = 'https://certify.securenet.com/API/gateway.svc/webHttp/ProcessTransaction'
- self.live_url = 'https://gateway.securenet.com/api/Gateway.svc'
+ self.live_url = 'https://gateway.securenet.com/api/Gateway.svc/webHttp/ProcessTransaction'
APPROVED, DECLINED = 1, 2
CARD_CODE_ERRORS = %w( N S )
AVS_ERRORS = %w( A E N R W Z )
@@ -63,16 +63,16 @@
private
def commit(request)
xml = build_request(request)
- data = ssl_post(self.test_url, xml, "Content-Type" => "text/xml")
+ url = test? ? self.test_url : self.live_url
+ data = ssl_post(url, xml, "Content-Type" => "text/xml")
response = parse(data)
- test_mode = test?
Response.new(success?(response), message_from(response), response,
- :test => test_mode,
+ :test => test?,
:authorization => build_authorization(response),
:avs_result => { :code => response[:avs_result_code] },
:cvv_result => response[:card_code_response_code]
)
end
@@ -205,10 +205,10 @@
xml.tag! 'OVERRIDE_FROM', 0 # Docs say not required, but doesn't work without it
end
def add_more_required_params(xml, options)
xml.tag! 'RETAIL_LANENUM', '0'
- xml.tag! 'TEST', 'TRUE'
+ xml.tag! 'TEST', 'TRUE' if test?
xml.tag! 'TOTAL_INSTALLMENTCOUNT', 0
xml.tag! 'TRANSACTION_SERVICE', 0
end
def success?(response)