hyperswitch
hyperswitch copied to clipboard
feat: add an api for toggling extended card info feature
Type of Change
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Description
This PR adds an api under business_profile
domain, to toggle the extended_card_info
feature with admin_api_key
as auth.
This PR also includes refactoring of business_profile
updation approach.
Additional Changes
- [ ] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
Motivation and Context
How did you test it?
- Create a business profile for a merchant (Default one which gets created during merchant account creation works too)
- Toggle extended card info feature
curl --location 'http://localhost:8080/account/:merchant_id/business_profile/:profile_id/toggle_extended_card_info' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"enabled": true
}'
- For verifying, u could check the db if the feature is toggled using below query
SELECT is_extended_card_info_enabled FROM business_profile WHERE profile_id = 'profile_id';
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