Skip to content

feat(router): Return payment_experience in PML for payment (v2)#8255

Merged
bernard-eugine merged 1 commit intomainfrom
pml-response-changes
Jun 5, 2025
Merged

feat(router): Return payment_experience in PML for payment (v2)#8255
bernard-eugine merged 1 commit intomainfrom
pml-response-changes

Conversation

@AnuthaDev
Copy link
Contributor

@AnuthaDev AnuthaDev commented Jun 5, 2025

Type of Change

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

Description

Added payment_experience in Payment Method List for Payments Response

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 #8254

How did you test it?

Request:

curl --location 'http://localhost:8080/v2/payments/12345_pay_019740919d6a72c2b6984f9b99be203f/payment-methods' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_GKx8bxieFB51Nk5FMCi6' \
--header 'Authorization: publishable-key=pk_dev_e2eec08c40444d8e862c444d3df67cd2,client-secret=cs_019740919d817810ad313fce9534793e' \
--header 'api-key: pk_dev_e2eec08c40444d8e862c444d3df67cd2'

Response:

{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card_redirect",
            "payment_method_subtype": "card_redirect",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "card",
            "payment_experience": null,
            "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": "apple_pay",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "we_chat_pay",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "ali_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": "wallet",
            "payment_method_subtype": "mb_way",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "klarna",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "affirm",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "afterpay_clearpay",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "walley",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "giropay",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "ideal",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "eps",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "bancontact_card",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "przelewy24",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "sofort",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "blik",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "trustly",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "online_banking_finland",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "online_banking_poland",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_transfer",
            "payment_method_subtype": "ach",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_transfer",
            "payment_method_subtype": "sepa",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_transfer",
            "payment_method_subtype": "bacs",
            "payment_experience": "redirect_to_url",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "ach",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "sepa",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "bacs",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "becs",
            "payment_experience": null,
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "klarna",
            "payment_experience": "invoke_sdk_client",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "klarna",
            "payment_experience": "redirect_to_url",
            "required_fields": 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

@semanticdiff-com
Copy link

semanticdiff-com bot commented Jun 5, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  api-reference-v2/openapi_spec.json  0% smaller
  crates/api_models/src/payments.rs  0% smaller
  crates/router/src/core/payments/payment_methods.rs  0% smaller

@AnuthaDev AnuthaDev self-assigned this Jun 5, 2025
@AnuthaDev AnuthaDev marked this pull request as ready for review June 5, 2025 14:42
@AnuthaDev AnuthaDev requested review from a team as code owners June 5, 2025 14:42
@AnuthaDev AnuthaDev force-pushed the pml-response-changes branch from 9f7d0b0 to 4d8bb99 Compare June 5, 2025 14:47
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jun 5, 2025
@bernard-eugine bernard-eugine enabled auto-merge June 5, 2025 15:27
@bernard-eugine bernard-eugine added this pull request to the merge queue Jun 5, 2025
Merged via the queue into main with commit 9ce3d73 Jun 5, 2025
27 of 32 checks passed
@bernard-eugine bernard-eugine deleted the pml-response-changes branch June 5, 2025 16:40
pixincreate added a commit that referenced this pull request Jun 9, 2025
…tch into cypress/fix

* 'cypress/fix' of github.com:juspay/hyperswitch:
  chore(cypress): run formatter and address lints

* 'main' of github.com:juspay/hyperswitch:
  feat(router): add merchantId authentication for Payments v2 (#8239)
  chore(version): 2025.06.06.0
  Documentation edits made through Mintlify web editor
  Documentation edits made through Mintlify web editor
  feat(router): Return payment_experience in PML for payment (v2) (#8255)
  refactor: add infra-values in intent kafka events (#8264)
  fix(wasm): [Worldpayvantiv] add support for metadata.report_group (#8260)
  chore(version): 2025.06.05.0
  revert(routing): Add connectors from current active routing algorithm before adding fallback connectors (#8207)
  feat(connectors): [Worldpayvantiv] add card support (#8219)
  feat(connectors): [Template] add Worldpayvantiv  (#8226)
  refactor(dynamic_routing): add logic for creating merchant account in decision engine (#8191)
  feat(events): adding infra level components to api-events (#8214)
  chore(version): 2025.06.04.0
  feat(core): add support for consuming eci for AuthNResponse in Authentication flow (#8225)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-v2 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): Include payment_experience in PML for payments response (v2)

4 participants