Skip to content

Conversation

@srujanchikke
Copy link
Contributor

@srujanchikke srujanchikke commented Feb 4, 2026

Type of Change

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

Description

Integrate Cybersource decision manager (FRM processor)

Flow supported and integrated
FRM checkout flow (Pre frm call)
FRM transaction flow (Pre frm action marking flow)

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 merchant account :
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
 "merchant_id": "merchant_1770196098",
 "merchant_name": "NewAge Retailer",
 "return_url": "https://chrome.google.com/",
 "enable_payment_response_hash": false,
 "payment_response_hash_key": null,
 "redirect_to_merchant_with_http_post": false,
 "merchant_details": {
   "primary_contact_person": "joseph Test",
   "primary_phone": "veniam aute officia ullamco esse",
   "primary_email": "josephTest@test.com",
   "secondary_contact_person": "joseph Test2",
   "secondary_phone": "proident adipisicing officia nulla",
   "secondary_email": "josephTest2@test.com",
   "website": "https://www.example.com",
   "about_business": "Online Retail with a wide selection of organic products for North America",
   "address": {
     "city": "San Fransico",
     "country": null,
     "line1": "1467",
     "line2": "Harrison Street",
     "line3": "Harrison Street",
     "zip": "94122",
     "state": "California",
     "first_name": null,
     "last_name": null
   }
 },
 "webhook_details": {
   "webhook_version": "1.0.1",
   "webhook_username": "ekart_retail",
   "webhook_password": "password_ekart@123",
   "webhook_url": "https://en8ftqkhk5jyx.x.pipedream.net/",
   "payment_created_enabled": true,
   "payment_succeeded_enabled": true,
   "payment_failed_enabled": true
 },
 "payout_routing_algorithm": null,
 "sub_merchants_enabled": false,
 "parent_merchant_id": null,
 "publishable_key": "pk_snd_3b33cd9404234113804aa1accaabe22f",
 "metadata": {
   "city": "NY",
   "unit": "245"
 },
 "locker_id": "m0010",
 "primary_business_details": [
   {
     "country": "US",
     "business": "default"
   }
 ],
 "frm_routing_algorithm": {
     "type": "single",
     "data": "cybersourcedecisionmanager"
 },
 "organization_id": null
}'
  • create api key
  • create payment connector
  • create frm connector :
curl --location 'http://localhost:8080/account/merchant_1770180546/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_epUf6ysURuPHliLKE2RAmVl9hU9lUXlgg03c0ns0tnuwGIbDjnYEi8pMJoG4acAL' \
--data '{
    "connector_type": "payment_vas",
    "connector_name": "cybersourcedecisionmanager",
    "connector_account_details": {
        "auth_type": "SignatureKey",
        "api_key": "api-key",
        "key1": "merchant_name",
        "api_secret": "shared secret key"
    },
    "test_mode": false,
    "disabled": false,
    "business_country": "US",
    "business_label": "default",,
    "metadata": {
        "city": "NY",
        "unit": "245"
    },
     "frm_configs": [
        {
            "gateway": "stripe",
            "payment_methods": [
                {
                    
                    "payment_method": "card",
                    "flow" : "pre"
                }
            ]
        }
    ]
}'

