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

Backend - Credit card - Enable multiple users to register the same credit card #995

Open
NamFra opened this issue Dec 16, 2024 · 0 comments

Comments

@NamFra
Copy link

NamFra commented Dec 16, 2024

Bug Report

Problematic behavior
It's currently not possible to register the same credit card for multiple accounts or users.
This is problematic in the following use cases:

  • An organization wants to pay on behalf of multiple members
  • A user creates a new account and wants to pay with a previously used card

The issue is technical: there is a uniqueness constraint on a field in the credit card model (the token sent by Payzen), which currently prevents us from saving the same card multiple times in the database.

Expected behavior/code
Allow saving the same credit card multiple times in the database.

Environment

  • Joanie version: 2.11.0

Possible Solution
Remove the uniqueness constraint on the token field and replace it with a constraint at the user level. Before implementing this change, we need to assess the impact of this new behavior.
If multiple users want to use the same credit card, there will be as many credit card entries as users in the database.

In pre-production, the same Lyra test cards can be used by different users. Perhaps understanding why they are successfully saved in the database could help resolve this issue?

Additional context/Screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant