Skip to content

feat(payment-methods): add filtering logic for payment method list v2 #8606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Aug 5, 2025

Conversation

Sakilmostak
Copy link
Contributor

@Sakilmostak Sakilmostak commented Jul 10, 2025

Type of Change

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

Description

Implementation Details

The core of this change is the filter_payment_methods function, which is designed to be called iteratively for each PaymentMethodsEnabledForConnector object. The function's primary responsibility is to decide whether a given payment method should be included in the list of available options presented to the user.

It achieves this by executing three sequential sets of logical checks, represented by boolean flags:

  1. request_based_filter
  2. intent_based_filter
  3. config_based_filter

A payment method is only added to the final response vector (resp) if it successfully passes all three of these filtering stages.

Filtering Logic Breakdown

The filtering logic is composed of several helper functions, each responsible for a specific check:

1. Request-Based Filtering:
These filters operate on parameters directly from the PaymentMethodsListRequest.

  • filter_recurring_based: A straightforward check that compares the recurring_enabled boolean in the request with the payment method's configuration.
  • filter_amount_based: Validates if the transaction amount falls within the minimum_amount and maximum_amount supported by the payment method. It correctly handles None amounts and allows zero-amount transactions to pass.
  • filter_card_network_based: For Credit and Debit payment methods, this ensures that the card networks specified in the request are a subset of the networks configured for the payment method.

2. Payment Intent-Based Filtering:
These checks are performed only if a PaymentIntent object is available for the transaction.

  • filter_country_based & filter_currency_based: These functions validate the transaction's country (from billing_address) and currency against the payment method's accepted_countries and accepted_currencies configurations. These configurations support both allow-lists (EnableOnly) and deny-lists (DisableOnly).
  • filter_zero_mandate_based: This implements specialized logic for zero-amount transactions intended for future use (setup_future_usage: OffSession). It consults the settings.zero_mandates.supported_payment_methods configuration to verify if the specific payment method type, subtype, and connector are explicitly enabled for zero-value mandates.
  • filter_allowed_payment_method_types_based: Checks if the current payment method's type is included in the allowed_payment_method_types list within the PaymentIntent.

3. Configuration-Based Filtering:
This stage applies system-wide rules defined in the application settings.

  • filter_config_based: This function retrieves filtering rules from settings.pm_filters. It first looks for a configuration block matching the connector name (e.g., "stripe") and falls back to a "default" configuration if a connector-specific one is not found. The lookup within this configuration is performed using the PaymentMethodType.
  • filter_config_country_currency_based: Once a configuration is found, this helper applies the country and currency rules defined in the corresponding CurrencyCountryFlowFilter, ensuring the transaction's context matches the defined constraints.

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?

Tested through Postman:

Create an MCA (Adyen) with below body:

Scenarios:

Case 1: Filter based on country currency:
Create a payment intent with country as DE and currency as EUR

curl --location '{{baseUrl}}/v2/payments/create-intent' \
--header 'api-key:{{api_key}}' \
--header 'Content-Type: application/json' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Authorization: api-key={{api_key}}' \
--data-raw '{
    "amount_details": {
        "order_amount": 100,
        "currency": "EUR"
    },
    "capture_method":"automatic",
    "authentication_type": "no_three_ds",
    "billing": {
        "address": {
            "city": "test",
            "country": "DE",
            "line1": "here is some \n there is some \n none is some? \n ",
            "line2": "there",
            "line3": "anywhere",
            "zip": "560095",
            "state": "SE",
            "first_name": "Sakil",
            "last_name": "Mostak"
        },
        "phone": {
            "number": "1234567890",
            "country_code": "+1"
        },
        "email": "[email protected]"
    }
}'

Do a payment method list call, following should be the response

{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card",
            "payment_method_subtype": "credit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "debit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "giropay",
            "payment_experience": [
                "redirect_to_url"
            ],
            "required_fields": [],
            "surcharge_details": null
        }
    ],
    "customer_payment_methods": null
}

Case 2: Filter based on card_network:
Create the following intent

curl --location '{{baseUrl}}/v2/payments/create-intent' \
--header 'api-key:{{api_key}}' \
--header 'Content-Type: application/json' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Authorization: api-key={{api_key}}' \
--data-raw '{
    "amount_details": {
        "order_amount": 100,
        "currency": "EUR"
    },
    
    "capture_method":"automatic",
    "authentication_type": "no_three_ds",
    "billing": {
        "address": {
            "city": "test",
            "country": "DE",
            "line1": "here is some \n there is some \n none is some? \n ",
            "line2": "there",
            "line3": "anywhere",
            "zip": "560095",
            "state": "SE",
            "first_name": "Sakil",
            "last_name": "Mostak"
        },
        "phone": {
            "number": "1234567890",
            "country_code": "+1"
        },
        "email": "[email protected]"
    }
}'

