Skip to content

Conversation

prajjwalkumar17
Copy link
Member

@prajjwalkumar17 prajjwalkumar17 commented Dec 12, 2024

Type of Change

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

Description

This will integrate elimination routing in our core flows for connectors to be filtered on basis of error codes received.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

How did you test it?

Testing performed in same way as SR routing.

  1. Enable ER for merchant
curl --location --request POST 'http://localhost:8080/account/merchant_1744368166/business_profile/pro_GrzjTHd5Pn5hAhwTZPRn/dynamic_routing/elimination/toggle?enable=dynamic_connector_selection' \
--header 'api-key: dev_a4XMpNXd3Yriz5DPsiwU6UbxEkiRkXdqHhwnJPolnVhssLaDEbOg6f5kE6B2hx1f'
  1. Enable Volume split
curl --location --request POST 'http://localhost:8080/account/merchant_1744368166/business_profile/pro_GrzjTHd5Pn5hAhwTZPRn/dynamic_routing/set_volume_split?split=100' \
--header 'api-key: dev_a4XMpNXd3Yriz5DPsiwU6UbxEkiRkXdqHhwnJPolnVhssLaDEbOg6f5kE6B2hx1f'
  1. Create a volte Payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_lnvARj6hcC6DXOC3XXByk5s2qv7EWGhG0v9vFo85RQvz3Ft9IrqMXeSMpvuotZfp' \
--data-raw '{
    "amount": 8000,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 8000,
    "customer_id": "StripeCustomer",
    "email": "[email protected]",
    "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": "bank_redirect",
    "payment_method_type": "open_banking_uk",
    "payment_method_data": {
        "bank_redirect": {
            "open_banking_uk": {}
        }
    },
    "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"
        }
    },
    "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"
    },
    "profile_id": "pro_KEc20awDxPq8pSIDsBV0"
}'

cancel the payment after going to the payment url.

  1. logs checkup:
    DEBUG router::core::payments::routing: dynamic_eliminated_connectors: []
    if the above log is present, it shows elimination is working fine.

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

@prajjwalkumar17 prajjwalkumar17 requested review from a team as code owners December 12, 2024 04:52
Copy link

semanticdiff-com bot commented Dec 12, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payments/operations/payment_response.rs  88% smaller
  crates/api_models/src/routing.rs  17% smaller
  crates/router/src/core/payments/routing.rs  1% smaller
  crates/router/src/core/routing/helpers.rs  1% smaller
  config/development.toml Unsupported file format
  crates/common_enums/src/enums.rs  0% smaller
  crates/router/src/core/errors.rs  0% smaller

@prajjwalkumar17 prajjwalkumar17 marked this pull request as draft December 12, 2024 04:52
@prajjwalkumar17 prajjwalkumar17 self-assigned this Dec 12, 2024
@prajjwalkumar17 prajjwalkumar17 changed the base branch from main to elimination-routing-interface December 12, 2024 08:21
@prajjwalkumar17 prajjwalkumar17 changed the base branch from elimination-routing-interface to main December 12, 2024 08:22
Sarthak1799
Sarthak1799 previously approved these changes Mar 7, 2025
Chethan-rao
Chethan-rao previously approved these changes Apr 16, 2025
Sarthak1799
Sarthak1799 previously approved these changes Apr 16, 2025
@prajjwalkumar17 prajjwalkumar17 dismissed stale reviews from Sarthak1799 and Chethan-rao via 2f7d721 April 16, 2025 13:14
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Apr 22, 2025
Merged via the queue into main with commit 82bc461 Apr 22, 2025
20 of 24 checks passed
@Gnanasundari24 Gnanasundari24 deleted the er_core branch April 22, 2025 07:38
pixincreate added a commit that referenced this pull request Apr 22, 2025
…acilitapay-pix-pmt

* 'main' of github.com:juspay/hyperswitch:
  fix(connector): revert noon-paypal (#7864)
  refactor(cypress): do not update `card_expiry` while updating card info (#7834)
  feat(vsaas): add processor_merchant_id and created_by column in payment_intents and payments_attempts for v1 (#7768)
  chore(dynamic-fields): remove billing details as required fields for Worldpay connector (#7853)
  feat(dynamic_routing): integration of elimination routing for core flows (#6816)
  chore(version): 2025.04.22.0
  revert: fix(connector): [noon] address `next_action_url` being `null` for cards in 3ds payment (#7859)
  feat(dynamic_routing): add open router integration for success based routing (#7795)
  feat(refunds_v2): Add refund create core flow (#7619)
  fix(core): [CARD TESTING GUARD] Added Card Testing Guard Config response in case of NULL (#7478)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-euclid-foc Area: Euclid Family of Crates C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration of ER in core flow
7 participants