# Payments Method and Accounts FIGMA: https://www.figma.com/file/rkZ1pOhpN2rwXbzB3nkQIn/daba-mobile-application-screens?node-id=1449%3A4307 ## First Scenario - User hasn't transacted before A bottom sheet pops up with the three options 1. Plaid linking 2. Wire transfer - manual 3. Crypto [## Plaid] The frontend makes a call to the backend to generateLinkToken, the token is returned back to the client. The client uses the linkToken to authenticate with Plaid servers and returns back a publicToken that is then returned to the backend in exchange for an accessToken. The backend then uses the public token to request for the users account details. So the backend can get all the account details and it is stored as type `BANK_ACCOUNT` or `ACH`. _Backend_ We then send the information to INVESTMENT-SERVICE,and if the current campaign is using North Capital as its vendor, we then go ahead and add that bank account to North Capital. **NB** If the campaign has any vendor, we send the ID of the campaign and ID of the user to investment service so we can add the card/bank details to that third party provider. ### When users want to invest Three options are shown to them 1. Connect Bank with Plaid or displays use default payment method If they click on connect with plaid, the [##Plaid] workflow, and after the workflow, an api call is made from the frontend to add the selected bank gotten from workflow to north capital. NOTE: This workflow will not be available if the user has already added (either manually or linked - in the payment method screen) a bank 2. Wire Transfer A call is made on the frontend to get the current DABA LEVEL ACH WIRE DETAILS (With a fallback for default details on the frontend) Also, when the details have been looked at and the customer has indicated that they completed the transfer, then a call is made `createTrade` with an idication that it was manual, with payment method of of `MANUAL_WIRE_TRANSFER` then the trade and trade history is created on the daba level - To be updated by admin when confirmed 3. Crypto A call is made on the frontend to get the current DABA LEVEL CRYPTO DETAILS, ``` walletDetails: { USDT: { walletAddres: "ajdahdiadquhjqk0928304-5=68", base64Image: "adsfuyegr98058473213450-392873456905-43298745" } ETH: { walletAddres: "ajdahdiadquhjqk0928304-5=68", base64Image: "adsfuyegr98058473213450-392873456905-43298745" } } ``` (With a fallback for default details on the frontend) Also, when the details have been looked at and the customer has indicated that they completed the transfer, then a call is made `createTrade` with an idication that it was manual, with paymentMethod of `CRYPTO` then the trade and trade history is created on the daba level - To be updated by admin when confirmed ### What hasn't been figured out - How to verify that a CRYPTO transaction has actually been initiated and all the details are correct - What to do when the user's transferred amount is lower than what was inputted in the trade