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(router): Add payment_methods_session_delete_payment_method endpoint [V2] #7409

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AnuthaDev
Copy link
Contributor

Type of Change

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

Description

This endpoint allows deleting saved payment methods for a customer

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

How did you test it?

  1. Request:
curl --location --request DELETE 'http://localhost:8080/v2/payment-methods-session/12345_pms_01955b8bed367ee09f81e053cde47593' \
--header 'Authorization: publishable-key=pk_dev_16fea0a9bf5447ed9f25aa835565f285,client-secret=cs_01955b8bed37771282694611c1db81e5' \
--header 'X-Profile-Id: pro_0xaQT1sPjecc284Qtf5N' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_DfzEs7oHcqmWiWeKTPZ8RqHnWyuuPkEheYExXkY1AO1H5EMdkgNcfTFe3JU4vFLt' \
--data '{
    "payment_method_id": "12345_pm_01955b8c21d37b53b999e934b53fffae"
}'
  1. Response:
{"id":"12345_pm_01955b8c21d37b53b999e934b53fffae","deleted":true}

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

Sorry, something went wrong.

@AnuthaDev AnuthaDev requested review from a team as code owners March 3, 2025 12:56
Copy link

semanticdiff-com bot commented Mar 3, 2025

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Mar 3, 2025
@AnuthaDev AnuthaDev self-assigned this Mar 4, 2025
@AnuthaDev AnuthaDev added A-core Area: Core flows api-v2 labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows 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.

[FEATURE]: Add Payment Method - Delete endpoint to payment methods session for V2
1 participant