Pre FRM Accept Flow :
create a payment

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_epUf6ysURuPHliLKE2RAmVl9hU9lUXlgg03c0ns0tnuwGIbDjnYEi8pMJoG4acAL' \
--data '{
    "amount": 6200000,
    "currency": "USD",
    "confirm": true,
    "payment_link":false,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 6200000,
    "customer_id": "StripeCustomer2",
    "name": "Bob Smith",
    "phone": "999999999",
    "phone_country_code": "+91",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type":"credit",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "10",
            "card_exp_year": "26",
            "card_holder_name": "bob",
            "card_cvc": "123"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "fraud Street",
            "line3": "fraud Street",
            "city": "San fraud",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "first",
            "last_name": "last"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "31 Sherwood Gardens",
            "line3": "31 Sherwood Gardens",
            "city": "London",
            "state": "Manchester",
            "zip": "E14 9wn",
            "country": "US",
            "first_name": "first",
            "last_name": "last"
        },
        "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"
    },
    "order_details": [
        {
            "product_name": "gillete creme",
            "quantity": 2,
            "amount": 600,
            "product_id": "",
            "category": "clothes",
            "sub_category": "tees",
            "product_type": "digital"
        },
        {
            "product_name": "fake",
            "quantity": 1000,
            "amount": 300,
            "product_id": "",
            "category": "shoes",
            "sub_category": "jordans",
            "product_type": "physical"
        }
    ],
    "frm_metadata": {
        "fulfillment_method": "delivery",
        "coverage_request": "fraud",
        "total_shipping_cost": 240,
        "order_channel": "web",
        "vendor_name": "srujan",
        "shipping_lines": [
            {
                "price": "240",
                "title": "customer"
            }
        ]
    }
}
'

response : FRM status should be legit ,

