Skip to content

feat(connector): [cybersource] add changes for field CybersourceConsumerAuthInformation #8768

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

Merged
merged 1 commit into from
Jul 31, 2025

Conversation

dgeee13
Copy link
Contributor

@dgeee13 dgeee13 commented Jul 28, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Context - Cybersource payments via Netcetera are failing for a France based acquirer in prod, the PR provides fix for the same by introducing field consumerAuthenticationInformation. effectiveAuthenticationType and making sure _consumerAuthenticationInformation.specificationVersion is sent.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Testing for field effective_authentication_type and specification_version

Step 1 - Call /payments

Curl

curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'x-feature: integ-custom' \ --header 'api-key: dev_TSUxfiSwiAelCPTr9xN2ValUdd1fvmeYg0AtMUwdJukRkTlCpHL9p2IWxn6fouYl' \ --data-raw '{ "amount": 2540, "currency": "USD", "profile_id": "pro_aKVBsBqyTIq2T1UIaapY", "confirm": true, "amount_to_capture": 2540, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "customer_id": "StripeCustomer", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "request_external_three_ds_authentication": true, "phone_country_code": "+65", "description": "Its my first payment request", "authentication_type": "three_ds", "return_url": "https://google.com", "setup_future_usage": "on_session", "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "127.0.0.1" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } }, "routing": { "type": "single", "data": "nmi" }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" }, "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4000000000002370", "card_exp_month": "08", "card_exp_year": "25", "card_holder_name": "joseph Doe", "card_cvc": "999" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" } } }'

Screenshot 2025-07-29 at 6 40 54 PM

Step 2- Call /3ds/authentication via Netcetera

Curl

curl --location 'http://localhost:8080/payments/pay_1tQlG51BwoiUpLE3YKBV/3ds/authentication' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: pk_dev_8891a001315d40d0a26d1028ad51fe0b' \ --data '{ "client_secret": "pay_1tQlG51BwoiUpLE3YKBV_secret_EqDy0WeEHEfkkOjUd9R0", "device_channel": "BRW", "threeds_method_comp_ind": "Y" }'
Screenshot 2025-07-29 at 6 41 14 PM

Step 3- Call /authorize via Cybersource

curl --location --request POST 'http://localhost:8080/payments/pay_1tQlG51BwoiUpLE3YKBV/merchant_1753777600/authorize/cybersource' \ --header 'api-key: dev_TSUxfiSwiAelCPTr9xN2ValUdd1fvmeYg0AtMUwdJukRkTlCpHL9p2IWxn6fouYl'

Screenshot 2025-07-29 at 6 44 11 PM

specificationVersion and effectiveAuthenticationType are getting populated, and are sent to Cybersource_
Screenshot 2025-07-29 at 3 25 00 PM

Please note - Effective authentication type is FR, since the test flow is Frictionless

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@dgeee13 dgeee13 requested review from a team as code owners July 28, 2025 10:17
Copy link

semanticdiff-com bot commented Jul 28, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs  0% smaller
  crates/hyperswitch_domain_models/src/router_request_types.rs  0% smaller
  crates/router/src/core/payments/types.rs  0% smaller

@hyperswitch-bot hyperswitch-bot bot added the M-database-changes Metadata: This PR involves database schema changes label Jul 28, 2025
@dgeee13 dgeee13 force-pushed the cybersource3DSEnhancements branch from 6170e4f to 90e4bf7 Compare July 29, 2025 10:39
@hyperswitch-bot hyperswitch-bot bot removed the M-database-changes Metadata: This PR involves database schema changes label Jul 29, 2025
@dgeee13 dgeee13 changed the title feat(core): add fields to authentication table feat(connector): [cybersource] add changes for field CybersourceConsumerAuthInformation Jul 29, 2025
@dgeee13 dgeee13 self-assigned this Jul 29, 2025
@dgeee13 dgeee13 linked an issue Jul 29, 2025 that may be closed by this pull request
2 tasks
@dgeee13 dgeee13 linked an issue Jul 29, 2025 that may be closed by this pull request
2 tasks
@dgeee13 dgeee13 force-pushed the cybersource3DSEnhancements branch from cec6ae6 to 6630711 Compare July 30, 2025 08:08
@@ -1330,6 +1348,8 @@ impl
date_time::DateFormat::YYYYMMDDHHmmss,
)
.ok();
let effective_authentication_type = authn_data.authentication_type.map(Into::into);
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer using from instead of into

}

#[derive(Debug, Serialize)]
pub enum EffectiveAuthenticationType {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will parsing fail incase of unknown variant?

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jul 31, 2025
Merged via the queue into main with commit 6ff7575 Jul 31, 2025
16 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the cybersource3DSEnhancements branch July 31, 2025 09:51
pixincreate added a commit that referenced this pull request Aug 1, 2025
…rver

* 'main' of github.com:juspay/hyperswitch: (25 commits)
  chore: `xof` currency to cybersource cards (#8799)
  chore(version): 2025.08.01.0
  feat(core): Implement UCS based  upi for  paytm and phonepe (#8732)
  feat(connector): [katapult]add template code for katapult (#8783)
  feat(router): introduce `feature`  and `feature_data` to gsm (#7771)
  feat(connector): [cybersource] add changes for field CybersourceConsumerAuthInformation (#8768)
  feat(authentication): added authentication sync api (#8596)
  feat(connector): [facilitapay] fix refunds, add webhook and void support (#8778)
  feat(connector): [payload] add recurring payments (#8597)
  chore(version): 2025.07.31.0
  feat(connector): [Flexiti]Add support for flexiti connector  (#8743)
  chore(router): events enhancement for kafka (#8780)
  ci(cypress): Making a mandate payment with large customer user agents (#8790)
  fix(openapi): update create_platform endpoint in api-reference docs (#8782)
  chore(version): 2025.07.30.0
  fix(connector): [GLOBALPAY] Added Tokenization Flow for CITs (#8568)
  feat(routing): Add api-refs for new decision engine endpoints (#8709)
  fix: replace xtrim with xdel to support  older redis version (#8515)
  fix(connector): [Worldpay] handle multiple ddc submission for CompleteAuthorize (#8741)
  feat(connector): [Adyen] receive incoming webhooks for pix expiry (#8720)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Add changes for field CybersourceConsumerAuthInformation
5 participants