lib/active_merchant/billing/gateways/barclaycard_smartpay.rb in activemerchant-1.103.0 vs lib/active_merchant/billing/gateways/barclaycard_smartpay.rb in activemerchant-1.104.0
- old
+ new
@@ -182,10 +182,11 @@
def authorization_from(parameters, response)
authorization = [parameters[:originalReference], response['pspReference']].compact
return nil if authorization.empty?
+
return authorization.join('#')
end
def parse_avs_code(response)
AVS_MAPPING[response['additionalData']['avsResult'][0..1].strip] if response.dig('additionalData', 'avsResult')
@@ -236,10 +237,11 @@
def message_from(response)
return response['resultCode'] if response.has_key?('resultCode') # Payment request
return response['response'] if response['response'] # Modification request
return response['result'] if response.has_key?('result') # Store/Recurring request
+
'Failure' # Negative fallback in case of error
end
def success_from(response)
return true if response['result'] == 'Success'
@@ -365,16 +367,18 @@
post[:additionalData][:executeThreeD] = options[:execute_threed]
post[:additionalData][:scaExemption] = options[:sca_exemption] if options[:sca_exemption]
end
else
return unless options[:execute_threed] || options[:threed_dynamic]
+
post[:browserInfo] = { userAgent: options[:user_agent], acceptHeader: options[:accept_header] }
post[:additionalData] = { executeThreeD: 'true' } if options[:execute_threed]
end
end
def add_browser_info(browser_info, post)
return unless browser_info
+
post[:browserInfo] = {
acceptHeader: browser_info[:accept_header],
colorDepth: browser_info[:depth],
javaEnabled: browser_info[:java],
language: browser_info[:language],