Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CyberSource: include networkTokenCryptogram in ccAuthService for MC #4834

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/active_merchant/billing/gateways/cyber_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mention that Visa requires this but the ccAuthService tag is only used for Mastercards. Visa cards have the cryptogram added to the ccAuthService.cavv field

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello and TY @aenand! I corrected the description (Visa -> Cybersource). I meant to express that we got feedback, from Cybersource, asking that the network token cryptogram is provided under the ccAuthService.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that makes more sense! I'll take a look at this Monday.

Copy link
Collaborator Author

@bbraschi bbraschi Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY! The PR is still in draft - I am confused by the fact the cryptogram we be provided twice in the same request.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that is strange 🤔 do you have a contact to reach out to at CyberSource?

xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
end
Expand Down
2 changes: 1 addition & 1 deletion test/unit/gateways/cyber_source_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'<ucaf>\n <authenticationData>111111111100cryptogram</authenticationData>\n <collectionIndicator>2</collectionIndicator>\n</ucaf>\n<ccAuthService run=\"true\">\n <commerceIndicator>spa</commerceIndicator>\n</ccAuthService>\n<businessRules>\n</businessRules>\n<paymentNetworkToken>\n <transactionType>1</transactionType>\n</paymentNetworkToken>', request_body
assert_match %r'<ucaf>\n <authenticationData>111111111100cryptogram</authenticationData>\n <collectionIndicator>2</collectionIndicator>\n</ucaf>\n<ccAuthService run=\"true\">\n <networkTokenCryptogram>111111111100cryptogram</networkTokenCryptogram>\n <commerceIndicator>spa</commerceIndicator>\n</ccAuthService>\n<businessRules>\n</businessRules>\n<paymentNetworkToken>\n <transactionType>1</transactionType>\n</paymentNetworkToken>', request_body
true
end.returns(successful_purchase_response)

Expand Down