Skip to content
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

feat(payments_v2): add payment method list endpoint #6805

Merged
merged 40 commits into from
Dec 23, 2024

Conversation

Narayanbhat166
Copy link
Member

@Narayanbhat166 Narayanbhat166 commented Dec 11, 2024

Type of Change

  • New feature

Description

This PR introduces the payment methods list endpoint for payments. Only the initial structure is introduced in this PR.

Screenshot 2024-12-11 at 5 23 59 PM

Motivation and Context

To provide the information to the checkout to show the payment methods that are enabled.

How did you test it?

  • Create a payment and make a call to list payment methods
curl --location 'http://localhost:8080/v2/payments/12345_pay_0193b57eda2e73e3947f9e9cdd79cb8e/payment-methods' \
--header 'api-key: pk_dev_83a8e7a99b6b45c8a8fa8bedc5c69bed' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_bAnL8eyuZyD9Hx8iXwUt' \
--header 'x-client-secret: 12345_pay_0193b57eda2e73e3947f9e9cdd79cb8e_secret_0193b57eda2e73e3947f9eae72ce6e26'
  • Response
{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card_redirect",
            "payment_method_subtype": "card_redirect",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "credit",
            "required_fields": null,
            "surcharge_details": null
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "debit",
            "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

Copy link

semanticdiff-com bot commented Dec 11, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  api-reference-v2/mint.json  91% smaller
  crates/euclid_wasm/src/lib.rs  87% smaller
  crates/router/src/core/admin.rs  76% smaller
  crates/router/src/routes/app.rs  49% smaller
  crates/diesel_models/src/merchant_connector_account.rs  32% smaller
  api-reference-v2/openapi_spec.json  27% smaller
  crates/api_models/src/events/payment.rs  22% smaller
  crates/hyperswitch_domain_models/src/merchant_connector_account.rs  14% smaller
  crates/api_models/src/payment_methods.rs  8% smaller
  crates/api_models/src/admin.rs  6% smaller
  .gitignore Unsupported file format
  api-reference-v2/api-reference/business-profile/profile--connector-accounts-list.mdx Unsupported file format
  api-reference-v2/api-reference/merchant-account/merchant-account--profile-list.mdx Unsupported file format
  api-reference-v2/api-reference/merchant-connector-account/connector-account--create.mdx Unsupported file format
  api-reference-v2/api-reference/merchant-connector-account/connector-account--retrieve.mdx Unsupported file format
  api-reference-v2/api-reference/merchant-connector-account/connector-account--update.mdx Unsupported file format
  api-reference-v2/api-reference/merchant-connector-account/merchant-connector--delete.mdx Unsupported file format
  api-reference-v2/api-reference/payment-methods/list-saved-payment-methods-for-a-customer.mdx Unsupported file format
  api-reference-v2/api-reference/payments/payments--payment-methods-list.mdx Unsupported file format
  crates/api_models/src/payments.rs  0% smaller
  crates/common_types/Cargo.toml Unsupported file format
  crates/common_types/src/lib.rs  0% smaller
  crates/common_types/src/payment_methods.rs  0% smaller
  crates/diesel_models/src/query/merchant_connector_account.rs  0% smaller
  crates/diesel_models/src/schema_v2.rs  0% smaller
  crates/euclid_wasm/Cargo.toml Unsupported file format
  crates/kgraph_utils/benches/evaluation.rs  0% smaller
  crates/kgraph_utils/src/mca.rs  0% smaller
  crates/openapi/src/openapi_v2.rs  0% smaller
  crates/openapi/src/routes/payments.rs  0% smaller
  crates/router/src/core/payment_methods/cards.rs  0% smaller
  crates/router/src/core/payments.rs  0% smaller
  crates/router/src/core/payments/payment_methods.rs  0% smaller
  crates/router/src/core/payments/routing.rs  0% smaller
  crates/router/src/core/payout_link.rs  0% smaller
  crates/router/src/core/payouts.rs  0% smaller
  crates/router/src/core/payouts/helpers.rs  0% smaller
  crates/router/src/db/kafka_store.rs  0% smaller
  crates/router/src/db/merchant_connector_account.rs  0% smaller
  crates/router/src/routes/payment_methods.rs  0% smaller
  crates/router/src/routes/payments.rs  0% smaller
  crates/router/src/types/transformers.rs  0% smaller
  v2_migrations/2024-08-28-081721_add_v2_columns/down.sql Unsupported file format
  v2_migrations/2024-08-28-081721_add_v2_columns/up.sql Unsupported file format
  v2_migrations/2024-10-08-081847_drop_v1_columns/up.sql Unsupported file format

@hyperswitch-bot hyperswitch-bot bot added M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Dec 11, 2024
@Narayanbhat166 Narayanbhat166 marked this pull request as ready for review December 11, 2024 11:55
@Narayanbhat166 Narayanbhat166 requested review from a team as code owners December 11, 2024 11:55
@Narayanbhat166 Narayanbhat166 changed the title feature(payments_v2): add barebones payment method list endpoint feature(payments_v2): add payment method list endpoint Dec 11, 2024
crates/common_utils/src/types.rs Outdated Show resolved Hide resolved
crates/common_utils/src/types.rs Outdated Show resolved Hide resolved
crates/common_utils/src/types.rs Outdated Show resolved Hide resolved
crates/kgraph_utils/benches/evaluation.rs Show resolved Hide resolved
crates/kgraph_utils/src/mca.rs Show resolved Hide resolved
crates/router/src/core/admin.rs Outdated Show resolved Hide resolved
crates/router/src/core/payment_methods/cards.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/payment_methods.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/payment_methods.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/payment_methods.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/payment_methods.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/payment_methods.rs Outdated Show resolved Hide resolved
crates/router/src/core/payments/payment_methods.rs Outdated Show resolved Hide resolved
tsdk02
tsdk02 previously approved these changes Dec 19, 2024
jarnura
jarnura previously approved these changes Dec 19, 2024
@Sarthak1799
Copy link
Contributor

Should we think about restructuring the Response as card_networks seem to be misleading for a Wallet type @Narayanbhat166
{ "payment_method_subtype": "google_pay", "card_networks": null, "bank_names": null, "required_fields": null, "surcharge_details": null },

@Narayanbhat166 Narayanbhat166 dismissed stale reviews from jarnura and tsdk02 via a801fed December 20, 2024 09:35
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Dec 23, 2024
Merged via the queue into main with commit d4b3dbc Dec 23, 2024
21 of 23 checks passed
@Gnanasundari24 Gnanasundari24 deleted the initial-merchant-payment-method-list-v2 branch December 23, 2024 10:43
pixincreate added a commit to Ankesh2004/hyperswitch that referenced this pull request Dec 26, 2024
…r-verifyurl-in-redirection-handler

* 'main' of github.com:juspay/hyperswitch: (444 commits)
  ci: add tests that make use of locker (juspay#6735)
  chore(version): 2024.12.26.1
  fix(router): populate `profile_id` in for the HeaderAuth of v1 (juspay#6936)
  docs(openapi): update /relay request example (juspay#6942)
  chore(version): 2024.12.26.0
  fix(payments_list): handle same payment/attempt ids for different merchants (juspay#6917)
  refactor(core): remove merchant return url from `router_data` (juspay#6895)
  feat(router): add endpoint for listing connector features  (juspay#6612)
  fix(wasm): remove chasenet from jpmorgan wasm as ChaseNet doesn’t exist in PMT (juspay#6927)
  fix(cors): expose all headers set by application in `access-control-expose-headers` header value (juspay#6877)
  chore(version): 2024.12.24.0
  feat(cypress): valdiate `error_code` and `error_message` and make it visible in `reports` (juspay#6913)
  fix(wasm): remove extra space from wasm for payment_method_type of JPMorgan (juspay#6923)
  fix(wasm): fix feature dependencies in `connector_configs` crate for WASM builds  (juspay#6832)
  feat(router): add /retrieve api for relay (juspay#6918)
  feat(core): implemented platform merchant account (juspay#6882)
  feat(payments_v2): add payment method list endpoint (juspay#6805)
  fix(connector): [Cybersource] fix the required fields for wallet mandate payments (juspay#6911)
  chore(version): 2024.12.23.0
  feat(connector): [JPMORGAN] add Payment flows for cards (juspay#6668)
  ...
pixincreate added a commit to Ankesh2004/hyperswitch that referenced this pull request Dec 26, 2024
…r-verifyurl-in-redirection-handler

* 'main' of github.com:juspay/hyperswitch: (444 commits)
  ci: add tests that make use of locker (juspay#6735)
  chore(version): 2024.12.26.1
  fix(router): populate `profile_id` in for the HeaderAuth of v1 (juspay#6936)
  docs(openapi): update /relay request example (juspay#6942)
  chore(version): 2024.12.26.0
  fix(payments_list): handle same payment/attempt ids for different merchants (juspay#6917)
  refactor(core): remove merchant return url from `router_data` (juspay#6895)
  feat(router): add endpoint for listing connector features  (juspay#6612)
  fix(wasm): remove chasenet from jpmorgan wasm as ChaseNet doesn’t exist in PMT (juspay#6927)
  fix(cors): expose all headers set by application in `access-control-expose-headers` header value (juspay#6877)
  chore(version): 2024.12.24.0
  feat(cypress): valdiate `error_code` and `error_message` and make it visible in `reports` (juspay#6913)
  fix(wasm): remove extra space from wasm for payment_method_type of JPMorgan (juspay#6923)
  fix(wasm): fix feature dependencies in `connector_configs` crate for WASM builds  (juspay#6832)
  feat(router): add /retrieve api for relay (juspay#6918)
  feat(core): implemented platform merchant account (juspay#6882)
  feat(payments_v2): add payment method list endpoint (juspay#6805)
  fix(connector): [Cybersource] fix the required fields for wallet mandate payments (juspay#6911)
  chore(version): 2024.12.23.0
  feat(connector): [JPMORGAN] add Payment flows for cards (juspay#6668)
  ...
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 M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants