hyperswitch
hyperswitch copied to clipboard
refactor(payment_methods): update payment method db operations to include multi-key validation
Type of Change
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Description
Currently, payment method apis like retrieve, update and delete are happening in db based on payment_method_id
only. This PR refactors it to include all 3 keys (merchant_id, customer_id and payment_method_id) for validation in retrieving, updating and deleting payment method.
Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
Motivation and Context
How did you test it?
This PR can be tested in the same way as https://github.com/juspay/hyperswitch/pull/3146.
Checklist
- [x] I formatted the code
cargo +nightly fmt --all
- [x] I addressed lints thrown by
cargo clippy
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a CHANGELOG entry if applicable