hyperswitch
hyperswitch copied to clipboard
feat: add support for merchant to pass public key and ttl for encrypting payload
Type of Change
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Description
This PR adds support for merchant to pass his public key as well as ttl using update endpoint of business profile. The config passed is stored in business profile table as JSONB.
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)
- Use update endpoint of business profile to pass config.
curl --location 'http://localhost:8080/account/:merchant_id/business_profile/:profile_id' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"extended_card_info_config": {
"public_key": "pub_key_1",
"ttl_in_secs": 60
}
}'
- For verifying, u could check the db if the config is stored in
extended_card_info_config
column inbusiness_profile
table using below query
SELECT extended_card_info_config 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