juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.64k stars 1.36k forks source link

refactor(router): remove metadata, additional_merchant_data and connector_wallets_details from connector list api #6583

Closed AkshayaFoiger closed 5 days ago

AkshayaFoiger commented 1 week ago

Type of Change

Description

Remove metadata, additional_merchant_data and connector_wallets_details from connector list API. To prevent exposure of sensitive data.

Additional Changes

How did you test it?

  1. List a Merchant Connectors
    curl --location 'http://localhost:8080/account/postman_merchant_GHAction_3d7037d0-0377-4ef1-bf93-372bcb66ce7f/profile/connectors' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: test_admin' \
    --header 'X-Merchant-Id: postman_merchant_GHAction_3d7037d0-0377-4ef1-bf93-372bcb66ce7f' \
    --data ''

    Response

    [
    {
        "connector_type": "payment_processor",
        "connector_name": "adyen",
        "connector_label": "adyen_US_default",
        "merchant_connector_id": "mca_gOkydSVpVKfHK4JUSiPg",
        "profile_id": "pro_irLOHIwYUK7sG8f9armE",
        "payment_methods_enabled": [
            {
                "payment_method": "card",
                "payment_method_types": [
                    {
                        "payment_method_type": "credit",
                        "payment_experience": null,
                        "card_networks": [
                            "AmericanExpress",
                            "Discover",
                            "Interac",
                            "JCB",
                            "Mastercard",
                            "Visa",
                            "DinersClub",
                            "UnionPay",
                            "RuPay"
                        ],
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": 1,
                        "maximum_amount": 68607706,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "debit",
                        "payment_experience": null,
                        "card_networks": [
                            "AmericanExpress",
                            "Discover",
                            "Interac",
                            "JCB",
                            "Mastercard",
                            "Visa",
                            "DinersClub",
                            "UnionPay",
                            "RuPay"
                        ],
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": 1,
                        "maximum_amount": 68607706,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    }
                ]
            },
            {
                "payment_method": "pay_later",
                "payment_method_types": [
                    {
                        "payment_method_type": "klarna",
                        "payment_experience": "redirect_to_url",
                        "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": "affirm",
                        "payment_experience": "redirect_to_url",
                        "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": "afterpay_clearpay",
                        "payment_experience": "redirect_to_url",
                        "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": "alma",
                        "payment_experience": "redirect_to_url",
                        "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": "atome",
                        "payment_experience": "redirect_to_url",
                        "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": "pay_bright",
                        "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": "atome",
                        "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": "walley",
                        "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": "affirm",
                        "payment_experience": "redirect_to_url",
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": 1,
                        "maximum_amount": 68607706,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    }
                ]
            },
            {
                "payment_method": "wallet",
                "payment_method_types": [
                    {
                        "payment_method_type": "paypal",
                        "payment_experience": "redirect_to_url",
                        "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": "swish",
                        "payment_experience": "redirect_to_url",
                        "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": "mb_way",
                        "payment_experience": "redirect_to_url",
                        "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": "cashapp",
                        "payment_experience": "display_qr_code",
                        "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": "google_pay",
                        "payment_experience": "invoke_sdk_client",
                        "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": "mobile_pay",
                        "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": "ali_pay",
                        "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": "we_chat_pay",
                        "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": "mb_way",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": {
                            "type": "enable_only",
                            "list": [
                                "PLN"
                            ]
                        },
                        "accepted_countries": {
                            "type": "enable_only",
                            "list": [
                                "PT"
                            ]
                        },
                        "minimum_amount": 1,
                        "maximum_amount": 68607706,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    }
                ]
            },
            {
                "payment_method": "gift_card",
                "payment_method_types": [
                    {
                        "payment_method_type": "givex",
                        "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": "pay_safe_card",
                        "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_redirect",
                "payment_method_types": [
                    {
                        "payment_method_type": "giropay",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "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": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "sofort",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "blik",
                        "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": "trustly",
                        "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": "online_banking_czech_republic",
                        "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": "online_banking_finland",
                        "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": "online_banking_poland",
                        "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": "online_banking_slovakia",
                        "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": "bancontact_card",
                        "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": "voucher",
                "payment_method_types": [
                    {
                        "payment_method_type": "boleto",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "seven_eleven",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "indomaret",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "alfamart",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    }
                ]
            },
            {
                "payment_method": "bank_debit",
                "payment_method_types": [
                    {
                        "payment_method_type": "ach",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "bacs",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    }
                ]
            },
            {
                "payment_method": "card_redirect",
                "payment_method_types": [
                    {
                        "payment_method_type": "momo_atm",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "knet",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "benefit",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    }
                ]
            },
            {
                "payment_method": "bank_transfer",
                "payment_method_types": [
                    {
                        "payment_method_type": "ach",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "bacs",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "mandiri_va",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "danamon_va",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "cimb_va",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "bri_va",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "bni_va",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "bca_bank_transfer",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "permata_bank_transfer",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    },
                    {
                        "payment_method_type": "permata_bank_transfer",
                        "payment_experience": null,
                        "card_networks": null,
                        "accepted_currencies": null,
                        "accepted_countries": null,
                        "minimum_amount": null,
                        "maximum_amount": null,
                        "recurring_enabled": true,
                        "installment_payment_enabled": true
                    }
                ]
            }
        ],
        "test_mode": true,
        "disabled": false,
        "frm_configs": null,
        "business_country": "US",
        "business_label": "default",
        "business_sub_label": null,
        "applepay_verified_domains": null,
        "pm_auth_config": null,
        "status": "active"
    }
    ]

    Cypress test case

    Screenshot 2024-11-19 at 2 53 01 PM

Checklist

semanticdiff-com[bot] commented 1 week ago

Review changes with  SemanticDiff

Changed Files
| File | Status | | :--- | :--- | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#api-reference-v2/openapi_spec.json)  [api\-reference\-v2/openapi\_spec\.json](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#api-reference-v2/openapi_spec.json) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#api-reference-v2/openapi_spec.json)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#api-reference/openapi_spec.json)  [api\-reference/openapi\_spec\.json](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#api-reference/openapi_spec.json) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#api-reference/openapi_spec.json)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#crates/api_models/src/admin.rs)  [crates/api\_models/src/admin\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#crates/api_models/src/admin.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#crates/api_models/src/admin.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#crates/router/src/types/transformers.rs)  [crates/router/src/types/transformers\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#crates/router/src/types/transformers.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#crates/router/src/types/transformers.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#cypress-tests/cypress/support/commands.js)  [cypress\-tests/cypress/support/commands\.js](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#cypress-tests/cypress/support/commands.js) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6583/changes#cypress-tests/cypress/support/commands.js)  0% smaller |
Gnanasundari24 commented 1 week ago

@AkshayaFoiger Can you add the cypress test for this