Skip to content

feat(ucs): Add UCS authentication and post-authentication flows for payment processing#9959

Merged
bernard-eugine merged 62 commits intomainfrom
call-ucs-for-auth-post-auth-in-completeauthorize
Oct 30, 2025
Merged

feat(ucs): Add UCS authentication and post-authentication flows for payment processing#9959
bernard-eugine merged 62 commits intomainfrom
call-ucs-for-auth-post-auth-in-completeauthorize

Conversation

@hrithikesh026
Copy link
Contributor

@hrithikesh026 hrithikesh026 commented Oct 23, 2025

Type of Change

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

Description

This PR introduces comprehensive support for Unified Connector Service (UCS) authentication and post-authentication flows in the payment processing pipeline. The changes enable seamless integration with UCS for handling payment authentication workflows, particularly for connectors like Cybersource that require multi-step authentication processes.

Key Changes:

  1. New gRPC Client Methods:

    • Added payment_authenticate() method in UnifiedConnectorServiceClient
    • Added payment_post_authenticate() method in UnifiedConnectorServiceClient
    • Enhanced error handling with specific error types for authentication failures
  2. Authentication Flow Implementation:

    • Implemented call_unified_connector_service_authenticate() function for handling authentication requests
    • Implemented call_unified_connector_service_post_authenticate() function for handling post-authentication requests
    • Added response transformation logic for authentication flows
  3. Complete Authorize Flow Enhancement:

    • Enhanced handle_preprocessing_through_unified_connector_service() to support Authenticate and PostAuthenticate flows
    • Added proper data type conversion between CompleteAuthorize and authentication flows
    • Implemented response transformation for Cybersource-specific authentication scenarios
  4. Data Structure Updates:

    • Updated PaymentsPostAuthenticateData to remove redundant fields and improve type safety
    • Added Clone derive to LineageIds struct for better handling in async contexts
    • Enhanced type exports in router types module
  5. Response Transformation:

    • Added specialized response transformers for Cybersource authentication flows
    • Implemented CybersourceAuthSetup and CybersourceConsumerAuth redirect form types
    • Enhanced error handling and logging for authentication failures
  6. UCS Integration:

    • Added new response handlers for authentication and post-authentication responses
    • Implemented gRPC request transformers for authentication flows
    • Enhanced metadata handling and header construction for UCS calls

Additional Changes

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

Motivation and Context

This change is required to enable proper integration with the Unified Connector Service for payment authentication workflows. Many modern payment processors, particularly Cybersource, require multi-step authentication processes that involve:

  1. Initial authentication setup
  2. Consumer authentication challenges
  3. Post-authentication processing

The existing UCS integration only supported pre-authentication and authorization flows, leaving a gap in handling the complete authentication lifecycle. This PR fills that gap by providing:

  • Full authentication flow support through UCS
  • Proper data transformation between different flow types
  • Enhanced error handling and logging
  • Connector-specific response transformations

This enables merchants to use connectors with complex authentication requirements while maintaining a consistent interface through the UCS abstraction layer.

How did you test it?

The changes were tested through:

Cannot be tested end to end since UCS changes are still pending.

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

hrithikesh026 and others added 30 commits October 13, 2025 11:31
Merge remote-tracking branch 'origin/main' into introduce-new-decide-flow
…introduce-new-decide-flow-complete-authorize
Base automatically changed from call-ucs-for-pre-authentication-in-authorize to main October 29, 2025 05:17
@bernard-eugine bernard-eugine requested a review from a team as a code owner October 29, 2025 05:17
@hrithikesh026 hrithikesh026 changed the title feat(ucs): call authentication or post authentication during complete authorize preprocessing as per connector feat(ucs): Add UCS authentication and post-authentication flows for payment processing Oct 29, 2025
@bernard-eugine bernard-eugine added this pull request to the merge queue Oct 30, 2025
Merged via the queue into main with commit 558f60b Oct 30, 2025
29 of 31 checks passed
@bernard-eugine bernard-eugine deleted the call-ucs-for-auth-post-auth-in-completeauthorize branch October 30, 2025 14:15
aadityaguptaa pushed a commit that referenced this pull request Nov 10, 2025
…ayment processing (#9959)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
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.

4 participants