Skip to content

feat(core): Added Crypto and Mifinity Wallet PaymentMethod for Hyperswitch <> UCS Integration#10076

Merged
Gnanasundari24 merged 5 commits intomainfrom
hs_ucs_wallet_crypto_paymentmethod
Nov 6, 2025
Merged

feat(core): Added Crypto and Mifinity Wallet PaymentMethod for Hyperswitch <> UCS Integration#10076
Gnanasundari24 merged 5 commits intomainfrom
hs_ucs_wallet_crypto_paymentmethod

Conversation

@Shubhodip900
Copy link
Contributor

@Shubhodip900 Shubhodip900 commented Oct 31, 2025

Type of Change

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

Description

Added Crypto and Mifinity wallet PaymentMethod in HS <> UCS tunnel.

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?

Mifinity WalletType for Mifinity connector

1.Create Merchant Account

curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--header 'Cookie: _xsrf=2|5f10513e|c9bf94828a83e306e76b4e6135b30723|1761819532' \
--data-raw '{
  "merchant_id": "merchant_1762424369",
  "locker_id": "m0010",
  "merchant_name": "NewAge Retailer",
  "merchant_details": {
    "primary_contact_person": "John Test",
    "primary_email": "JohnTest@test.com",
    "primary_phone": "sunt laborum",
    "secondary_contact_person": "John Test2",
    "secondary_email": "JohnTest2@test.com",
    "secondary_phone": "cillum do dolor id",
    "website": "https://www.example.com",
    "about_business": "Online Retail with a wide selection of organic products for North America",
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "ER"
    }
  },
  "return_url": "https://google.com/success",
  "webhook_details": {
    "webhook_version": "1.0.1",
    "webhook_username": "ekart_retail",
    "webhook_password": "password_ekart@123",
    "payment_created_enabled": true,
    "payment_succeeded_enabled": true,
    "payment_failed_enabled": true
  },
  "sub_merchants_enabled": false,
  "metadata": {
    "city": "NY",
    "unit": "245"
  },
  "primary_business_details": [
    {
      "country": "US",
      "business": "default"
    }
  ]
}'
  1. Create API Key
curl --location 'http://localhost:8080/api_keys/merchant_1762424366' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--header 'Cookie: _xsrf=2|5f10513e|c9bf94828a83e306e76b4e6135b30723|1761819532' \
--data '{
    "name": "API Key 1",
    "description": null,
    "expiration": "2038-01-19T03:14:08.000Z"
}'
  1. Create MCA for Mifinity