Create a PML request with the following request parameters (card_networks=Visa,AmericanExpress):

curl --location '{{baseUrl}}/v2/payments/{{payment_id}}/payment-methods?card_networks=Visa,AmericanExpress' \
--header 'Content-Type: application/json' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Authorization: publishable-key={{publishable_key}},client-secret={{client_secret}}'

Following should be the response

{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card",
            "payment_method_subtype": "debit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "giropay",
            "payment_experience": [
                "redirect_to_url"
            ],
            "required_fields": [],
            "surcharge_details": null
        }
    ],
    "customer_payment_methods": null
}

Case 3: Filter based on amount:
Create a payment intent with amount=30 and country as NL and currency as EUR

curl --location '{{baseUrl}}/v2/payments/create-intent' \
--header 'api-key:{{api_key}}' \
--header 'Content-Type: application/json' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Authorization: api-key={{api_key}}' \
--data-raw '{
    "amount_details": {
        "order_amount": 30,
        "currency": "EUR"
    },
    "capture_method":"automatic",
    "authentication_type": "no_three_ds",
    "billing": {
        "address": {
            "city": "test",
            "country": "NL",
            "line1": "here is some \n there is some \n none is some? \n ",
            "line2": "there",
            "line3": "anywhere",
            "zip": "560095",
            "state": "SE",
            "first_name": "Sakil",
            "last_name": "Mostak"
        },
        "phone": {
            "number": "1234567890",
            "country_code": "+1"
        },
        "email": "[email protected]"
    }
}'

Do a payment method list call, following should be the response

{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card",
            "payment_method_subtype": "credit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "debit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "ideal",
            "payment_experience": [
                "redirect_to_url"
            ],
            "bank_names": [
                "bunq",
                "rabobank",
                "sns_bank",
                "abn_amro",
                "revolut",
                "van_lanschot",
                "ing",
                "knab",
                "triodos_bank",
                "nationale_nederlanden",
                "asn_bank",
                "n26",
                "regiobank",
                "yoursafe"
            ],
            "required_fields": [
                {
                    "required_field": "payment_method_data.bank_redirect.ideal.bank_name",
                    "display_name": "bank_name",
                    "field_type": "user_bank",
                    "value": null
                }
            ],
            "surcharge_details": null
        }
    ],
    "customer_payment_methods": null
}

Cretae a payment intent with amount=80 and country as NL and currency as EUR

curl --location '{{baseUrl}}/v2/payments/create-intent' \
--header 'api-key:{{api_key}}' \
--header 'Content-Type: application/json' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Authorization: api-key={{api_key}}' \
--data-raw '{
    "amount_details": {
        "order_amount": 80,
        "currency": "EUR"
    },
    "capture_method":"automatic",
    "authentication_type": "no_three_ds",
    "billing": {
        "address": {
            "city": "test",
            "country": "NL",
            "line1": "here is some \n there is some \n none is some? \n ",
            "line2": "there",
            "line3": "anywhere",
            "zip": "560095",
            "state": "SE",
            "first_name": "Sakil",
            "last_name": "Mostak"
        },
        "phone": {
            "number": "1234567890",
            "country_code": "+1"
        },
        "email": "[email protected]"
    }
}'

Do a payment method list call, following should be the response

{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card",
            "payment_method_subtype": "credit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "debit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        }
    ],
    "customer_payment_methods": null
}

Case 4: Filter based on zero mandates:
Create a payment intent with amount=0 and setup_future_usage=off_session

curl --location '{{baseUrl}}/v2/payments/create-intent' \
--header 'api-key:{{api_key}}' \
--header 'Content-Type: application/json' \
--header 'x-profile-id:{{profile_id}}' \
--header 'Authorization: api-key={{api_key}}' \
--data-raw '{
    "amount_details": {
        "order_amount": 0,
        "currency": "EUR"
    },
    "capture_method":"automatic",
    "authentication_type": "no_three_ds",
    "setup_future_usage": "off_session",
    "billing": {
        "address": {
            "city": "test",
            "country": "BE",
            "line1": "here is some \n there is some \n none is some? \n ",
            "line2": "there",
            "line3": "anywhere",
            "zip": "560095",
            "state": "SE",
            "first_name": "Sakil",
            "last_name": "Mostak"
        },
        "phone": {
            "number": "1234567890",
            "country_code": "+1"
        },
        "email": "[email protected]"
    }
}'

Do a payment method list call, following should be the response

{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card",
            "payment_method_subtype": "credit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "debit",
            "payment_experience": null,
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "bancontact_card",
            "payment_experience": [
                "redirect_to_url"
            ],
            "required_fields": [
                {
                    "required_field": "payment_method_data.bank_redirect.bancontact_card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_redirect.bancontact_card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.bank_redirect.bancontact_card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.first_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.billing.address.last_name",
                    "display_name": "card_holder_name",
                    "field_type": "user_full_name",
                    "value": null
                }
            ],
            "surcharge_details": null
        }
    ],
    "customer_payment_methods": 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

