Skip to content

chore(payment_methods_v2): fingerprint changes for card #7692

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ShivanshMathurJuspay
Copy link
Contributor

@ShivanshMathurJuspay ShivanshMathurJuspay commented Apr 2, 2025

Type of Change

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

Description

We were creating fingerprint on vault side for a card based on card number and expire data , issue was arriving when same card number was there but different expire information for the same customer , now a new fingerprint ID was getting generated.
Hence was being added as a new payment method in database for the same card number but changed metadata ( exp month, exp year )

To handle this , a new field is being added as seconday_fingerprint_id for maintaining the fingerprint based on card number and handle the updation of the metadata information based on the field

We can check for both the primary and secondary fingerprint and based on the result of both the fingerprint can create a new Payment Method ID or update an already existing one.

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?

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

@ShivanshMathurJuspay ShivanshMathurJuspay requested review from a team as code owners April 2, 2025 08:39
Copy link

semanticdiff-com bot commented Apr 2, 2025

@hyperswitch-bot hyperswitch-bot bot added the M-database-changes Metadata: This PR involves database schema changes label Apr 2, 2025
@ShivanshMathurJuspay ShivanshMathurJuspay self-assigned this Apr 2, 2025
@ShivanshMathurJuspay ShivanshMathurJuspay changed the title chore( payment method v2 ): fingerprint changes for card chore(payment_methods_v2): fingerprint changes for card Apr 2, 2025
@ShivanshMathurJuspay ShivanshMathurJuspay linked an issue Apr 2, 2025 that may be closed by this pull request
2 tasks
@Narayanbhat166
Copy link
Member

@ShivanshMathurJuspay , can you add a clear description as to why this change is required? you can update the content in motivation and context subheading.

@ShivanshMathurJuspay
Copy link
Contributor Author

@ShivanshMathurJuspay , can you add a clear description as to why this change is required? you can update the content in motivation and context subheading.

@Narayanbhat166 have added the context of the change in the issue attached to the PR.

Copy link
Member

@NishantJoshi00 NishantJoshi00 left a comment

Choose a reason for hiding this comment

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

Looks good overall.

I am not able to figure out when it will be set and how are we planning to use it.

Specifically the motivation for this.

@prasunna09
Copy link
Contributor

Looks good overall.

I am not able to figure out when it will be set and how are we planning to use it.

Specifically the motivation for this.

@NishantJoshi00 , Currently the fingerprint is generated in card number + expiry. this secondary fingerprint is generated only on card number. So if there is any change in expiry for same card number, secondary finger print will be same and primary fingerprint will be modified, this way the deduplication logic is handled by application.

jarnura
jarnura previously approved these changes Apr 7, 2025
NishantJoshi00
NishantJoshi00 previously approved these changes Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Secondary fingerprint id creation for vaulting cards
5 participants