lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.78.0 vs lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.79.0
- old
+ new
@@ -256,11 +256,11 @@
xml = Builder::XmlMarkup.new :indent => 2
add_payment_method_or_subscription(xml, money, creditcard_or_reference, options)
add_decision_manager_fields(xml, options)
add_mdd_fields(xml, options)
add_auth_service(xml, creditcard_or_reference, options)
- xml.tag! 'payerAuthEnrollService', {'run' => 'true'} if options[:payer_auth_enroll_service]
+ add_threeds_services(xml, options)
add_payment_network_token(xml) if network_tokenization?(creditcard_or_reference)
add_business_rules_data(xml, creditcard_or_reference, options)
xml.target!
end
@@ -293,11 +293,11 @@
add_mdd_fields(xml, options)
if !payment_method_or_reference.is_a?(String) && card_brand(payment_method_or_reference) == 'check'
add_check_service(xml)
else
add_purchase_service(xml, payment_method_or_reference, options)
- xml.tag! 'payerAuthEnrollService', {'run' => 'true'} if options[:payer_auth_enroll_service]
+ add_threeds_services(xml, options)
add_payment_network_token(xml) if network_tokenization?(payment_method_or_reference)
add_business_rules_data(xml, payment_method_or_reference, options) unless options[:pinless_debit_card]
end
xml.target!
end
@@ -663,9 +663,18 @@
end
end
def add_validate_pinless_debit_service(xml)
xml.tag!'pinlessDebitValidateService', {'run' => 'true'}
+ end
+
+ def add_threeds_services(xml, options)
+ xml.tag! 'payerAuthEnrollService', {'run' => 'true'} if options[:payer_auth_enroll_service]
+ if options[:payer_auth_validate_service]
+ xml.tag! 'payerAuthValidateService', {'run' => 'true'} do
+ xml.tag! 'signedPARes', options[:pares]
+ end
+ end
end
def lookup_country_code(country_field)
country_code = Country.find(country_field) rescue nil
country_code.code(:alpha2) if country_code