Skip to content

feat: Added HS<>UCS create_connector_customer flow support and populated router_data fields received from UCS#9984

Merged
bernard-eugine merged 27 commits intomainfrom
ucs-authorizedotnet-fix
Oct 29, 2025
Merged

feat: Added HS<>UCS create_connector_customer flow support and populated router_data fields received from UCS#9984
bernard-eugine merged 27 commits intomainfrom
ucs-authorizedotnet-fix

Conversation

@AmitsinghTanwar007
Copy link
Contributor

@AmitsinghTanwar007 AmitsinghTanwar007 commented Oct 24, 2025

Type of Change

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

Description

Added support for the create_connector_customer flow for UCS in v1, and populated additional fields such as connector_response and connector_metadata in router_data for improved data consistency.

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?

tested it using diff checker

  1. Request Diff
Screenshot 2025-10-24 at 5 16 47 PM
  1. RouterData diff
Screenshot 2025-10-24 at 5 17 13 PM

Authorize Flow

Authorize Request
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ' \
--header 'Cookie: _xsrf=' \
--data-raw '{
    "amount": 6540,
    "currency": "USD",
    "amount_to_capture": 6540,
    "confirm": true,
    "profile_id": "pro_Usujx8sGKZ1OjWLUeGLS",
    "capture_method": "automatic",
    "authentication_type": "no_three_ds",
    "setup_future_usage": "off_session",
    "customer": {
        "id": "customer123w9ryuwuryweiuyrewiuhi", //need to updated for create_connector_customer flow
        "name": "John Doe",
        "email": "customernew@gmail.com",//need to updated for create_connector_customer flow
        "phone": "9999999999",
        "phone_country_code": "+1"
    },
    "customer_id": "customer123w9ryuwuryweiuyrewiuhi",//need to updated for create_connector_customer flow
    "phone_country_code": "+1",
    "routing": {
        "type": "single",
        "data": "authorizedotnet"
    },
    "description": "Its my first payment request",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_holder_name": "Joseph Doe",
            "card_number": "5123456789012346",
            "card_exp_month": "03",
            "card_exp_year": "2030",
            "card_cvc": "100",
            "card_network": "Visa"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest44@example.com"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "guest44@example.com"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 6540,
            "account_name": "transaction_processing"
        }
    ],
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "browser_info": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;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": "128.0.0.1"
    },
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "125.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    "connector_metadata": {
        "noon": {
            "order_category": "pay"
        }
    },
    "payment_link": false,
    "payment_type": "normal",
    "request_incremental_authorization": false,
    "merchant_order_reference_id": "testing_the_integ03454",
    "all_keys_required": true,
    "session_expiry": 900
}'
Authorize Response
{
    "payment_id": "pay_nGxyofcByR45vSXqtxcw",
    "merchant_id": "merchant_1761124451",
    "status": "succeeded",
    "amount": 6540,
    "net_amount": 6540,
    "connector": "authorizedotnet",
    "client_secret": "pay_nGxyofcByR45vSXqtxcw_secret_uDqnVxhyI4Mvubh6tkak",
    "currency": "USD",
    "customer_id": "customer123w9ryuwuryweiuyrewiuhi",
    "description": "Its my first payment request",
    "capture_method": "automatic",
    "payment_method": "card",
    "connector_transaction_id": "120073086322",
    "network_transaction_id": "WC001WNXVWT1BHW7ICMFA44",
    "merchant_order_reference_id": "testing_the_integ03454",
    "connector_mandate_id": "933135702-932436342",
    "feature_metadata": {
        "gateway_system": "direct"
    },
    "connector_metadata": {
        "noon": {
            "order_category": "pay"
        }
    },
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 6540
        }
    ],
    "ephemeral_key": {
        "customer_id": "customer123w9ryuwuryweiuyrewiuhi",
        "created_at": 1761306340,
        "expires": 1761309940,
        "secret": "epk_5329d1ef7bfc4c21a17d689167caa98a"
    },
    "whole_connector_response": "{\"transactionResponse\":{\"responseCode\":\"1\",\"authCode\":\"19RFGL\",\"avsResultCode\":\"Y\",\"cvvResultCode\":\"P\",\"transId\":\"120073086322\",\"messages\":[{\"code\":\"1\",\"description\":\"This transaction has been approved.\"}]}}"
}

To make a call for create_connector_customer you have to update the customer id and email

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

@AmitsinghTanwar007 AmitsinghTanwar007 requested review from a team as code owners October 24, 2025 11:56
@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 24, 2025

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 0% with 209 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@d6bbdde). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...rates/router/src/core/unified_connector_service.rs 0.00% 62 Missing ⚠️
...src/core/unified_connector_service/transformers.rs 0.00% 58 Missing ⚠️
...aces/src/unified_connector_service/transformers.rs 0.00% 49 Missing ⚠️
...s/router/src/core/payments/flows/authorize_flow.rs 0.00% 24 Missing ⚠️
...uter/src/core/payments/flows/setup_mandate_flow.rs 0.00% 13 Missing ⚠️
...ter/src/core/payments/flows/external_proxy_flow.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9984   +/-   ##
=======================================
  Coverage        ?    3.92%           
=======================================
  Files           ?     1223           
  Lines           ?   300443           
  Branches        ?        0           
=======================================
  Hits            ?    11798           
  Misses          ?   288645           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AmitsinghTanwar007 AmitsinghTanwar007 linked an issue Oct 24, 2025 that may be closed by this pull request
2 tasks
@AmitsinghTanwar007 AmitsinghTanwar007 requested a review from a team as a code owner October 24, 2025 13:53
@AmitsinghTanwar007 AmitsinghTanwar007 removed the request for review from a team October 24, 2025 14:05
.clone();

// Calculate connector_label before cloning data for shadow UCS
let unified_connector_service_connector_label =
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should call fn process_through_ucs instead of execute_shadow_unified_connector_service_call. So that any changes done in ucs flow will be reflected in shadow more as well.

hrithikesh026
hrithikesh026 previously approved these changes Oct 29, 2025
@bernard-eugine bernard-eugine added this pull request to the merge queue Oct 29, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 29, 2025
@bernard-eugine bernard-eugine added this pull request to the merge queue Oct 29, 2025
Merged via the queue into main with commit 8245838 Oct 29, 2025
25 of 27 checks passed
@bernard-eugine bernard-eugine deleted the ucs-authorizedotnet-fix branch October 29, 2025 12:14
aadityaguptaa pushed a commit that referenced this pull request Nov 10, 2025
…ted router_data fields received from UCS (#9984)

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.

[FEATURE] Support for Create Connector Customer flow is needed in UCS

4 participants