Skip to content

feat(core): Hyperswitch <|> UCS Mandate flow integration#8738

Merged
Gnanasundari24 merged 7 commits intomainfrom
ucs-mandate-integration
Jul 28, 2025
Merged

feat(core): Hyperswitch <|> UCS Mandate flow integration#8738
Gnanasundari24 merged 7 commits intomainfrom
ucs-mandate-integration

Conversation

@Aishwariyaa-Anand
Copy link
Contributor

@Aishwariyaa-Anand Aishwariyaa-Anand commented Jul 23, 2025

Type of Change

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

Description

This PR implements UCS(Unified Connector Service) Integration for SetupMandate and RepeatEverything (recurring payment) flows.

  • Updated rust-grpc-client dependency to main branch
  • Added log for Successful UCS connection

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?

Create Intent for Zero mandate

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: _' \
--data '
{
  "amount": 0,
  "confirm": false,
  "currency": "USD",
  "customer_id": "Customer123",
  "setup_future_usage": "off_session"
}'

Confirm CIT (Authorisedotnet via UCS)

curl --location 'http://localhost:8080/payments/pay_YbaKZHAfIRvsnGpeuOcH/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: _' \
--data-raw '{
    "confirm": true,
    "customer_id": "Customer123",
    "payment_type": "setup_mandate",
    "customer_acceptance": {
        "acceptance_type": "online",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "127.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method": "card",
    "payment_method_type": "credit",
    "email": "test@novalnet.de",
    "payment_method_data": {
        "card": {
            "card_number": "4349940199004549",
            "card_exp_month": "12",
            "card_exp_year": "30",
            "card_holder_name": "joseph Doe",
            "card_cvc": "396",
            "card_network": "VISA"
        },
        "billing": {
            "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "IT",
            "first_name": "joseph",
            "last_name": "Doe"
        },
            "email": "test@novalnet.de",
            "phone": {
                "number": "8056594427",
                "country_code": "+91"
            }
        }
    },
    "all_keys_required": true
}'

Response

{
    "payment_id": "pay_2d7OcbcSgKUrkt4ETxYP",
    "merchant_id": "merchant_1753280085",
    "status": "succeeded",
    "amount": 0,
    "net_amount": 0,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "authorizedotnet",
    "client_secret": "pay_2d7OcbcSgKUrkt4ETxYP_secret_fLFQbtHQWQGORcgUtr4l",
    "created": "2025-07-23T14:57:40.169Z",
    "currency": "USD",
    "customer_id": "Customer123",
    "customer": {
        "id": "Customer123",
        "name": null,
        "email": "test@novalnet.de",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": null,
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "4549",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "434994",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "30",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": {
                "city": "San Fransico",
                "country": "IT",
                "line1": "1467",
                "line2": "Harrison Street",
                "line3": "Harrison Street",
                "zip": "94122",
                "state": "California",
                "first_name": "joseph",
                "last_name": "Doe"
            },
            "phone": {
                "number": "8056594427",
                "country_code": "+91"
            },
            "email": "test@novalnet.de"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "test@novalnet.de",
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "523966074",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_0UBAnCbAThEENJj9KfZ0",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_XVTNsN4D9kHGw3DxkEP0",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-23T15:12:40.168Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": null,
        "language": null,
        "time_zone": null,
        "ip_address": "::1",
        "os_version": null,
        "user_agent": null,
        "color_depth": null,
        "device_model": null,
        "java_enabled": null,
        "screen_width": null,
        "accept_header": null,
        "screen_height": null,
        "accept_language": "en",
        "java_script_enabled": null
    },
    "payment_method_id": "pm_tSOU7aOBhgKLBE92628X",
    "payment_method_status": "active",
    "updated": "2025-07-23T14:58:20.071Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "523966074-536113445",
    "card_discovery": "manual",
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null
}

