lib/active_merchant/billing/gateways/authorize_net.rb in activemerchant-1.121.0 vs lib/active_merchant/billing/gateways/authorize_net.rb in activemerchant-1.123.0
- old
+ new
@@ -565,17 +565,19 @@
add_billing_address(xml, payment_source, options)
add_shipping_address(xml, options)
xml.customerIP(options[:ip]) unless empty?(options[:ip])
- xml.cardholderAuthentication do
- three_d_secure = options.fetch(:three_d_secure, {})
- xml.authenticationIndicator(
- options[:authentication_indicator] || three_d_secure[:eci]
- )
- xml.cardholderAuthenticationValue(
- options[:cardholder_authentication_value] || three_d_secure[:cavv]
- )
+ if !empty?(options.fetch(:three_d_secure, {})) || options[:authentication_indicator] || options[:cardholder_authentication_value]
+ xml.cardholderAuthentication do
+ three_d_secure = options.fetch(:three_d_secure, {})
+ xml.authenticationIndicator(
+ options[:authentication_indicator] || three_d_secure[:eci]
+ )
+ xml.cardholderAuthenticationValue(
+ options[:cardholder_authentication_value] || three_d_secure[:cavv]
+ )
+ end
end
end
def add_billing_address(xml, payment_source, options)
address = options[:billing_address] || options[:address] || {}