1.9 KiB
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
{$Dena_Path}/app/api/v2/account/deposits.rb
{$Dena_Path}/app/api/v2/account/withdraw.rb
{$Dena_Path}/app/models/withdraw.rb
{$Dena_Path}/app/models/deposit.rb
Commits:
3b189b07
2cd9b4ad
f83585dd
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.
for talking with The Vandar, we implemented a new service named VandarService (vandar_service.rb).
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
this part has a login method that automatically calls when creating object from this service
deposit part:
this part is used for doing deposits
this part has a three methods:
-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
this part has a four methods:
-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