First-creation-of-Virtual-Card¶
Virtual Card Creation Flow¶
This document outlines the process for creating a virtual card after the account is first created, detailing the key components and interactions across different projects.
1. Event Trigger¶
- Source: Wallet Service.
- Event:
AddCardMessageevent handler. - Action: Sends a request to
ICardIssuerGateway.AddVirtualCard. - Action: Saves the new card into the
Cardtable. - Action: Sends
CardChangedEventevent - Action: Saves the card to firebase
- Action: Updates Card restrictions based default card restrictions
- Action: Publishes AccountAndCardAddedEvent
The ICardIssuerGateway contract is defined in the Minority.Cde.CardIssuer.Contract project.
2. Contract Implementation¶
- Implementations: Both Lithic and Galileo implement the
ICardIssuerGatewaycontract. - Lithic Flow:
- After validation, the Lithic implementation calls the
_lithicProxyService.AddCardendpoint. - Lithic service saves the created card in it's database
- After validation, the Lithic implementation calls the
This endpoint is defined by the ILithicProxyService contract, which is part of the Minority.CardData.Service.Contract project.
3. Service Delegation¶
- Service:
LithicProxyService(located in theMinority.CardData.Serviceproject). - Operation: The
AddCardmethod processes the request. - API Call: It calls
_lithicCdeAccountsApi.PostCardsAsyncto handle the actual card creation on the Lithic platform.
This endpoint _lithicCdeAccountsApi.PostCardsAsync is defined by the ILithicCdeAccountsApi contract, which is part of the Minority.Lithic.Cde.Client.Contract, in Minority.Lithic project.
Summary Diagram¶
sequenceDiagram
participant Wallet as Wallet (Minority.Wallet)
participant ICardIssuerGateway as ICardIssuerGateway (Minority.Cde.CardIssuer.Contract)
participant LithicImpl as LithicCardIssuerGateway (Minority.Lithic)
participant LithicProxyService as LithicProxyService (Minority.CardData.Service)
participant LithicAPI as Lithic CDE Accounts API (Minority.Lithic)
Wallet->>ICardIssuerGateway: AddCardMessage event triggers AddVirtualCard request
ICardIssuerGateway->>LithicImpl: Route to Lithic implementation (after contract validation)
LithicImpl->>LithicProxyService: Call _lithicProxyService.AddCard
LithicProxyService->>LithicAPI: Call _lithicCdeAccountsApi.PostCardsAsync