Card recurring payment (Authorizedotnet via UCS)

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_dAANSmNFGJ0ppE3KkF0NaFYdWmHDQReivo4zXuzWPPvMae7TSIRPRus6hDyNDTGt' \
--data '{
    "amount": 100,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "customer_id": "Customer123",
    "off_session": true,
    "recurring_details": {
        "type": "payment_method_id",
        "data": "pm_Ca7e4nuk9S8z1S7ksaF6"
    }
}'

Response

{
    "payment_id": "pay_YbaKZHAfIRvsnGpeuOcH",
    "merchant_id": "merchant_1753280085",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "authorizedotnet",
    "client_secret": "pay_YbaKZHAfIRvsnGpeuOcH_secret_hTmFPsa4amP6XdXG6g9d",
    "created": "2025-07-23T14:58:39.835Z",
    "currency": "USD",
    "customer_id": "Customer123",
    "customer": {
        "id": "Customer123",
        "name": null,
        "email": "test@novalnet.de",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": true,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "4549",
            "card_type": null,
            "card_network": "Visa",
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "434994",
            "card_extended_bin": null,
            "card_exp_month": "12",
            "card_exp_year": "30",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "test@novalnet.de",
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "Customer123",
        "created_at": 1753282719,
        "expires": 1753286319,
        "secret": "epk_fd17c36b38584f0488578d1335542cbe"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "80042797687",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_0UBAnCbAThEENJj9KfZ0",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_XVTNsN4D9kHGw3DxkEP0",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-23T15:13:39.835Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_Ca7e4nuk9S8z1S7ksaF6",
    "payment_method_status": "active",
    "updated": "2025-07-23T14:58:40.816Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": "523965707-536113051",
    "card_discovery": "manual",
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null
}

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

@Aishwariyaa-Anand Aishwariyaa-Anand self-assigned this Jul 23, 2025
@Aishwariyaa-Anand Aishwariyaa-Anand requested review from a team as code owners July 23, 2025 14:43
@Aishwariyaa-Anand Aishwariyaa-Anand added A-core Area: Core flows A-mandates Area: Mandate Flows labels Jul 23, 2025
@semanticdiff-com
Copy link

semanticdiff-com bot commented Jul 23, 2025

@Aishwariyaa-Anand Aishwariyaa-Anand linked an issue Jul 23, 2025 that may be closed by this pull request
jarnura
jarnura previously approved these changes Jul 25, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jul 28, 2025
Merged via the queue into main with commit f94f39e Jul 28, 2025
16 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the ucs-mandate-integration branch July 28, 2025 08:00
pixincreate added a commit that referenced this pull request Jul 28, 2025
…rver

* 'main' of github.com:juspay/hyperswitch: (24 commits)
  chore(version): 2025.07.28.1
  feat(core): Hyperswitch <|> UCS Mandate flow integration (#8738)
  feat(themes): Create user APIs for managing themes (#8387)
  chore: update devDependencies for cypress (#8735)
  refactor: Add routing_approach other variant to handle unknown data (#8754)
  chore(version): 2025.07.28.0
  refactor(connector): [facilitapay] move destination bank account number to connector metadata (#8704)
  feat(recovery-events): add revenue recovery topic and vector config to push these events to s3 (#8285)
  ci(cypress): add authorizedotnet connector (#8688)
  refactor(schema): add a new column for storing large customer user agents in mandate table (#8616)
  feat(authentication): add authentication api for modular authentication (#8459)
  feat(connector): [MPGS] template code (#8544)
  fix(chat): append request id to headers for chat request (#8680)
  feat(connector): [Flexiti]template code for flexiti connector (#8714)
  chore(version): 2025.07.25.0
  feat(core): Consuming locale in PaymentsAuthorizeData from SessionState (#8731)
  fix(payment-methods): fetch payment method details in payouts flow (#8729)
  refactor(core): remove hardcoded timeout limit of 5s for outgoing webhook requests (#8725)
  feat(connector): [Breadpay]Add support for Breadpay connector (#8676)
  fix(feature_matrix): refunds are supported by jpmorgan (#8699)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-core Area: Core flows A-mandates Area: Mandate Flows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Hyperswitch <|> UCS Mandate flow integration

4 participants