58 lines
2.0 KiB
Markdown
58 lines
2.0 KiB
Markdown
# Withdraw: Fiat
|
|
###### Sprint: 5
|
|
|
|
### Outcome:
|
|
Users can do fiat withdrawal with the Help of the Vandar service.
|
|
|
|
### Implementation description:
|
|
|
|
#### Endpoints:
|
|
POST {$domain}/api/v2/peatio/account/withdraws/fiat <br/>
|
|
POST {$domain}/api/v2/peatio/account/withdraws/confirm
|
|
#### File destination:
|
|
{$Dena_Path}/app/api/v2/account/withdraws.rb
|
|
|
|
#### Commits:
|
|
2cd9b4ad<br />
|
|
cc7ce09c<br />
|
|
2826a52c<br />
|
|
b9154ef8<br />
|
|
79d4b137<br />
|
|
807f350b<br />
|
|
638b493c<br />
|
|
7769e86a<br />
|
|
14fdfd2a<br />
|
|
#### What did we implement:
|
|
we implemented a new client route for user, to they can withdraw their money after entering valid 2fa and also,
|
|
auth code that was sent to the email
|
|
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
|
|
Title: Withdraw Fiat
|
|
|
|
note over User,Ranj:note parameter is optioanl
|
|
User->>Ranj:amount, iban, currency, **note**
|
|
Ranj->>Dena:POST: after client side checking
|
|
Dena->>Ranj:4xx if lose any required parameters
|
|
note over Dena,Vandar:The Vandar service has own documentation
|
|
Dena->>Ranj:4xx if the config variable: **ENABLE_ACCOUNT_WITHDRAWAL_API** is FALSE
|
|
Dena->>Ranj:4xx if enter 2fa code wrong (will be check if 2fa is activated before)
|
|
Dena->>Ranj:4xx if entered IBAN not exist in current user valid IBAN list
|
|
Dena->>User:2xx withdraw record created and send otp to his or her mail
|
|
Ranj->>User:Ask OTP code for confirming
|
|
User-->>Ranj:if OTP code not received, try for resend after 120 seconds
|
|
Ranj-->>Dena: Ask for sending OTP code again
|
|
Dena-->>User:2xx send otp to his or her email
|
|
User->>Ranj: enter OTP code
|
|
Ranj->>Dena:Post : OTP code for checking
|
|
Dena->>Ranj:4xx if OTP code expired
|
|
Dena->>Vandar:2xx account balance locked
|
|
Dena->>Vandar:POST track_id, amount, IBAN
|
|
Vandar->>Dena:200 new withdraw with transaction_id was created for sending the Bank
|
|
Dena->>Ranj:withdraw will be rejected if the status of the Vandar response is false \n or withdraw will be confirmed and updated transaction_id if the status of the response is true
|
|
Ranj->>User: show The vandar response
|
|
|
|
```
|