MST-214: Add chargebacks search (#33)

This commit is contained in:
Baikov Dmitrii 2020-08-03 18:30:32 +03:00 committed by GitHub
parent d148d025c8
commit b6ff333461
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 209 additions and 0 deletions

View File

@ -0,0 +1,74 @@
type: object
required:
- invoiceId
- paymentId
- chargebackId
- shopID
- createdAt
- bodyAmount
- bodyCurrency
- levyAmount
- levyCurrency
properties:
invoiceId:
description: Идентификатор инвойса
type: string
paymentId:
description: Идентификатор платежа
type: string
chargebackId:
description: Идентификатор чарджбэка
type: string
externalId:
description: Внешний идентификатор
type: string
shopID:
description: Идентификатор магазина
type: string
createdAt:
description: Дата и время создания
type: string
format: date-time
levyAmount:
description: Сумма списываемых средств у чарджбека
type: integer
format: int64
minimum: 1
levyCurrency:
x-merge-obj:
- $ref: '#/definitions/Currency'
bodyAmount:
description: Сумма чарджбэка
type: integer
format: int64
minimum: 1
bodyCurrency:
x-merge-obj:
- $ref: '#/definitions/Currency'
fee:
description: 'Комиссия системы, в минорных денежных единицах'
type: integer
format: int64
minimum: 0
providerFee:
description: 'Комиссия провайдера, в минорных денежных единицах'
type: integer
format: int64
minimum: 0
externalFee:
description: 'Комиссия внешней системы системы, в минорных денежных единицах'
type: integer
format: int64
minimum: 0
status:
x-merge-obj:
- $ref: '#/definitions/ChargebackStatus'
stage:
x-merge-obj:
- $ref: '#/definitions/ChargebackStage'
chargebackReason:
$ref: '#/definitions/ChargebackReason'
content:
$ref: '#/definitions/Content'

View File

@ -0,0 +1,7 @@
description: Категория чарджбэка
type: string
enum:
- fraud
- dispute
- authorisation
- processing_error

View File

@ -0,0 +1,10 @@
description: Данные о причине чарджбэка
type: object
required:
- category
properties:
code:
description: Код категории
type: string
category:
$ref: '#/definitions/ChargebackCategory'

View File

@ -0,0 +1,6 @@
description: Этап прохождения чарджбэка
type: string
enum:
- chargeback
- pre_arbitration
- arbitration

View File

@ -0,0 +1,7 @@
description: Статус чарджбэка
type: string
enum:
- pending
- accepted
- rejected
- cancelled

View File

@ -0,0 +1,9 @@
type: object
properties:
type:
description: Тип данных
type: string
category:
description: Данные
type: string
format: byte

View File

@ -0,0 +1,96 @@
get:
description: Поиск чарджбэков
tags:
- Search
operationId: searchChardgebacks
parameters:
- $ref: '#/parameters/requestID'
- $ref: '#/parameters/deadline'
- $ref: '#/parameters/shopIDQuery'
- $ref: '#/parameters/shopIDs'
- $ref: '#/parameters/fromTime'
- $ref: '#/parameters/toTime'
- $ref: '#/parameters/limit'
- $ref: '#/parameters/offset'
- name: invoiceID
in: query
description: Идентификатор инвойса
required: false
type: string
maxLength: 40
minLength: 1
- name: paymentID
in: query
description: Идентификатор платежа
required: false
type: string
maxLength: 40
minLength: 1
- name: chargebackID
in: query
description: Идентификатор чарджбэка
required: false
type: string
maxLength: 40
minLength: 1
- name: chargebackStatuses
in: query
description: Статусы чарджбэков
required: false
type: array
items:
type: string
enum:
- pending
- accepted
- rejected
- cancelled
- name: chargebackStages
in: query
description: Этапы чарджбэков
required: false
type: array
items:
type: string
enum:
- chargeback
- pre_arbitration
- arbitration
- name: chargebackCategories
in: query
description: Категории чарджбэков
required: false
type: array
items:
type: string
enum:
- fraud
- dispute
- authorisation
- processing_error
- x-merge-obj:
- name: continuationToken
in: query
required: false
- $ref: '#/definitions/ContinuationToken'
responses:
'200':
description: Найденные чарджбэки
schema:
type: object
properties:
totalCount:
type: integer
continuationToken:
x-merge-obj:
- $ref: '#/definitions/ContinuationToken'
result:
type: array
items:
$ref: '#/definitions/Chargeback'
'404':
$ref: '#/responses/NotFound'
'401':
$ref: '#/responses/Unauthorized'
'400':
$ref: '#/responses/DefaultLogicError'