@Sakilmostak Sakilmostak added this to the July 2025 Release milestone Jul 10, 2025
@Sakilmostak Sakilmostak self-assigned this Jul 10, 2025
@Sakilmostak Sakilmostak requested review from a team as code owners July 10, 2025 13:10
@Sakilmostak Sakilmostak added A-core Area: Core flows C-feature Category: Feature request or enhancement A-payment-methods Area: Payment Methods A-routing Area: Routing labels Jul 10, 2025
Copy link

semanticdiff-com bot commented Jul 10, 2025

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jul 15, 2025
@Sakilmostak Sakilmostak changed the title feat(payment-methods): add filtering logic for payment method list feat(payment-methods): add filtering logic for payment method list v2 Jul 15, 2025
Copy link
Member

@prajjwalkumar17 prajjwalkumar17 left a comment

Choose a reason for hiding this comment

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

Seems fine, should be throughly tested before further deployments in different environments.

@@ -7701,7 +7703,38 @@ pub enum SdkType {

#[cfg(feature = "v2")]
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
pub struct PaymentMethodsListRequest {}
pub struct PaymentMethodsListRequest {
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a PaymentMethodListRequest struct in api_models/src/payment_methods.rs. Please consider using that. We can also remove the extra deserializer crate dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This struct was introduced by @Narayanbhat166 for v2, while the struct in api_models/src/payment_methods.rs is for v1. Are we sure about merging them given if we try to differentiate v1 and v2 parameters?

Copy link
Contributor Author

@Sakilmostak Sakilmostak Jul 27, 2025

Choose a reason for hiding this comment

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

deserialize_form_style_query_parameter crate is import for v2 specifically to take vector as a input in query params. for example {{baseUrl}}/v2/payments/:id/payment-methods?accepted_countries=US,UK,NZ

Copy link
Contributor

Choose a reason for hiding this comment

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

We have 2 versions of PaymentMethodListRequest in payment_methods.rs, one for v1 and another for v2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two separate structure present to differentiate payment's and payment method's PML. In case of future deviation in implementation, this will be useful. Currently updating the name of both as per suggestion

@Sakilmostak Sakilmostak requested a review from AnuthaDev July 27, 2025 15:34

/// Indicates whether the payment method is eligible for card networks
#[serde(deserialize_with = "option_form_vec_deserialize", default)]
#[schema(value_type = Option<Vec<CardNetwork>>, example = json!(["visa", "mastercard"]))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please have a test case added for the deserializer which is added

payment_method_type,
))
.map(|value| filter_config_country_currency_based(value, country, currency))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

do we really need this match case? we are calling the same fn in both the cases.

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Aug 5, 2025
Merged via the queue into main with commit 2e13771 Aug 5, 2025
15 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the filter_payment_method_v2 branch August 5, 2025 08:19
pixincreate added a commit that referenced this pull request Aug 6, 2025
…ordea-sepa

* 'main' of github.com:juspay/hyperswitch: (89 commits)
  feat(router): [worldpayvantiv] add dispute list sync and implement dispute (#8830)
  feat(core): Add support for Void after Capture (#8839)
  fix(wasm): [FISERV] Added GooglePay Payment Method Type (#8832)
  feat(connector): [Barclaycard] Add Google Pay Payment Method (#8786)
  chore(version): 2025.08.06.0
  feat(core): Added additional authentication fields for 3ds external authentication (#8758)
  refactor(core): propagate network_transaction_id in response of payment (#8829)
  fix(core): add fix for stopping multiple event locking idempotent logs (#8034)
  feat(connector): [AUTHORIZEDOTNET] create connector customer flow added (#8774)
  feat(core): Add L2_L3 Data Support  (#8828)
  feat(connector): [NMI] Add mandates flow (#8652)
  fix(connector): [Wise] send uuid as connector_transaction_id (#8836)
  feat(core): populate UCS status_code in response headers (#8788)
  feat(external_services): Fixed Url for Unified Connector Service gRPC Client (#8587)
  chore: reorder v2 migrations folders (#8671)
  fix(router): Take merchant ID from headers in API Key - Revoke (v2) (#8808)
  fix(connector): (payload) currency auth key wasm changes (#8825)
  feat(payment-methods): add filtering logic for payment method list v2 (#8606)
  feat(router): add support for apple pay pre-decrypted token in the payments confirm call (#8815)
  chore(version): 2025.08.05.0
  ...
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-payment-methods Area: Payment Methods A-routing Area: Routing C-feature Category: Feature request or enhancement M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants