mirror of
https://github.com/valitydev/swag-wallets.git
synced 2024-11-06 10:55:21 +00:00
FF-160: Add w2w transfer (#60)
* added w2w transfer * added wallet grant * renamed wallet grant * fixed * added desc
This commit is contained in:
parent
c715d9cb8d
commit
240cee4a9a
30
api/wallet/spec/definitions/W2WTransfer.yaml
Normal file
30
api/wallet/spec/definitions/W2WTransfer.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
description: Данные перевода
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- createdAt
|
||||||
|
- body
|
||||||
|
- sender
|
||||||
|
- receiver
|
||||||
|
- status
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
x-rebillyMerge:
|
||||||
|
- $ref: '#/definitions/W2WTransferID'
|
||||||
|
createdAt:
|
||||||
|
description: Дата и время создания
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
body:
|
||||||
|
x-rebillyMerge:
|
||||||
|
- $ref: '#/definitions/Asset'
|
||||||
|
- description: Сумма операции
|
||||||
|
sender:
|
||||||
|
$ref: '#/definitions/WalletID'
|
||||||
|
receiver:
|
||||||
|
$ref: '#/definitions/WalletID'
|
||||||
|
status:
|
||||||
|
$ref: '#/definitions/W2WTransferStatus'
|
||||||
|
externalID:
|
||||||
|
x-rebillyMerge:
|
||||||
|
- $ref: '#/definitions/ExternalID'
|
11
api/wallet/spec/definitions/W2WTransferFailure.yaml
Normal file
11
api/wallet/spec/definitions/W2WTransferFailure.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
description: |
|
||||||
|
[Ошибка, возникшая в процессе проведения перевода](#tag/Error-Codes)
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- code
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
description: Основной код ошибки
|
||||||
|
type: string
|
||||||
|
subError:
|
||||||
|
$ref: '#/definitions/SubFailure'
|
5
api/wallet/spec/definitions/W2WTransferID.yaml
Normal file
5
api/wallet/spec/definitions/W2WTransferID.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
description: Идентификатор перевода
|
||||||
|
type: string
|
||||||
|
example: "10a0b68D3E21"
|
||||||
|
maxLength: 40
|
||||||
|
minLength: 1
|
18
api/wallet/spec/definitions/W2WTransferParameters.yaml
Normal file
18
api/wallet/spec/definitions/W2WTransferParameters.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
description: Параметры создания перевода
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- sender
|
||||||
|
- receiver
|
||||||
|
- body
|
||||||
|
properties:
|
||||||
|
sender:
|
||||||
|
$ref: '#/definitions/WalletID'
|
||||||
|
receiver:
|
||||||
|
$ref: '#/definitions/WalletID'
|
||||||
|
body:
|
||||||
|
x-rebillyMerge:
|
||||||
|
- $ref: '#/definitions/Asset'
|
||||||
|
- description: Сумма перевода
|
||||||
|
externalID:
|
||||||
|
x-rebillyMerge:
|
||||||
|
- $ref: '#/definitions/ExternalID'
|
26
api/wallet/spec/definitions/W2WTransferStatus.yaml
Normal file
26
api/wallet/spec/definitions/W2WTransferStatus.yaml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- status
|
||||||
|
properties:
|
||||||
|
status:
|
||||||
|
description: |
|
||||||
|
Статус перевода денежных средств.
|
||||||
|
|
||||||
|
| Значение | Пояснение |
|
||||||
|
| ----------- | ------------------------------------------ |
|
||||||
|
| `Pending` | Перевод в процессе выполнения |
|
||||||
|
| `Succeeded` | Перевод средств произведён успешно |
|
||||||
|
| `Failed` | Перевод средств завершился неудачей |
|
||||||
|
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- Pending
|
||||||
|
- Succeeded
|
||||||
|
- Failed
|
||||||
|
failure:
|
||||||
|
x-rebillyMerge:
|
||||||
|
- description: |
|
||||||
|
> Если `status` == `Failed`
|
||||||
|
|
||||||
|
Пояснение причины неудачи
|
||||||
|
- $ref: '#/definitions/W2WTransferFailure'
|
33
api/wallet/spec/paths/w2w@transfers.yaml
Normal file
33
api/wallet/spec/paths/w2w@transfers.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
post:
|
||||||
|
description: Создать перевод
|
||||||
|
tags:
|
||||||
|
- W2W
|
||||||
|
operationId: createW2WTransfer
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/parameters/requestID'
|
||||||
|
- $ref: '#/parameters/deadline'
|
||||||
|
- name: transferParams
|
||||||
|
in: body
|
||||||
|
description: 'Параметры создания перевода'
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/W2WTransferParameters'
|
||||||
|
responses:
|
||||||
|
'202':
|
||||||
|
description: Перевод запущен
|
||||||
|
headers:
|
||||||
|
Location:
|
||||||
|
description: URI запущенного перевода
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/W2WTransfer'
|
||||||
|
'400':
|
||||||
|
$ref: '#/responses/BadRequest'
|
||||||
|
'401':
|
||||||
|
$ref: '#/responses/Unauthorized'
|
||||||
|
'409':
|
||||||
|
$ref: '#/responses/ConflictRequest'
|
||||||
|
'422':
|
||||||
|
description: Неверные входные данные для перевода
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/InvalidOperationParameters'
|
20
api/wallet/spec/paths/w2w@transfers@{w2wTransferID}.yaml
Normal file
20
api/wallet/spec/paths/w2w@transfers@{w2wTransferID}.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
get:
|
||||||
|
description: Получить состояние перевода.
|
||||||
|
tags:
|
||||||
|
- W2W
|
||||||
|
operationId: getW2WTransfer
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/parameters/requestID'
|
||||||
|
- $ref: '#/parameters/deadline'
|
||||||
|
- $ref: '#/parameters/w2wTransferID'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Найденный перевод
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/W2WTransfer'
|
||||||
|
'400':
|
||||||
|
$ref: '#/responses/BadRequest'
|
||||||
|
'401':
|
||||||
|
$ref: '#/responses/Unauthorized'
|
||||||
|
'404':
|
||||||
|
$ref: '#/responses/NotFound'
|
@ -321,6 +321,15 @@ parameters:
|
|||||||
maxLength: 40
|
maxLength: 40
|
||||||
minLength: 1
|
minLength: 1
|
||||||
|
|
||||||
|
w2wTransferID:
|
||||||
|
name: w2wTransferID
|
||||||
|
in: path
|
||||||
|
description: Идентификатор перевода
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
maxLength: 40
|
||||||
|
minLength: 1
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
|
|
||||||
- name: Providers
|
- name: Providers
|
||||||
@ -360,8 +369,12 @@ tags:
|
|||||||
description: ""
|
description: ""
|
||||||
|
|
||||||
- name: P2P
|
- name: P2P
|
||||||
x-displayName: Переводы
|
x-displayName: Переводы вне платформы
|
||||||
description: "Переводы средств между людьми"
|
description: "Переводы средств между людьми с использованием инструментов вне платформы"
|
||||||
|
|
||||||
|
- name: W2W
|
||||||
|
x-displayName: Переводы внутри платформы
|
||||||
|
description: "Переводы средств между кошельками внутри платформы"
|
||||||
|
|
||||||
- name: Webhooks
|
- name: Webhooks
|
||||||
x-displayName: Webhooks
|
x-displayName: Webhooks
|
||||||
|
Loading…
Reference in New Issue
Block a user