{
    "payment_id": "pay_khHLYp7E4c3cXxAKSYCD",
    "merchant_id": "merchant_1770180546",
    "status": "succeeded",
    "amount": 6200000,
    "net_amount": 6200000,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 6200000,
    "processor_merchant_id": "merchant_1770180546",
    "initiator": null,
    "sdk_authorization": "cHJvZmlsZV9pZD1wcm9feGpOZzFhdmtaSUhNaHpIVnJCaWMscHVibGlzaGFibGVfa2V5PXBrX2Rldl8zYjc2NWFkZmZjNTc0MzUyYTU4YjgyNTA1MmFlYmU5OSxjbGllbnRfc2VjcmV0PXBheV9raEhMWXA3RTRjM2NYeEFLU1lDRF9zZWNyZXRfZTc5aGZmZWRCZTZVZzZZdHZrMTIsY3VzdG9tZXJfaWQ9U3RyaXBlQ3VzdG9tZXIy",
    "connector": "stripe",
    "client_secret": "pay_khHLYp7E4c3cXxAKSYCD_secret_e79hffedBe6Ug6Ytvk12",
    "created": "2026-02-04T09:11:05.512Z",
    "modified_at": "2026-02-04T09:11:08.164Z",
    "currency": "USD",
    "customer_id": "StripeCustomer2",
    "customer": {
        "id": "StripeCustomer2",
        "name": "Bob Smith",
        "email": "abc@gmail.com",
        "phone": "999999999",
        "phone_country_code": "+91"
    },
    "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": "card",
    "payment_method_data": {
        "card": {
            "last4": "4242",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "424242",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "26",
            "card_holder_name": "bob",
            "payment_checks": {
                "cvc_check": "pass",
                "address_line1_check": "pass",
                "address_postal_code_check": "pass"
            },
            "authentication_data": null,
            "auth_code": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "London",
            "country": "US",
            "line1": "1467",
            "line2": "31 Sherwood Gardens",
            "line3": "31 Sherwood Gardens",
            "zip": "E14 9wn",
            "state": "Manchester",
            "first_name": "first",
            "last_name": "last",
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San fraud",
            "country": "US",
            "line1": "1467",
            "line2": "fraud Street",
            "line3": "fraud Street",
            "zip": "94122",
            "state": "California",
            "first_name": "first",
            "last_name": "last",
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": [
        {
            "sku": null,
            "upc": null,
            "brand": null,
            "amount": 600,
            "category": "clothes",
            "quantity": 2,
            "tax_rate": null,
            "product_id": "",
            "description": null,
            "product_name": "gillete creme",
            "product_type": "digital",
            "sub_category": "tees",
            "total_amount": null,
            "commodity_code": null,
            "unit_of_measure": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null,
            "unit_discount_amount": null
        },
        {
            "sku": null,
            "upc": null,
            "brand": null,
            "amount": 300,
            "category": "shoes",
            "quantity": 1000,
            "tax_rate": null,
            "product_id": "",
            "description": null,
            "product_name": "fake",
            "product_type": "physical",
            "sub_category": "jordans",
            "total_amount": null,
            "commodity_code": null,
            "unit_of_measure": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null,
            "unit_discount_amount": null
        }
    ],
    "email": "abc@gmail.com",
    "name": "Bob Smith",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "error_details": 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,
    "manual_retry_allowed": null,
    "connector_transaction_id": "pi_3Sx275D5R7gDAGff18bM0sU5",
    "frm_message": {
        "frm_name": "cybersourcedecisionmanager",
        "frm_transaction_id": "7701962664526848504807",
        "frm_transaction_type": "pre_frm",
        "frm_status": "legit",
        "frm_score": null,
        "frm_reason": null,
        "frm_error": null
    },
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pi_3Sx275D5R7gDAGff18bM0sU5",
    "payment_link": null,
    "profile_id": "pro_xjNg1avkZIHMhzHVrBic",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_0Y9FKJvuzRZlg74jDbl5",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2026-02-04T09:26:05.511Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": "104557651805572",
    "payment_method_status": null,
    "updated": "2026-02-04T09:11:08.164Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": false,
    "extended_authorization_last_applied_at": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "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,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": false,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null,
    "billing_descriptor": null,
    "tokenization": null,
    "partner_merchant_identifier_details": null,
    "payment_method_tokenization_details": null
}

Pre FRM Reject Flow :
Configure rules in cybersource riskmanagement dashboard.
Screenshot 2026-02-04 at 2 37 30 PM

  • create a payment (same request as above)
  • response : Frm status will be fraud with frm reason from cybersource decision manager.
{
    "payment_id": "pay_XMqeaLueLhozKfg801TD",
    "merchant_id": "merchant_1770180546",
    "status": "failed",
    "amount": 6200000,
    "net_amount": 6200000,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "processor_merchant_id": "merchant_1770180546",
    "initiator": null,
    "sdk_authorization": "cHJvZmlsZV9pZD1wcm9feGpOZzFhdmtaSUhNaHpIVnJCaWMscHVibGlzaGFibGVfa2V5PXBrX2Rldl8zYjc2NWFkZmZjNTc0MzUyYTU4YjgyNTA1MmFlYmU5OSxjbGllbnRfc2VjcmV0PXBheV9YTXFlYUx1ZUxob3pLZmc4MDFURF9zZWNyZXRfcldNU2FtNGQ3SWM3cWtwMmNHTFosY3VzdG9tZXJfaWQ9U3RyaXBlQ3VzdG9tZXIy",
    "connector": "stripe",
    "client_secret": "pay_XMqeaLueLhozKfg801TD_secret_rWMSam4d7Ic7qkp2cGLZ",
    "created": "2026-02-04T09:13:16.653Z",
    "modified_at": "2026-02-04T09:13:18.150Z",
    "currency": "USD",
    "customer_id": "StripeCustomer2",
    "customer": {
        "id": "StripeCustomer2",
        "name": "Bob Smith",
        "email": "abc@gmail.com",
        "phone": "999999999",
        "phone_country_code": "+91"
    },
    "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": "card",
    "payment_method_data": {
        "card": {
            "last4": "4242",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "424242",
            "card_extended_bin": null,
            "card_exp_month": "10",
            "card_exp_year": "26",
            "card_holder_name": "bob",
            "payment_checks": null,
            "authentication_data": null,
            "auth_code": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "London",
            "country": "US",
            "line1": "1467",
            "line2": "31 Sherwood Gardens",
            "line3": "31 Sherwood Gardens",
            "zip": "E14 9wn",
            "state": "Manchester",
            "first_name": "first",
            "last_name": "last",
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San fraud",
            "country": "US",
            "line1": "1467",
            "line2": "fraud Street",
            "line3": "fraud Street",
            "zip": "94122",
            "state": "California",
            "first_name": "first",
            "last_name": "last",
            "origin_zip": null
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": [
        {
            "sku": null,
            "upc": null,
            "brand": null,
            "amount": 600,
            "category": "clothes",
            "quantity": 2,
            "tax_rate": null,
            "product_id": "",
            "description": null,
            "product_name": "gillete creme",
            "product_type": "digital",
            "sub_category": "tees",
            "total_amount": null,
            "commodity_code": null,
            "unit_of_measure": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null,
            "unit_discount_amount": null
        },
        {
            "sku": null,
            "upc": null,
            "brand": null,
            "amount": 300,
            "category": "shoes",
            "quantity": 1000,
            "tax_rate": null,
            "product_id": "",
            "description": null,
            "product_name": "fake",
            "product_type": "physical",
            "sub_category": "jordans",
            "total_amount": null,
            "commodity_code": null,
            "unit_of_measure": null,
            "product_img_link": null,
            "product_tax_code": null,
            "total_tax_amount": null,
            "requires_shipping": null,
            "unit_discount_amount": null
        }
    ],
    "email": "abc@gmail.com",
    "name": "Bob Smith",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": "fraud",
    "error_message": "\"DECISION_PROFILE_REJECT\"",
    "unified_code": null,
    "unified_message": null,
    "error_details": 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,
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": {
        "frm_name": "cybersourcedecisionmanager",
        "frm_transaction_id": "7701963976646150704806",
        "frm_transaction_type": "pre_frm",
        "frm_status": "fraud",
        "frm_score": null,
        "frm_reason": "DECISION_PROFILE_REJECT",
        "frm_error": null
    },
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_xjNg1avkZIHMhzHVrBic",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_0Y9FKJvuzRZlg74jDbl5",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2026-02-04T09:28:16.653Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2026-02-04T09:13:18.150Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "extended_authorization_last_applied_at": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "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,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null,
    "billing_descriptor": null,
    "tokenization": null,
    "partner_merchant_identifier_details": null,
    "payment_method_tokenization_details": 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

@srujanchikke srujanchikke self-assigned this Feb 4, 2026
@srujanchikke srujanchikke added the A-connector-integration Area: Connector integration label Feb 4, 2026
@semanticdiff-com
Copy link

semanticdiff-com bot commented Feb 4, 2026

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Feb 4, 2026
@srujanchikke srujanchikke marked this pull request as ready for review February 4, 2026 08:20
@srujanchikke srujanchikke requested review from a team as code owners February 4, 2026 08:20
deepanshu-iiitu
deepanshu-iiitu previously approved these changes Feb 4, 2026
kashif-m
kashif-m previously approved these changes Feb 4, 2026
kashif-m
kashif-m previously approved these changes Feb 4, 2026
deepanshu-iiitu
deepanshu-iiitu previously approved these changes Feb 4, 2026
ShankarSinghC
ShankarSinghC previously approved these changes Feb 4, 2026
.await;
// Log warning if transaction flow failed (but don't propagate error)
if let Err(e) = _router_data_result {
logger::warn!("FRM transaction flow failed : {:?}", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this could be debug or error log

Ok(configs) => configs,
Err(e) => {
// Log the error
logger::warn!(
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@srujanchikke srujanchikke dismissed stale reviews from deepanshu-iiitu and kashif-m via 976eede February 4, 2026 14:38
@srujanchikke srujanchikke added the S-test-ready Status: This PR is ready for cypress-tests label Feb 4, 2026
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 4, 2026
Merged via the queue into main with commit 8f8ade9 Feb 4, 2026
26 of 31 checks passed
@Gnanasundari24 Gnanasundari24 deleted the decision_manager_cybersource branch February 4, 2026 16:08
srujanchikke added a commit that referenced this pull request Feb 5, 2026
… Decision Manager (FRM) (#11149)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
@hyperswitch-bot hyperswitch-bot bot removed the S-test-ready Status: This PR is ready for cypress-tests label Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-connector-integration Area: Connector integration M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants