A credit card model is not linked to a payment provider. If the payment provider is changed than all existing credit card can not be used and will not be recognized by the new payment provider.
Proposal
[x] Add new field for Credit Card model to store the name of the payment_provider that was used to tokenize the credit card.
[x] Update manager method get_card_for_owner
[x] Update the factory with new default value for payment_provider.
[x] Refactor places in code where we can use get_card_for_owner
[x] Find everywhere in the code where handle_notification triggers the creation of the credit card
Purpose
A credit card model is not linked to a payment provider. If the payment provider is changed than all existing credit card can not be used and will not be recognized by the new payment provider.
Proposal
payment_provider
that was used to tokenize the credit card.get_card_for_owner
payment_provider
.get_card_for_owner
handle_notification
triggers the creation of the credit card