Skip to content

Conversation

AnuthaDev
Copy link
Contributor

@AnuthaDev AnuthaDev commented Jul 9, 2025

Type of Change

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

Description

  • Merge payment_experience for a pm_type, subtype into an array
  • Return bank_names

Additional Changes

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

Motivation and Context

Closes #8582

How did you test it?

Request:

curl --location 'http://localhost:8080/v2/payments/12345_pay_0197ee3c52887d51b074cecb88687a33/payment-methods' \
--header 'Content-Type: application/json' \
--header 'Authorization: publishable-key=pk_dev_bef28bbe20d64d52bf4658ad5f7bc91e,client-secret=cs_0197ee3c52bd71a38bf7932a4484b345' \
--header 'X-Profile-Id: pro_eW12tyr48EHRHFF9MfLa' \
--header 'api-key: pk_dev_bef28bbe20d64d52bf4658ad5f7bc91e'

Response:

{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card",
            "payment_method_subtype": "card",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "card_redirect",
            "payment_method_subtype": "card_redirect",
            "payment_experience": [
                "redirect_to_url"
            ],
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "klarna",
            "payment_experience": [
                "redirect_to_url",
                "invoke_sdk_client"
            ],
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "google_pay",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "paypal",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "eps",
            "payment_experience": [
                "redirect_to_url"
            ],
            "bank_names": [
                "posojilnica_bank_e_gen",
                "schoellerbank_ag",
                "volksbank_gruppe",
                "hypo_tirol_bank_ag",
                "volkskreditbank_ag",
                "bawag_psk_ag",
                "easybank_ag",
                "raiffeisen_bankengruppe_osterreich",
                "sparda_bank_wien",
                "dolomitenbank",
                "erste_bank_und_sparkassen",
                "bank_austria"
            ],
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "ideal",
            "payment_experience": [
                "redirect_to_url"
            ],
            "bank_names": [
                "n26",
                "knab",
                "nationale_nederlanden",
                "ing",
                "rabobank",
                "sns_bank",
                "asn_bank",
                "bunq",
                "revolut",
                "triodos_bank",
                "regiobank",
                "abn_amro",
                "van_lanschot",
                "yoursafe"
            ],
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "sepa",
            "payment_experience": null,
            "bank_names": [],
            "required_fields": null,
            "surcharge_details": null
        }
    ],
    "customer_payment_methods": []
}

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

Copy link

semanticdiff-com bot commented Jul 9, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/api_models/src/payment_methods.rs  62% smaller
  crates/router/src/core/payments/payment_methods.rs  23% smaller
  api-reference/v2/openapi_spec_v2.json  0% smaller
  crates/api_models/src/payments.rs  0% smaller
  crates/common_enums/src/enums.rs  0% smaller
  crates/router/src/core/payment_methods/vault.rs  0% smaller

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jul 9, 2025
@AnuthaDev AnuthaDev self-assigned this Jul 10, 2025
@AnuthaDev AnuthaDev added this to the July 2025 Release milestone Jul 10, 2025
@AnuthaDev AnuthaDev marked this pull request as ready for review July 10, 2025 10:59
@AnuthaDev AnuthaDev requested review from a team as code owners July 10, 2025 10:59
@prasunna09 prasunna09 added the A-payment-methods Area: Payment Methods label Jul 10, 2025
jarnura
jarnura previously approved these changes Jul 11, 2025
@AnuthaDev AnuthaDev requested review from su-shivanshmathur and removed request for jarnura and su-shivanshmathur July 14, 2025 11:27
@bernard-eugine bernard-eugine added this pull request to the merge queue Jul 14, 2025
Merged via the queue into main with commit 7d54ce8 Jul 14, 2025
16 of 20 checks passed
@bernard-eugine bernard-eugine deleted the pml-dup-fix branch July 14, 2025 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-payment-methods Area: Payment Methods M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(router): refactor PML response
5 participants