Issue:
Refactor(core): Inclusion of constraint graph for merchant Payment Method list

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
Adds CGraphing for Merchant Pms with all the possible filters applicable as described below. 
# Addressed in this PR:

## 1 Creation of Constraint Graph for Merchant Payment Method List:
Created a Constraint Graph with the following filters/Nodes:

From configs and MCA:
1. Countries Filter
2. Currency Filter
3. Supported for Mandates Filter
4. Allowed Payment Method Types
5. Supported for Update Mandates Filter
6. Capture Method Used

From Req:
1. Recurring Enabled
2. Installment Enabled
3. Amount Based

After Applying all these Filters and creating a Graph for a Merchant MCA with 2 PMT enabled (Credit and Debit) with one connector(Cybersource), We will get a graph equivalent to [this](https://dreampuf.github.io/GraphvizOnline/?compressed=M4FwTglgxiAEAmEDmYCGAHAFrKB7AdqGhPiAPoobYDeAULA7AHIAMA2gDaoBGAphwF4AROlQBPALa9SZKSEy54sATlRh4QgLr1GTAIyce-YaMnTyIMel7LYAV3TxUIXrNT4nLrToZMATIZ8gkIAwgT4vDC4YLAksGxQYnxgwLh2YFC8mt6MzADMgcZCAGTFOboALIXBAD6wNeW%2BAKzVJuJSMpbWthEA7m4ezryNzABsraHhkSDRsfjxEQAeJLwgwAA0sBJ2HCAQwKgAZrymm-gSEJuodvLREABevPC4IBEgm73RHPCnsEQQ1jOuAIm247gA1rhDqgpJAoKhNolkql0plNkgOLgwRxfqh4GJpNltLkmAB2CalEZMAAcE1MHQsVhsKnwBAGnmGxN0AE46e1zGQusy-qsHOyhlS9OwuEFhHUGlzfHoDDKivLJQFVcF4eoyG9PmBwXN4gA1fYI2AAWVQoF4GTU8CJPmYegKWuE3AgHA4JCQZDwdlIYDExrYACkMO5NgBVfAQFzwADKICGwAA8ocAIKw6CoJ0kvRVd1CT3e33%2BtJBkNxNgASQ8EAtsfjT2TqYz2btuc2mbsRFQPrzkpaxcpipd42LUHSYGkiVDtaYACV87o9OSpzO59X5nXl6ulbTR2Vx-peceqX5pUZtQ7BUzbPBeJ6QJeVTfhGF8BEojEa0i7RRDIskvTUPxKE9nX8N1wPVU8-CLcCvx-GY-13JYVjWTZtl2c1jl%2Bc5Llga5bkgR5nleVYPi%2BH5xERJJALSYD0UxbFcXxaRNn%2BQFYFZEFYDBfBIWhHN4QPZg-BHcCxygvxJ1g%2BpLw3BSFVko9wPhdAQHSVw5AUJQVAkdw7AHS9zw0u99WiI0azNA5NmtW17XUcSmDya9ZRLL0fXwP0AyrUMI1EfAYzjBM2xcdMs1EodTzyd9PNLHy-MrcAd3iIKo1gXt%2B0HUKWyTFNIo7GLNlrNAAEdXLyMDPJkkk8hgzzpzAWd8HnGtFxXKk8kQ5qt3a9K926uKpLqyCGvk8aeuU5q7yFWwoFnRBX20KCWFgABaAA%2BfJ4jUMBcF6TBeDxARWTAIyOAuq71jwTEwAEbgODsLIoL0Lbdrc-bWqOk6zpugdAY4O7cAep6Xrekk-E%2Bva2AOv7Tvgc7oiu4HQfB57Xri2GmAqH7DuOpGUcuoHUYHDHogh7GoKaXHSQJxGAfJ66Wcpx6sah3RRnpxmieZ0nWcF9nqa53xqVxqU%2Bf%2B5HgfR%2B6qc509uUljb4d%2B-nZZZ%2BWwcVyHT3xnaXQ%2B9XCZlkm0bZhWOf1qCGaN-QTYRzWLbJ4XrdF08pYd5VpeJuWrd1m2aYLPJJbp02ma1wWdcx22C0Nr69Aj53zYD92g8996eZ9iXI5d9Pbo9pX3vtpO89T-3tcDuOQ7XD6fZV-O0%2BrjPa7Fl0Ycbv2zoIGu9brpU6e75uq5j-vg47-QJZHyuBcttuB6nvQVYdq8e%2Bjhei8zkuSQ2teYdH%2Be3e39uvdxvxD7nzeT4p4v490PwG6%2By%2BN9doXT6X%2BCu5fsOj5vj%2Bd8d4P2aBfFOGsW7j0XpPeCicJLgLNmPLeQCz5QRni-Hm-936xy-lBVeGC36FxQbg6GYc14MywUQkG99B7wIvhQ6%2B2CJ5Z2hjnF%2BDCIFINvtQ4BtC3L7y%2BjVQhrdP4wKgvFXGQjKEiOIWIhqZDBEIKjkw6BLDdC9UkUoguMieGoOhmXfImDGFUJFrvR%2B6DDHCKgaIgQy14L4MsVgvuqizG%2BCEQ7PIRjOHH0Abokh6jh6CK8YgnxOC5HqLYfkDhISAFhKzgAX1oEAA#strict%20digraph%20constraint_graph%20%7B%0A%20%20%20%20N0%5Blabel%3D%22payment_method%20%3D%20card%22%5D%0A%20%20%20%20N1%5Blabel%3D%22payment_type%20%3D%20update_mandate%22%5D%0A%20%20%20%20N2%5Blabel%3D%22Connector%20in%20%5Bcybersource%5D%22%5D%0A%20%20%20%20N3%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N4%5Blabel%3D%22%7C%20%7C%22%5D%0A%20%20%20%20N5%5Blabel%3D%22payment_type%20%3D%20new_mandate%22%5D%0A%20%20%20%20N6%5Blabel%3D%22Connector%20in%20%5Bnexinets%2C%20multisafepay%2C%20nmi%2C%20authorizedotnet%2C%20worldpay%2C%20stripe%2C%20noon%2C%20bankofamerica%2C%20cybersource%2C%20globalpay%2C%20adyen%5D%22%5D%0A%20%20%20%20N7%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N8%5Blabel%3D%22payment_type%20%3D%20non_mandate%22%5D%0A%20%20%20%20N9%5Blabel%3D%22payment_type%20%3D%20setup_mandate%22%5D%0A%20%20%20%20N10%5Blabel%3D%22%7C%20%7C%22%5D%0A%20%20%20%20N11%5Blabel%3D%22%7C%20%7C%22%5D%0A%20%20%20%20N12%5Blabel%3D%22card_network%20in%20%5BVisa%2C%20Mastercard%5D%22%5D%0A%20%20%20%20N13%5Blabel%3D%22billing_country%20in%20%5BJapan%2C%20UnitedStatesOfAmerica%5D%22%5D%0A%20%20%20%20N14%5Blabel%3D%22billing_country%20in%20%5BIndia%2C%20UnitedStatesOfAmerica%2C%20Australia%5D%22%5D%0A%20%20%20%20N15%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N16%5Blabel%3D%22currency%20in%20%5BINR%5D%22%5D%0A%20%20%20%20N17%5Blabel%3D%22currency%20in%20%5BINR%5D%22%5D%0A%20%20%20%20N18%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N19%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N20%5Blabel%3D%22card_type%20%3D%20debit%22%5D%0A%20%20%20%20N21%5Blabel%3D%22Connector%20in%20%5Bcybersource%5D%22%5D%0A%20%20%20%20N22%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N23%5Blabel%3D%22%7C%20%7C%22%5D%0A%20%20%20%20N24%5Blabel%3D%22Connector%20in%20%5Bnexinets%2C%20multisafepay%2C%20nmi%2C%20authorizedotnet%2C%20worldpay%2C%20cybersource%2C%20globalpay%2C%20adyen%2C%20stripe%2C%20noon%2C%20bankofamerica%5D%22%5D%0A%20%20%20%20N25%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N26%5Blabel%3D%22%7C%20%7C%22%5D%0A%20%20%20%20N27%5Blabel%3D%22%7C%20%7C%22%5D%0A%20%20%20%20N28%5Blabel%3D%22capture_method%20%3D%20manual%22%5D%0A%20%20%20%20N29%5Blabel%3D%22card_network%20in%20%5BVisa%2C%20Mastercard%5D%22%5D%0A%20%20%20%20N30%5Blabel%3D%22billing_country%20in%20%5BJapan%2C%20UnitedStatesOfAmerica%5D%22%5D%0A%20%20%20%20N31%5Blabel%3D%22billing_country%20in%20%5BJapan%2C%20Australia%2C%20UnitedStatesOfAmerica%2C%20Iraq%5D%22%5D%0A%20%20%20%20N32%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N33%5Blabel%3D%22currency%20in%20%5BINR%5D%22%5D%0A%20%20%20%20N34%5Blabel%3D%22currency%20in%20%5BINR%5D%22%5D%0A%20%20%20%20N35%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N36%5Blabel%3D%22%26%26%22%5D%0A%20%20%20%20N37%5Blabel%3D%22card_type%20%3D%20credit%22%5D%0A%0A%20%20%20%20N0%20-%3E%20N3%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N1%20-%3E%20N3%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N2%20-%3E%20N3%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N3%20-%3E%20N4%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N5%20-%3E%20N7%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N6%20-%3E%20N7%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N8%20-%3E%20N10%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N9%20-%3E%20N10%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N4%20-%3E%20N11%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N7%20-%3E%20N11%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N10%20-%3E%20N11%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N13%20-%3E%20N15%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N14%20-%3E%20N15%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N16%20-%3E%20N18%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N17%20-%3E%20N18%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N11%20-%3E%20N19%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N12%20-%3E%20N19%20%5Barrowhead%3Donormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N15%20-%3E%20N19%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N18%20-%3E%20N19%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N19%20-%3E%20N20%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N0%20-%3E%20N22%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N1%20-%3E%20N22%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N21%20-%3E%20N22%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N22%20-%3E%20N23%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N5%20-%3E%20N25%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N24%20-%3E%20N25%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N8%20-%3E%20N26%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N9%20-%3E%20N26%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N23%20-%3E%20N27%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N25%20-%3E%20N27%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N26%20-%3E%20N27%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N30%20-%3E%20N32%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N31%20-%3E%20N32%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N33%20-%3E%20N35%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N34%20-%3E%20N35%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N27%20-%3E%20N36%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N28%20-%3E%20N36%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dred%5D%0A%20%20%20%20N29%20-%3E%20N36%20%5Barrowhead%3Donormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N32%20-%3E%20N36%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N35%20-%3E%20N36%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%20%20%20%20N36%20-%3E%20N37%20%5Barrowhead%3Dnormalnormal%2Ccolor%3Dblue%5D%0A%7D%0A)

![graphviz (3)](https://github.com/juspay/hyperswitch/assets/61520228/3b47dbaf-9638-4951-9864-5b9db23e1ef7)

Henceforth, we will verify the constraints by constructing Context from our PaymentIntent and PaymentAttempt.
PM List for Merchant curl:
```
curl --location 'http://127.0.0.1:8080/account/payment_methods?client_secret=pay_RtUquUfJt9sSheQNpqdR_secret_6BOkQMk1fYNq5zCgOdYr' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_423ae8fdc10d4db0bf28eda1662f51a3' \
--data ''
```

## 2 Moka Caching of Pm Filter Graph:
We have even implemented Moka(In memory) Cashing mechanism for our CGraph to minimize the latency. So for every request first the cache value will be checked if present, derived and used else CGraph will be constructed and the cache will be refreshed.
<img width="1715" alt="Screenshot 2024-05-23 at 14 54 28" src="https://github.com/juspay/hyperswitch/assets/61520228/ff29e436-743f-43ca-92fb-93447d9a48e9">


### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
7. `crates/router/src/configs`
8. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Testing requires creation/refactoring of our configs:
The configs followed are as follows:-
```
[pm_filters.stripe]
google_pay = { country = "CN" }
apple_pay = { country = "AU,CN,HK,JP,MO,MY,NZ,SG,TW,AM,AT,AZ,BY,BE,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HU,IS,IE,IM,IT,KZ,JE,LV,LI,LT,LU,MT,MD,MC,ME,NL,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,UA,GB,AR,CO,CR,BR,MX,PE,BH,IL,JO,KW,PS,QA,SA,AE,CA,UM,US,KR,VN,MA,ZA,VA,CL,SV,GT,HN,PA" }

[pm_filters.cybersource]
credit = { not_available_flows = { capture_method = "manual" }, country = "AU, JP, IQ, US", currency = "INR"}
google_pay = { country = "AU,US", currency = "INR" }
debit = { country = "AU,IN, US", currency = "INR" }
```

## Flow followed

### Request 1: mca create request (Cybersource)
```
curl --location 'http://127.0.0.1:8080/account/merchant_1716536756/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
    "connector_type": "fiz_operations",
    "business_country": "US",
    "business_label": "default",
    "connector_name": "cybersource",
    "connector_account_details": {
        "auth_type": "SignatureKey",
        "api_key": "xxxx",
        "api_secret": "xxxxx",
        "key1": "juspay_us_sandbox"
    },
    "test_mode": true,
    "disabled": false,
    "payment_methods_enabled": [
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "debit",
                    "payment_experience": null,
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "accepted_currencies": {
                        "type": "enable_only",
                        "list": [
                            "INR"
                        ]
                    },
                    "accepted_countries": {
                        "type": "enable_only",
                        "list": [
                            "JP",
                            "US"
                        ]
                    },
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "credit",
                    "payment_experience": null,
                    "card_networks": [
                        "Visa",
                        "Mastercard"
                    ],
                    "accepted_currencies": {
                        "type": "all_accepted"
                    },
                    "accepted_countries": {
                        "type": "enable_only",
                        "list": [
                            "JP",
                            "US"
                        ]
                    },
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "connector_webhook_details": {
        "merchant_secret": "chethanaaaa"
    }
}'
```

### Request 2: mca create request (Stripe)
```
curl --location 'http://127.0.0.1:8080/account/merchant_1716536756/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
    "connector_type": "fiz_operations",
    "connector_name": "stripe",
    "business_country": "US",
    "business_label": "default",
    "connector_account_details": {
        "auth_type": "HeaderKey",
        "api_key": "{{connector_api_key}}"
    },
    "test_mode": false,
    "disabled": false,
    "payment_methods_enabled": [
        {
            "payment_method": "pay_later",
            "payment_method_types": [
                {
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true,
                    "payment_experience": "redirect_to_url",
                    "payment_method_type": "affirm"
                }
            ]
        },
        {
            "payment_method": "pay_later",
            "payment_method_types": [
                {
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true,
                    "payment_experience": "redirect_to_url",
                    "payment_method_type": "klarna"
                }
            ]
        },
        {
            "payment_method": "bank_redirect",
            "payment_method_types": [
                {
                    "payment_method_type": "ideal",
                    "payment_experience": null,
                    "card_networks": null,
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "eps",
                    "payment_experience": null,
                    "card_networks": null,
                    "accepted_currencies": null,
                    "accepted_countries": null,
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        },
        {
            "payment_method": "bank_debit",
            "payment_method_types": [
                {
                    "payment_method_type": "sepa",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        },
        {
            "payment_method": "bank_transfer",
            "payment_method_types": [
                {
                    "payment_method_type": "sepa",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        },
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "credit",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true,
                    "card_networks": [
                        "AmericanExpress",
                        "Discover",
                        "Interac",
                        "JCB",
                        "Mastercard",
                        "Visa",
                        "DinersClub",
                        "UnionPay",
                        "RuPay"
                    ]
                }
            ]
        },
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "debit",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true,
                    "card_networks": [
                        "AmericanExpress",
                        "Discover",
                        "Interac",
                        "JCB",
                        "Mastercard",
                        "Visa",
                        "DinersClub",
                        "UnionPay",
                        "RuPay"
                    ]
                }
            ]
        },
        {
            "payment_method": "wallet",
            "payment_method_types": [
                {
                    "payment_method_type": "apple_pay",
                    "payment_experience": "invoke_sdk_client",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "google_pay",
                    "payment_experience": "invoke_sdk_client",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                },
                {
                    "payment_method_type": "we_chat_pay",
                    "payment_experience": "invoke_sdk_client",
                    "minimum_amount": 1,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "metadata": {
        "google_pay": {
            "allowed_payment_methods": [
                {
                    "type": "CARD",
                    "parameters": {
                        "allowed_auth_methods": [
                            "PAN_ONLY",
                            "CRYPTOGRAM_3DS"
                        ],
                        "allowed_card_networks": [
                            "AMEX",
                            "DISCOVER",
                            "INTERAC",
                            "JCB",
                            "MASTERCARD",
                            "VISA"
                        ]
                    },
                    "tokenization_specification": {
                        "type": "PAYMENT_GATEWAY",
                        "parameters": {
                            "gateway": "example",
                            "gateway_merchant_id": "{{gateway_merchant_id}}"
                        }
                    }
                }
            ],
            "merchant_info": {
                "merchant_name": "PK"
            }
        }
    }
}'
```

### Request 3: Payment Create Request (with `capture_method = manual`)
```
curl --location 'http://127.0.0.1:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ee3RmaC8hkDWCibMrIk8AVzIzn1mK0yrQq5dJImuhr61np4mMHcRlGNFATZp0rcQ' \
--data-raw '
{
    "amount": 6540,
    "currency": "INR",
    "confirm": false,
    "capture_method": "manual",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 6540,
    "customer_id": "cus26",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "setup_future_usage": "on_session",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "127.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    "billing": {
        "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"
        }
    },
    "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"
    },
    "routing": {
        "type": "single",
        "data": "stripe"
    }
}
'
```
### Request 3: List Merchant Payment Methods
```
curl --location 'http://127.0.0.1:8080/account/payment_methods?client_secret=pay_pjPrnplx4iezrnZVq9OP_secret_G0Oc8N6SoTMKJpfYMEqZ' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_a5ea68aa142c4bb8ad07d0570166d26a' \
--data ''
```

**Response**
Google pay won't come as we have added in configs allowed country as CN
Payment Type Card(Credit) also won't come as the configs for credit has `not_available_flows = manual`
```
{
    "redirect_url": "https://google.com/success",
    "currency": "INR",
    "payment_methods": [
        {
            "payment_method": "wallet",
            "payment_method_types": [
                {
                    "payment_method_type": "apple_pay",
                    "payment_experience": [
                        {
                            "payment_experience_type": "invoke_sdk_client",
                            "eligible_connectors": [
                                "stripe"
                            ]
                        }
                    ],
                    "card_networks": null,
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {},
                    "surcharge_details": null,
                    "pm_auth_connector": null
                },
                {
                    "payment_method_type": "we_chat_pay",
                    "payment_experience": [
                        {
                            "payment_experience_type": "invoke_sdk_client",
                            "eligible_connectors": [
                                "stripe"
                            ]
                        }
                    ],
                    "card_networks": null,
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {},
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        },
        {
            "payment_method": "pay_later",
            "payment_method_types": [
                {
                    "payment_method_type": "affirm",
                    "payment_experience": [
                        {
                            "payment_experience_type": "redirect_to_url",
                            "eligible_connectors": [
                                "stripe"
                            ]
                        }
                    ],
                    "card_networks": null,
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {},
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        },
        {
            "payment_method": "card",
            "payment_method_types": [
                {
                    "payment_method_type": "debit",
                    "payment_experience": null,
                    "card_networks": [
                        {
                            "card_network": "Visa",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "cybersource",
                                "stripe"
                            ]
                        },
                        {
                            "card_network": "JCB",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "stripe"
                            ]
                        },
                        {
                            "card_network": "UnionPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "stripe"
                            ]
                        },
                        {
                            "card_network": "AmericanExpress",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "stripe"
                            ]
                        },
                        {
                            "card_network": "Discover",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "stripe"
                            ]
                        },
                        {
                            "card_network": "Interac",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "stripe"
                            ]
                        },
                        {
                            "card_network": "RuPay",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "stripe"
                            ]
                        },
                        {
                            "card_network": "DinersClub",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "stripe"
                            ]
                        },
                        {
                            "card_network": "Mastercard",
                            "surcharge_details": null,
                            "eligible_connectors": [
                                "cybersource",
                                "stripe"
                            ]
                        }
                    ],
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": null,
                    "required_fields": {
                        "billing.address.last_name": {
                            "required_field": "payment_method_data.billing.address.last_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "Doe"
                        },
                        "billing.address.first_name": {
                            "required_field": "payment_method_data.billing.address.first_name",
                            "display_name": "card_holder_name",
                            "field_type": "user_full_name",
                            "value": "joseph"
                        },
                        "billing.address.city": {
                            "required_field": "payment_method_data.billing.address.city",
                            "display_name": "city",
                            "field_type": "user_address_city",
                            "value": "San Fransico"
                        },
                        "payment_method_data.card.card_number": {
                            "required_field": "payment_method_data.card.card_number",
                            "display_name": "card_number",
                            "field_type": "user_card_number",
                            "value": null
                        },
                        "payment_method_data.card.card_cvc": {
                            "required_field": "payment_method_data.card.card_cvc",
                            "display_name": "card_cvc",
                            "field_type": "user_card_cvc",
                            "value": null
                        },
                        "billing.address.zip": {
                            "required_field": "payment_method_data.billing.address.zip",
                            "display_name": "zip",
                            "field_type": "user_address_pincode",
                            "value": "94122"
                        },
                        "payment_method_data.card.card_exp_year": {
                            "required_field": "payment_method_data.card.card_exp_year",
                            "display_name": "card_exp_year",
                            "field_type": "user_card_expiry_year",
                            "value": null
                        },
                        "payment_method_data.card.card_exp_month": {
                            "required_field": "payment_method_data.card.card_exp_month",
                            "display_name": "card_exp_month",
                            "field_type": "user_card_expiry_month",
                            "value": null
                        },
                        "email": {
                            "required_field": "email",
                            "display_name": "email",
                            "field_type": "user_email_address",
                            "value": null
                        },
                        "billing.address.line1": {
                            "required_field": "payment_method_data.billing.address.line1",
                            "display_name": "line1",
                            "field_type": "user_address_line1",
                            "value": "1467"
                        },
                        "billing.address.state": {
                            "required_field": "payment_method_data.billing.address.state",
                            "display_name": "state",
                            "field_type": "user_address_state",
                            "value": "California"
                        },
                        "billing.address.country": {
                            "required_field": "payment_method_data.billing.address.country",
                            "display_name": "country",
                            "field_type": {
                                "user_address_country": {
                                    "options": [
                                        "ALL"
                                    ]
                                }
                            },
                            "value": "US"
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        },
        {
            "payment_method": "bank_debit",
            "payment_method_types": [
                {
                    "payment_method_type": "sepa",
                    "payment_experience": null,
                    "card_networks": null,
                    "bank_names": null,
                    "bank_debits": {
                        "eligible_connectors": [
                            "stripe"
                        ]
                    },
                    "bank_transfers": null,
                    "required_fields": {
                        "billing.address.first_name": {
                            "required_field": "payment_method_data.billing.address.first_name",
                            "display_name": "billing_first_name",
                            "field_type": "user_billing_name",
                            "value": "joseph"
                        }
                    },
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        },
        {
            "payment_method": "bank_transfer",
            "payment_method_types": [
                {
                    "payment_method_type": "sepa",
                    "payment_experience": null,
                    "card_networks": null,
                    "bank_names": null,
                    "bank_debits": null,
                    "bank_transfers": {
                        "eligible_connectors": [
                            "stripe"
                        ]
                    },
                    "required_fields": null,
                    "surcharge_details": null,
                    "pm_auth_connector": null
                }
            ]
        }
    ],
    "mandate_payment": null,
    "merchant_name": "Prajjwal",
    "show_surcharge_breakup_screen": false,
    "payment_type": "normal"
}
```

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible


Resolution:
<think>
PR Context:
- Title: Refactor(core): Reverts Inclusion of constraint graph for merchant Payment Method list
- Merged: 2024-05-31T13:16:22Z
- Files changed: 7 files
- Commits: 1 commits

Implementation approach:
Reverts juspay/hyperswitch#4626
This PR needs some more refactors as currently it is mapped to checking whether or not currency and country is present in MCA. If not ignore configs as well. Which shouldn't be the ideal scenario.
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** Refactor(core): Reverts Inclusion of constraint graph for merchant Payment Method list (#4839)
Files to modify:


**crates/euclid/src/enums.rs**
  Modify existing code

**crates/router/src/core/payment_methods.rs**
  Remove:
    - mod: pub::utils

**crates/router/src/core/payment_methods/cards.rs**
  Add:
    - function: private::filter_pm_based_on_supported_payments_for_mandate
    - function: private::filter_pm_based_on_capture_method_used
    - function: private::card_network_filter
    - function: private::global_country_currency_filter
    - function: private::filter_pm_card_network_based
    - function: private::filter_pm_country_based
    - function: private::filter_pm_currencies_based
    - function: private::filter_accepted_enum_based
    - function: private::filter_pm_based_on_allowed_types
    - function: private::filter_payment_country_based
    - function: private::filter_payment_currency_based

**crates/router/src/core/payment_methods/utils.rs**
  Remove:
    - function: pub::make_pm_graph
    - function: pub::get_merchant_pm_filter_graph
    - function: pub::refresh_pm_filters_cache
    - function: private::compile_pm_graph
    - function: private::construct_capture_method_node
    - function: private::construct_supported_connectors_for_update_mandate_node
    - function: private::construct_supported_connectors_for_mandate_node
    - function: private::compile_accepted_countries_for_mca
    - function: private::compile_accepted_currency_for_mca

**crates/router/src/db/merchant_connector_account.rs**
  Modify existing code

**crates/storage_impl/src/redis/cache.rs**
  Modify existing code

**crates/storage_impl/src/redis/pub_sub.rs**
  Modify existing code