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(core): add profile level config to toggle extended card bin #4445

Merged
merged 7 commits into from May 3, 2024

Conversation

Aprabhat19
Copy link
Contributor

@Aprabhat19 Aprabhat19 commented Apr 23, 2024

Type of Change

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

Description

Add profile level config to toggle the display for the extended card bin in Payment Response .

Additional Changes

  • 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?

  • Create a MA and an MCA
  • Make a payment with the toggle for that profile_id as false, as it is default
  • In the response the card_bin_extended field will be null
Screenshot 2024-04-24 at 4 13 09 AM
  • Now set the toggle for that profile_id as true by hitting the following curl:
curl --location 'http://localhost:8080/configs/{profile_id}_enable_extended_card_bin' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{admin_api_key}}' \
--data '{
    "key":"{profile_id}_enable_extended_card_bin",
    "value":"true"
}'
Screenshot 2024-05-02 at 1 06 08 PM

The config will also be stored in the database, to check you can run the following query

 SELECT * FROM configs WHERE key = '{profile_id}_enable_extended_card_bin';
Screenshot 2024-05-02 at 1 07 48 PM
  • Create another payment , now in the Response card_bin_extended field won't be null, as the extended card bin config has been set to true
Screenshot 2024-04-24 at 4 14 50 AM

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
  • I added a CHANGELOG entry if applicable

@Aprabhat19 Aprabhat19 self-assigned this Apr 23, 2024
@Aprabhat19 Aprabhat19 requested a review from a team as a code owner April 23, 2024 23:14
@Aprabhat19 Aprabhat19 added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Apr 23, 2024
@Aprabhat19 Aprabhat19 added this to the April 2024 milestone Apr 23, 2024
@Aprabhat19 Aprabhat19 linked an issue Apr 23, 2024 that may be closed by this pull request
2 tasks
vspecky
vspecky previously approved these changes Apr 29, 2024
vspecky
vspecky previously approved these changes Apr 30, 2024
Narayanbhat166
Narayanbhat166 previously approved these changes May 2, 2024
vspecky
vspecky previously approved these changes May 2, 2024
let card_extended_bin = Some(card_data.card_number.clone().get_card_extended_bin());
let enable_extended_bin =db
.find_config_by_key_unwrap_or(
format!("{}_enable_extended_card_bin", profile_id).as_str(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a helper function to construct this key. Not a blocker.

@bernard-eugine bernard-eugine modified the milestones: April 2024, May 2024 May 3, 2024
@Aprabhat19 Aprabhat19 dismissed stale reviews from vspecky and Narayanbhat166 via 25a9198 May 3, 2024 10:21
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue May 3, 2024
Merged via the queue into main with commit 0304e8e May 3, 2024
9 of 12 checks passed
@Gnanasundari24 Gnanasundari24 deleted the extended-cardbin-config branch May 3, 2024 11:19
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add toggle for extended card bin
6 participants