lib/active_merchant/billing/gateways/blue_snap.rb in activemerchant-1.86.0 vs lib/active_merchant/billing/gateways/blue_snap.rb in activemerchant-1.87.0
- old
+ new
@@ -228,11 +228,11 @@
parsed
end
def parse_element(parsed, node)
if !node.elements.empty?
- node.elements.each {|e| parse_element(parsed, e) }
+ node.elements.each { |e| parse_element(parsed, e) }
else
parsed[node.name.downcase] = node.text
end
end
@@ -260,11 +260,11 @@
)
end
def url(action = nil)
base = test? ? test_url : live_url
- resource = (action == :store) ? 'vaulted-shoppers' : 'transactions'
+ resource = action == :store ? 'vaulted-shoppers' : 'transactions'
"#{base}/#{resource}"
end
def cvv_result(parsed)
CVVResult.new(CVC_CODE_TRANSLATOR[parsed['cvv-response-code']])
@@ -277,20 +277,20 @@
def avs_lookup_key(p)
"line1: #{p['avs-response-code-address']}, zip: #{p['avs-response-code-zip']}, name: #{p['avs-response-code-name']}"
end
def success_from(action, response)
- (200...300).include?(response.code.to_i)
+ (200...300).cover?(response.code.to_i)
end
def message_from(succeeded, parsed_response)
return 'Success' if succeeded
parsed_response['description']
end
def authorization_from(action, parsed_response)
- (action == :store) ? vaulted_shopper_id(parsed_response) : parsed_response['transaction-id']
+ action == :store ? vaulted_shopper_id(parsed_response) : parsed_response['transaction-id']
end
def vaulted_shopper_id(parsed_response)
return nil unless parsed_response['content-location-header']
parsed_response['content-location-header'].split('/').last
@@ -305,10 +305,10 @@
xmlns: 'http://ws.plimus.com'
}
end
def root_element(action)
- (action == :store) ? 'vaulted-shopper' : 'card-transaction'
+ action == :store ? 'vaulted-shopper' : 'card-transaction'
end
def headers
{
'Content-Type' => 'application/xml',