lib/active_merchant/billing/gateways/realex.rb in activemerchant-1.91.0 vs lib/active_merchant/billing/gateways/realex.rb in activemerchant-1.92.0
- old
+ new
@@ -143,11 +143,15 @@
xml.tag! 'orderid', sanitize_order_id(options[:order_id])
add_amount(xml, money, options)
add_card(xml, credit_card)
xml.tag! 'autosettle', 'flag' => auto_settle_flag(action)
add_signed_digest(xml, timestamp, @options[:login], sanitize_order_id(options[:order_id]), amount(money), (options[:currency] || currency(money)), credit_card.number)
- add_network_tokenization_card(xml, credit_card) if credit_card.is_a?(NetworkTokenizationCreditCard)
+ if credit_card.is_a?(NetworkTokenizationCreditCard)
+ add_network_tokenization_card(xml, credit_card)
+ else
+ add_three_d_secure(xml, options)
+ end
add_comments(xml, options)
add_address_and_customer_info(xml, options)
end
xml.target!
end
@@ -278,9 +282,19 @@
xml.tag! 'eci', payment.eci
end
xml.tag! 'supplementarydata' do
xml.tag! 'item', 'type' => 'mobile' do
xml.tag! 'field01', payment.source.to_s.gsub('_', '-')
+ end
+ end
+ end
+
+ def add_three_d_secure(xml, options)
+ if options[:three_d_secure]
+ xml.tag! 'mpi' do
+ xml.tag! 'cavv', options[:three_d_secure][:cavv]
+ xml.tag! 'eci', options[:three_d_secure][:eci]
+ xml.tag! 'xid', options[:three_d_secure][:xid]
end
end
end
def format_address_code(address)