hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

feat: add an api for toggling extended card info feature

Open Chethan-rao opened this issue 10 months ago • 0 comments

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?

  1. Create a business profile for a merchant (Default one which gets created during merchant account creation works too)
  2. 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
}'

image

  1. 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

Chethan-rao avatar Apr 23 '24 18:04 Chethan-rao