Files
Dena/docs/zagros/vandar_banking/vandar.md
2026-08-13 19:50:53 +03:30

53 lines
1.9 KiB
Markdown

# Vandar Service
###### Sprint: 5
### Outcome:
users can deposit fiat and withdraw fiat by connection to the Vandar
### Implementation description:
#### File destination:
{$Dena_Path}/app/services/vandar_service.rb<br />
{$Dena_Path}/app/api/v2/account/deposits.rb<br />
{$Dena_Path}/app/api/v2/account/withdraw.rb<br />
{$Dena_Path}/app/models/withdraw.rb<br />
{$Dena_Path}/app/models/deposit.rb<br />
#### Commits:
3b189b07<br/>
2cd9b4ad<br/>
f83585dd<br/>
b832b0fb
#### What did we implement:
in the Opendax, there is no way to deposit or withdraw for fiat,
so we use the Vandar as a third party to connect real banks for deposit and withdraws.<br />
for talking with The Vandar, we implemented a new service named VandarService (vandar_service.rb).<br />
VandarService has four part, Login, Deposit, Withdraw, Transaction
##### login part:
this part is used for login in the Vandar with mobile and password that these two must exist in the config file<br />
this part has a `login` method that automatically calls when creating object from this service
##### deposit part:
this part is used for doing deposits<br />
this part has a three methods:<br />
-`generate_token`: use for generate unique Bank Gateway token
-`transaction`: use for finding specific deposit in the Vandar
-`verify`: use for verify specific deposit in the Vandar
##### withdraw part:
this part is used for doing withdraws<br />
this part has a four methods:<br />
-`list_withdraw`: use for listing withdraws (never use in process)
-`info_withdraw`: use for get specific withdraw information from the Vandar
-`delete_withdraw`: use for delete specific withdraw in the Vandar (never use in process)
##### transaction part:
- `list_transactions`: use for listing transaction with fromDate and toDate as parameters (use it in withdraw Job)
#### note:
we use Faraday Gem to send request to vandar