curl --location 'http://localhost:8080/account/merchant_1762424366/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_FYjr3mRY8K73NkBRyf80GPiF3RH3e4C0wE11OpHCPUhRe3auak5JkvIa8xWaygxy' \
--header 'Cookie: _xsrf=2|5f10513e|c9bf94828a83e306e76b4e6135b30723|1761819532' \
--data '{
    "connector_type": "payment_processor",
    "connector_name": "mifinity",
    "connector_account_details": {
        "auth_type": "HeaderKey",
        "api_key": "_"
    },
    "test_mode": false,
    "disabled": false,
    "payment_methods_enabled": [
                 {
            "payment_method": "wallet",
            "payment_method_types": [
                {
                    "payment_method_type": "mifinity",
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "metadata": {
        "city": "NY",
        "unit": "245",
        "brand_id": "001",
        "destination_account_number": "5001000001223369"
    },
    "business_country": "US",
    "business_label": "default"
}'
  1. Enable HS <> UCS Payments:
curl --location 'http://localhost:8080/configs/' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--header 'x-tenant-id: public' \
--data '{
    "key": "ucs_rollout_config_merchant_1762424366_mifinity_wallet_Authorize_shadow",
    "value": "1"
}'
  1. Mifinity Payment Request:
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_FYjr3mRY8K73NkBRyf80GPiF3RH3e4C0wE11OpHCPUhRe3auak5JkvIa8xWaygxy' \
--header 'Cookie: _xsrf=2|5f10513e|c9bf94828a83e306e76b4e6135b30723|1761819532' \
--data-raw '
{
    "amount": 1000,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 1000,
    "customer_id": "StripeCustomer",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://www.google.com/",
    "payment_method": "wallet",
    "payment_method_type": "mifinity",
    "payment_method_data": {
        "wallet": {
            "mifinity": {
                "destination_account_number": "5001000001223369",
                "date_of_birth": "2001-10-16"
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "DE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "swangi@gmail.com"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "DE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z",
        "connector_meta_data": "{\"brand_id\":\"001\",\"destination_account_number\":\"5001000001223369\"}"
    }
}'

Response

{
    "payment_id": "pay_fhu5I4tU01yB2QT6v3ZM",
    "merchant_id": "merchant_1762424366",
    "status": "requires_customer_action",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "mifinity",
    "client_secret": "pay_fhu5I4tU01yB2QT6v3ZM_secret_XZwanYYwO04oCbNYx75n",
    "created": "2025-11-06T10:22:43.388Z",
    "currency": "EUR",
    "customer_id": "StripeCustomer",
    "customer": {
        "id": "StripeCustomer",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "DE",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe",
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "DE",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe",
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": "swangi@gmail.com"
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://www.google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_fhu5I4tU01yB2QT6v3ZM/merchant_1762424366/pay_fhu5I4tU01yB2QT6v3ZM_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "mifinity",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "StripeCustomer",
        "created_at": 1762424563,
        "expires": 1762428163,
        "secret": "epk_aee5d0ed81e34b04bc2d95e1000e0193"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "pay_fhu5I4tU01yB2QT6v3ZM_1",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true",
        "connector_meta_data": "{\"brand_id\":\"001\",\"destination_account_number\":\"5001000001223369\"}"
    },
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_fhu5I4tU01yB2QT6v3ZM_1",
    "payment_link": null,
    "profile_id": "pro_IJ5O8SJXAKWqWdf0P3zO",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_mrddeivgThRxOMkVopqe",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-11-06T10:37:43.388Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-11-06T10:22:44.651Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "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,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}

HS logs:
Screenshot 2025-11-06 at 3 59 59 PM

UCS logs:
Screenshot 2025-11-06 at 4 00 57 PM

Crypto payment method for Cryptopay:

1.Create Merchant Account:

curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--header 'Cookie: _xsrf=2|5f10513e|c9bf94828a83e306e76b4e6135b30723|1761819532' \
--data-raw '{
  "merchant_id": "merchant_1762424016",
  "locker_id": "m0010",
  "merchant_name": "NewAge Retailer",
  "merchant_details": {
    "primary_contact_person": "John Test",
    "primary_email": "JohnTest@test.com",
    "primary_phone": "sunt laborum",
    "secondary_contact_person": "John Test2",
    "secondary_email": "JohnTest2@test.com",
    "secondary_phone": "cillum do dolor id",
    "website": "https://www.example.com",
    "about_business": "Online Retail with a wide selection of organic products for North America",
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "ER"
    }
  },
  "return_url": "https://google.com/success",
  "webhook_details": {
    "webhook_version": "1.0.1",
    "webhook_username": "ekart_retail",
    "webhook_password": "password_ekart@123",
    "payment_created_enabled": true,
    "payment_succeeded_enabled": true,
    "payment_failed_enabled": true
  },
  "sub_merchants_enabled": false,
  "metadata": {
    "city": "NY",
    "unit": "245"
  },
  "primary_business_details": [
    {
      "country": "US",
      "business": "default"
    }
  ]
}'
  1. Create API Key:
curl --location 'http://localhost:8080/api_keys/merchant_1762423916' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--header 'Cookie: _xsrf=2|5f10513e|c9bf94828a83e306e76b4e6135b30723|1761819532' \
--data '{
    "name": "API Key 1",
    "description": null,
    "expiration": "2038-01-19T03:14:08.000Z"
}'
  1. Create MCA for Cryptopay
curl --location 'http://localhost:8080/account/merchant_1762423916/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_r8wd5ij5H4CLD3YOFBIJsGKnkn0C8cON8ovVMJhlMEHPGoVZqmCCAxN54fcJZSDg' \
--header 'Cookie: _xsrf=2|5f10513e|c9bf94828a83e306e76b4e6135b30723|1761819532' \
--data '{
    "connector_type": "payment_processor",
    "connector_account_details": {
        "auth_type": "BodyKey",
        "api_key":"_",
        "key1":"_"
    },
    "connector_name": "cryptopay",
    "test_mode": true,
    "disabled": false,
    "payment_methods_enabled": [
        {
            "payment_method": "crypto",
            "payment_method_types": [
                {
                    "payment_method_type": "crypto_currency",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "connector_webhook_details": {
        "merchant_secret": "_"
    },
    "business_country": "US",
    "business_label": "default"
}'
  1. Enable HS <> UCS Payments:
curl --location 'http://localhost:8080/configs/' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--header 'x-tenant-id: public' \
--data '{
    "key": "ucs_rollout_config_merchant_1762423916_cryptopay_crypto_Authorize_shadow",
    "value": "1"
}'
  1. Crypto Payment Request:
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_r8wd5ij5H4CLD3YOFBIJsGKnkn0C8cON8ovVMJhlMEHPGoVZqmCCAxN54fcJZSDg' \
--header 'Cookie: _xsrf=2|5f10513e|c9bf94828a83e306e76b4e6135b30723|1761819532' \
--data-raw '
{
    "amount": 15,
    "currency": "USD",
    "confirm": true,
    "email": "guest@example.com",
    "return_url": "https://google.com",
    "payment_method": "crypto",
    "payment_method_type": "crypto_currency",
    "payment_experience": "redirect_to_url",
    "capture_method": "automatic",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC"
        }
    }
}'

Response

{
    "payment_id": "pay_13dax2tSGbNjZsQfbyTk",
    "merchant_id": "merchant_1762423916",
    "status": "requires_customer_action",
    "amount": 15,
    "net_amount": 15,
    "shipping_cost": null,
    "amount_capturable": 15,
    "amount_received": null,
    "connector": "cryptopay",
    "client_secret": "pay_13dax2tSGbNjZsQfbyTk_secret_xIMjf50EWA2Hp1VnZA53",
    "created": "2025-11-06T10:12:36.748Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC",
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_13dax2tSGbNjZsQfbyTk/merchant_1762423916/pay_13dax2tSGbNjZsQfbyTk_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "946d598f-059a-43de-89d1-03699abd9bfd",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_13dax2tSGbNjZsQfbyTk_1",
    "payment_link": null,
    "profile_id": "pro_rpKnc8nDXIXiuSLj7MdG",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_l8Y53Joz2K4knbJdtkQD",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-11-06T10:27:36.747Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-11-06T10:12:38.309Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "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,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}

HS logs:
Screenshot 2025-11-06 at 3 47 18 PM

UCS logs:
Screenshot 2025-11-06 at 3 48 19 PM

Tested using Diff checker:

  1. Mifinity
Screenshot 2025-10-31 at 4 46 46 PM
  1. Cryptopay
Screenshot 2025-10-31 at 4 47 42 PM

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

@Shubhodip900 Shubhodip900 requested a review from a team as a code owner October 31, 2025 09:12
@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 31, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/unified_connector_service.rs  11% smaller

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

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

Files with missing lines Patch % Lines
...rates/router/src/core/unified_connector_service.rs 0.00% 26 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10076   +/-   ##
=======================================
  Coverage        ?    3.91%           
=======================================
  Files           ?     1223           
  Lines           ?   301743           
  Branches        ?        0           
=======================================
  Hits            ?    11803           
  Misses          ?   289940           
  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.

@Shubhodip900 Shubhodip900 self-assigned this Oct 31, 2025
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit 7f350f0 Nov 6, 2025
45 of 47 checks passed
@Gnanasundari24 Gnanasundari24 deleted the hs_ucs_wallet_crypto_paymentmethod branch November 6, 2025 13:58
aadityaguptaa pushed a commit that referenced this pull request Nov 10, 2025
…witch <> UCS Integration (#10076)

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] Crypto & Mifinity Wallet PaymentMethod for Hyperswitch <> UCS Integration

4 participants