Skip to content

Conversation

Sarthak1799
Copy link
Contributor

Type of Change

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

Description

Remove straight through routing from routing approach enum.

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?

  1. make a 3ds payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_BNOaWRzwyZ3hMAbhRNtp9t6Mx7ZSVyK5gPvd1bavl0FWehvrHlre1eMifYA244TE' \
--data-raw '{
  "amount": 6540,
  "currency": "USD",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 6540,
  "customer_id": "StripeCustomer",
  "profile_id": "pro_EfD8EtQQSPZxXStG6B7x",
  "email": "[email protected]",
  "name": "John Doe",
  "phone": "999999999",
  "phone_country_code": "+1",
  "description": "Its my first payment request",
  "authentication_type": "three_ds",
  "return_url": "https://google.com",
  "payment_method": "card",
  "payment_method_type": "credit",
  "payment_method_data": {
    "card": {
      "card_number": "4242424242424242",
      "card_exp_month": "03",
      "card_exp_year": "30",
      "card_holder_name": "joseph Doe",
      "card_cvc": "737"
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "NL",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "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"
  },
   "browser_info": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;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": "127.0.0.1"
    }
}'

Response -

{"payment_id":"pay_RmAYKXp8BtCemEuRsj4o","merchant_id":"merchant_1749723893","status":"requires_customer_action","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":6540,"amount_received":0,"connector":"stripe","client_secret":"pay_RmAYKXp8BtCemEuRsj4o_secret_4DWtAW8CDiarCFCdz4KD","created":"2025-07-18T13:36:02.483Z","currency":"USD","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"[email protected]","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":"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":"03","card_exp_year":"30","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":{"address":{"city":"San Fransico","country":"US","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":null},"billing":{"address":{"city":"San Fransico","country":"NL","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":null},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"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_RmAYKXp8BtCemEuRsj4o/merchant_1749723893/pay_RmAYKXp8BtCemEuRsj4o_1"},"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":"StripeCustomer","created_at":1752845762,"expires":1752849362,"secret":"epk_9a34bbc728564d28ac2a731804987c0a"},"manual_retry_allowed":null,"connector_transaction_id":"pi_3RmESFD5R7gDAGff075WNWss","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pi_3RmESFD5R7gDAGff075WNWss","payment_link":null,"profile_id":"pro_EfD8EtQQSPZxXStG6B7x","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_SdftCCtpClu32qA6oijC","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T13:51:02.483Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-18T13:36:03.545Z","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":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}

DB -
image

Perform a Sync -

curl --location 'http://localhost:8080/payments/pay_RmAYKXp8BtCemEuRsj4o' \
--header 'Accept: application/json' \
--header 'api-key: dev_BNOaWRzwyZ3hMAbhRNtp9t6Mx7ZSVyK5gPvd1bavl0FWehvrHlre1eMifYA244TE'

Response -

{"payment_id":"pay_RmAYKXp8BtCemEuRsj4o","merchant_id":"merchant_1749723893","status":"succeeded","amount":6540,"net_amount":6540,"shipping_cost":null,"amount_capturable":0,"amount_received":6540,"connector":"stripe","client_secret":"pay_RmAYKXp8BtCemEuRsj4o_secret_4DWtAW8CDiarCFCdz4KD","created":"2025-07-18T13:36:02.483Z","currency":"USD","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"[email protected]","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":"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":"03","card_exp_year":"30","card_holder_name":"joseph Doe","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":{"address":{"city":"San Fransico","country":"US","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":null},"billing":{"address":{"city":"San Fransico","country":"NL","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":null},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"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,"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":"pi_3RmESFD5R7gDAGff075WNWss","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pi_3RmESFD5R7gDAGff075WNWss","payment_link":null,"profile_id":"pro_EfD8EtQQSPZxXStG6B7x","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_SdftCCtpClu32qA6oijC","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-18T13:51:02.483Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-18T13:36:11.257Z","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":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}

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

@Sarthak1799 Sarthak1799 self-assigned this Jul 18, 2025
@Sarthak1799 Sarthak1799 added the C-bug Category: Bug label Jul 18, 2025
@Sarthak1799 Sarthak1799 requested review from a team as code owners July 18, 2025 13:43
Copy link

semanticdiff-com bot commented Jul 18, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payments/routing.rs  83% smaller
  crates/common_enums/src/enums.rs  0% smaller
  crates/router/src/core/payments.rs  0% smaller

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jul 21, 2025
Merged via the queue into main with commit 53e7e7f Jul 21, 2025
16 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the straight-through-fix-main branch July 21, 2025 09:21
pixincreate added a commit that referenced this pull request Jul 22, 2025
…ordea-sepa

* 'main' of github.com:juspay/hyperswitch:
  refactor(connector): [Adyen] map ssn and session validity for Pix (#8702)
  feat(core): Implement UCS kill switch for emergency fallback (#8651)
  fix(openapi): Added Error Response Schema for Status Code 400 (#8684)
  feat(connector): Add template code for breadpay (#8655)
  chore(version): 2025.07.21.1
  refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681)
  fix(router): Make v2 endpoints follow standard naming conventions (#8630)
  fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards  (#8663)
  feat(routing): Add API key auth for decision engine endpoints (#8640)
  feat(authentication): Added eligibility flow for modular authentication (#8431)
  feat(connector): [BLACKHAWKNETWORK] Add Template Code  (#8632)
  fix: remove straight through routing from routing approach (#8695)
  fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
  chore(version): 2025.07.21.0
pixincreate added a commit that referenced this pull request Jul 22, 2025
…ayload-recurring

* 'main' of github.com:juspay/hyperswitch: (48 commits)
  fix(connector): Add Trustpay in Authentication Providers Config (#8622)
  refactor(connector): [Adyen] map ssn and session validity for Pix (#8702)
  feat(core): Implement UCS kill switch for emergency fallback (#8651)
  fix(openapi): Added Error Response Schema for Status Code 400 (#8684)
  feat(connector): Add template code for breadpay (#8655)
  chore(version): 2025.07.21.1
  refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681)
  fix(router): Make v2 endpoints follow standard naming conventions (#8630)
  fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards  (#8663)
  feat(routing): Add API key auth for decision engine endpoints (#8640)
  feat(authentication): Added eligibility flow for modular authentication (#8431)
  feat(connector): [BLACKHAWKNETWORK] Add Template Code  (#8632)
  fix: remove straight through routing from routing approach (#8695)
  fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
  chore(version): 2025.07.21.0
  feat(debit_routing): add debit routing support for apple pay (#8673)
  refactor(router): decrypt the wallet token before the debit routing call (#8598)
  chore: update org retrieve api response to include org type (#8660)
  feat(routing): Add routing evaluation rule endpoint and related flow (#8656)
  fix(connector): [AUTHORIZEDOTNET] Added Invoice Number Fix (#8685)
  ...
pixincreate added a commit that referenced this pull request Jul 22, 2025
…acilitapay-mca-metadata

* 'main' of github.com:juspay/hyperswitch:
  fix(connector): Add Trustpay in Authentication Providers Config (#8622)
  refactor(connector): [Adyen] map ssn and session validity for Pix (#8702)
  feat(core): Implement UCS kill switch for emergency fallback (#8651)
  fix(openapi): Added Error Response Schema for Status Code 400 (#8684)
  feat(connector): Add template code for breadpay (#8655)
  chore(version): 2025.07.21.1
  refactor(payments): fetch payment method information in attempts list api v2 and add custom billing connector template (#8681)
  fix(router): Make v2 endpoints follow standard naming conventions (#8630)
  fix(connector): [Cybersource] Add type_selection_indicator as 1 for all cards  (#8663)
  feat(routing): Add API key auth for decision engine endpoints (#8640)
  feat(authentication): Added eligibility flow for modular authentication (#8431)
  feat(connector): [BLACKHAWKNETWORK] Add Template Code  (#8632)
  fix: remove straight through routing from routing approach (#8695)
  fix(connector): [Access Worldpay] correct enum deserialization for payment responses for (#8689)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUGFIX] Remove write path for straight through routing
4 participants