lib/active_merchant/billing/gateways/exact.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/exact.rb in activemerchant-1.116.0
- old
+ new
@@ -3,30 +3,30 @@
class ExactGateway < Gateway
self.live_url = self.test_url = 'https://secure2.e-xact.com/vplug-in/transaction/rpc-enc/service.asmx'
API_VERSION = '8.5'
- TEST_LOGINS = [{login: 'A00049-01', password: 'test1'},
- {login: 'A00427-01', password: 'testus'}]
+ TEST_LOGINS = [{ login: 'A00049-01', password: 'test1' },
+ { login: 'A00427-01', password: 'testus' }]
TRANSACTIONS = { sale: '00',
authorization: '01',
capture: '32',
credit: '34' }
ENVELOPE_NAMESPACES = { 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
- 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'}
+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' }
SEND_AND_COMMIT_ATTRIBUTES = { 'xmlns:n1' => 'http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/Request',
- 'env:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/'}
+ 'env:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/' }
SEND_AND_COMMIT_SOURCE_ATTRIBUTES = { 'xmlns:n2' => 'http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/encodedTypes',
- 'xsi:type' => 'n2:Transaction'}
+ 'xsi:type' => 'n2:Transaction' }
POST_HEADERS = { 'soapAction' => 'http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/SendAndCommit',
- 'Content-Type' => 'text/xml'}
+ 'Content-Type' => 'text/xml' }
SUCCESS = 'true'
SENSITIVE_FIELDS = %i[verification_str2 expiry_date card_number]
@@ -160,12 +160,11 @@
Response.new(successful?(response), message_from(response), response,
test: test?,
authorization: authorization_from(response),
avs_result: { code: response[:avs] },
- cvv_result: response[:cvv2]
- )
+ cvv_result: response[:cvv2])
rescue ResponseError => e
case e.response.code
when '401'
return Response.new(false, "Invalid Login: #{e.response.body}", {}, test: test?)
else
@@ -205,10 +204,10 @@
parse_elements(response, root)
elsif root = REXML::XPath.first(xml, '//soap:Fault')
parse_elements(response, root)
end
- response.delete_if { |k, v| SENSITIVE_FIELDS.include?(k) }
+ response.delete_if { |k, _v| SENSITIVE_FIELDS.include?(k) }
end
def parse_elements(response, root)
root.elements.to_a.each do |node|
response[node.name.gsub(/EXact/, 'Exact').underscore.to_sym] = (node.text || '').strip