lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.107.4 vs lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.108.0

- old
+ new

@@ -615,11 +615,14 @@ xml.tag!('cavvAlgorithm', threeds_2_options[:cavv_algorithm]) if threeds_2_options[:cavv_algorithm] xml.tag!('paSpecificationVersion', threeds_2_options[:version]) if threeds_2_options[:version] xml.tag!('directoryServerTransactionID', threeds_2_options[:ds_transaction_id]) if threeds_2_options[:ds_transaction_id] xml.tag!('commerceIndicator', options[:commerce_indicator] || ECI_BRAND_MAPPING[card_brand(payment_method).to_sym]) xml.tag!('eciRaw', threeds_2_options[:eci]) if threeds_2_options[:eci] - xml.tag!('xid', threeds_2_options[:xid]) if threeds_2_options[:xid] + + xid = threeds_2_options[:xid] || threeds_2_options[:cavv] + xml.tag!('xid', xid) if xid + xml.tag!('veresEnrolled', threeds_2_options[:enrolled]) if threeds_2_options[:enrolled] xml.tag!('paresStatus', threeds_2_options[:authentication_response_status]) if threeds_2_options[:authentication_response_status] end def add_threeds_2_ucaf_data(xml, payment_method, options) @@ -818,10 +821,11 @@ country_code&.code(:alpha2) end def add_stored_credential_options(xml, options={}) return unless options[:stored_credential] + xml.tag! 'subsequentAuth', 'true' if options[:stored_credential][:initiator] == 'merchant' xml.tag! 'subsequentAuthFirst', 'true' if options[:stored_credential][:initial_transaction] xml.tag! 'subsequentAuthTransactionID', options[:stored_credential][:network_transaction_id] if options[:stored_credential][:initiator] == 'merchant' xml.tag! 'subsequentAuthStoredCredential', 'true' if options[:stored_credential][:initiator] == 'cardholder' && !options[:stored_credential][:initial_transaction] || options[:stored_credential][:initiator] == 'merchant' && options[:stored_credential][:reason_type] == 'unscheduled' end @@ -910,10 +914,10 @@ def parse_element(reply, node) if node.has_elements? node.elements.each { |e| parse_element(reply, e) } else - if node.parent.name =~ /item/ + if /item/.match?(node.parent.name) parent = node.parent.name parent += '_' + node.parent.attributes['id'] if node.parent.attributes['id'] parent += '_' end reply["#{parent}#{node.name}".to_sym] ||= node.text