diff --git a/CHANGELOG b/CHANGELOG index b544b50d3e5..ed282283ff7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,7 @@ * Kushki: Add Brazil as supported country [almalee24] #4829 * Adyen: Add additional data for airline and lodging [javierpedrozaing] #4815 * MIT: Changed how the payload was sent to the gateway [alejandrofloresm] #4655 +* CyberSource: include `networkTokenCryptogram` in `ccAuthService` [bbraschi] == Version 1.131.0 (June 21, 2023) * Redsys: Add supported countries [jcreiff] #4811 diff --git a/lib/active_merchant/billing/gateways/cyber_source.rb b/lib/active_merchant/billing/gateways/cyber_source.rb index 4b6ea9c724e..d22ec7e5228 100644 --- a/lib/active_merchant/billing/gateways/cyber_source.rb +++ b/lib/active_merchant/billing/gateways/cyber_source.rb @@ -813,6 +813,7 @@ def add_auth_network_tokenization(xml, payment_method, options) xml.tag!('collectionIndicator', DEFAULT_COLLECTION_INDICATOR) end xml.tag! 'ccAuthService', { 'run' => 'true' } do + xml.tag!('networkTokenCryptogram', payment_method.payment_cryptogram) if payment_method.payment_cryptogram xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand]) xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id] end diff --git a/test/unit/gateways/cyber_source_test.rb b/test/unit/gateways/cyber_source_test.rb index 53055ccd7c0..aaf11eedfd2 100644 --- a/test/unit/gateways/cyber_source_test.rb +++ b/test/unit/gateways/cyber_source_test.rb @@ -884,7 +884,7 @@ def test_successful_purchase_with_network_tokenization_for_visa def test_successful_auth_with_network_tokenization_for_mastercard @gateway.expects(:ssl_post).with do |_host, request_body| assert_xml_valid_to_xsd(request_body) - assert_match %r'\n 111111111100cryptogram\n 2\n\n\n spa\n\n\n\n\n 1\n', request_body + assert_match %r'\n 111111111100cryptogram\n 2\n\n\n 111111111100cryptogram\n spa\n\n\n\n\n 1\n', request_body true end.returns(successful_purchase_response)