Merge pull request #6 from rbkmoney/ft/add-load-data-methods

Add new methods for load data
This commit is contained in:
Kostya 2021-10-27 14:35:54 +03:00 committed by GitHub
commit a0432bd094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 346 additions and 64 deletions

View File

@ -0,0 +1,6 @@
type: object
properties:
chargebacks:
type: array
items:
$ref: '../schemas/Chargeback.yaml'

View File

@ -0,0 +1,6 @@
type: object
properties:
fraudPayments:
type: array
items:
$ref: '../schemas/FraudPayment.yaml'

View File

@ -3,4 +3,4 @@ required:
- context
properties:
context:
$ref: './PaymentContext.yaml'
$ref: '../schemas/PaymentContext.yaml'

View File

@ -0,0 +1,6 @@
type: object
properties:
paymentsChanges:
type: array
items:
$ref: '../schemas/PaymentChange.yaml'

View File

@ -0,0 +1,6 @@
type: object
properties:
refunds:
type: array
items:
$ref: '../schemas/Refund.yaml'

View File

@ -0,0 +1,6 @@
type: object
properties:
withdrawals:
type: array
items:
$ref: '../schemas/Withdrawal.yaml'

View File

@ -29,3 +29,9 @@ properties:
type: string
minLength: 1
maxLength: 200
cardType:
description: Тип карты
$ref: './CardType.yaml'
paymentSystem:
description: Платежная система
type: string

View File

@ -0,0 +1,4 @@
type: string
enum:
- 'debit'
- 'credit'

View File

@ -0,0 +1,44 @@
description: Информация по чарджбеку
required:
- cashInfo
- bankCard
- merchantInfo
- id
- paymentId
- payerType
- status
- category
- chargebackCode
properties:
id:
description: Идентификатор чарджбека
type: string
paymentId:
description: Идентификатор платежа
type: string
eventTime:
description: Дата и время создания
type: string
format: date-time
merchantInfo:
$ref: './MerchantInfo.yaml'
bankCard:
$ref: './BankCard.yaml'
cashInfo:
$ref: './CashInfo.yaml'
providerInfo:
$ref: './ProviderInfo.yaml'
payerInfo:
$ref: './UserInfo.yaml'
payerType:
description: Тип плательщика
$ref: './PayerType.yaml'
status:
description: Статус чарджа
$ref: './ChargebackStatus.yaml'
category:
description: Категория
$ref: './ChargebackCategory.yaml'
chargebackCode:
description: Тип плательщика
type: string

View File

@ -0,0 +1,6 @@
type: string
enum:
- 'fraud'
- 'dispute'
- 'authorization'
- 'processing_error'

View File

@ -0,0 +1,5 @@
type: string
enum:
- 'accepted'
- 'rejected'
- 'cancelled'

View File

@ -0,0 +1,11 @@
description: Информация по ошибке
required:
- errorCode
properties:
errorCode:
description: Код ошибки
type: string
errorMessage:
description: Описание ошибки
type: string

View File

@ -0,0 +1,19 @@
description: Информация по мошеннической операции
required:
- paymentContext
- paymentStatus
- eventTime
properties:
payemntId:
description: Идентификатор платежа
type: string
eventTime:
description: Дата и время создания
type: string
format: date-time
type:
description: Тип мошенничества
type: string
comment:
description: Комментарий
type: string

View File

@ -1,25 +0,0 @@
description: P2p контекст
required:
- cashInfo
- bankCard
- transferId
- identityId
properties:
payerInfo:
$ref: './UserInfo.yaml'
cashInfo:
$ref: './CashInfo.yaml'
sender:
$ref: './BankCard.yaml'
receiver:
$ref: './BankCard.yaml'
transferId:
description: Идентификатор перевода
type: string
identityId:
description: Идентификатор мерчанта
type: string
createdAt:
description: Дата и время создания
type: string
format: date-time

View File

@ -1,6 +0,0 @@
type: object
required:
- context
properties:
context:
$ref: './P2pContext.yaml'

View File

@ -0,0 +1,16 @@
description: Изменения по платежу
required:
- paymentContext
- paymentStatus
- eventTime
properties:
paymentContext:
$ref: './PaymentContext.yaml'
paymentStatus:
$ref: './PaymentStatus.yaml'
error:
$ref: './Error.yaml'
eventTime:
description: Дата и время создания
type: string
format: date-time

View File

@ -7,6 +7,9 @@ required:
- paymentId
- payerType
properties:
id:
description: Идентификатор платежа
type: string
payerInfo:
$ref: './UserInfo.yaml'
cashInfo:
@ -15,6 +18,8 @@ properties:
$ref: './BankCard.yaml'
merchantInfo:
$ref: './MerchantInfo.yaml'
providerInfo:
$ref: './ProviderInfo.yaml'
mobile:
description: Признак мобильного платежа
type: boolean
@ -23,12 +28,6 @@ properties:
description: Признак рекурентного платежа
type: boolean
default: false
invoiceId:
description: Идентификатор счета
type: string
paymentId:
description: Идентификатор платежа
type: string
payerType:
description: Тип плательщика
$ref: './PayerType.yaml'

View File

@ -0,0 +1,8 @@
type: string
enum:
- 'pending'
- 'processed'
- 'captured'
- 'cancelled'
- 'failed'
- 'unknown'

View File

@ -0,0 +1,17 @@
description: Информация о мерчанте
required:
- providerId
- terminalId
properties:
providerId:
description: Идентификатор провайдера
type: string
terminalId:
description: Идентификатор терминала
type: string
country:
description: 'Страна провайдера, alpha-3 код по стандарту [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1)'
type: string
pattern: '^[A-Z]{3}$'
example: "RUS"

View File

@ -0,0 +1,38 @@
description: Информация по возврату
required:
- cashInfo
- bankCard
- merchantInfo
- id
- paymentId
- payerType
- status
properties:
id:
description: Идентификатор возврата
type: string
paymentId:
description: Идентификатор платежа
type: string
eventTime:
description: Дата и время создания
type: string
format: date-time
merchantInfo:
$ref: './MerchantInfo.yaml'
bankCard:
$ref: './BankCard.yaml'
cashInfo:
$ref: './CashInfo.yaml'
providerInfo:
$ref: './ProviderInfo.yaml'
payerInfo:
$ref: './UserInfo.yaml'
payerType:
description: Тип плательщика
$ref: './PayerType.yaml'
status:
description: Статус возврата
$ref: './RefundStatus.yaml'
error:
$ref: './Error.yaml'

View File

@ -0,0 +1,4 @@
type: string
enum:
- 'succeeded'
- 'failed'

View File

@ -6,3 +6,5 @@ properties:
type: string
fingerprint:
type: string
phone:
type: string

View File

@ -0,0 +1,29 @@
description: Информация по выплате
required:
- cashInfo
- bankCard
- id
- accountId
- status
properties:
id:
description: Идентификатор выплаты
type: string
eventTime:
description: Дата и время создания
type: string
format: date-time
bankCard:
$ref: './BankCard.yaml'
cashInfo:
$ref: './CashInfo.yaml'
providerInfo:
$ref: './ProviderInfo.yaml'
accountId:
description: Номер счета
type: string
status:
description: Статус выплаты
$ref: './WithdrawalStatus.yaml'
error:
$ref: './Error.yaml'

View File

@ -0,0 +1,5 @@
type: string
enum:
- 'pending'
- 'succeeded'
- 'failed'

View File

@ -13,18 +13,28 @@ info:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
security:
- bearer: []
- bearer: [ ]
tags:
- name: inspector
x-displayName: Инспектор
- name: load-data
x-displayName: Загрузка исторических данных
- name: error-codes
x-displayName: Коды ошибок
description:
$ref: './docs/error-codes.md'
paths:
/fraudbusters/inspectPayment:
/fraudbusters/inspect-payment:
$ref: ./paths/inspectPayment.yaml
/fraudbusters/inspectP2p:
$ref: ./paths/inspectP2p.yaml
/fraudbusters/chargebacks:
$ref: ./paths/chargebacks.yaml
/fraudbusters/fraud-payments:
$ref: ./paths/fraudPayments.yaml
/fraudbusters/payments:
$ref: ./paths/payments.yaml
/fraudbusters/refunds:
$ref: ./paths/refunds.yaml
/fraudbusters/withdrawals:
$ref: ./paths/withdrawals.yaml
servers:
- url: 'https://api.rbk.money/org/v1'

View File

@ -0,0 +1,16 @@
post:
summary: Загрузка чарджбеков
operationId: insertChargebacks
tags:
- load-data
requestBody:
content:
application/json:
schema:
$ref: '../components/requests/ChargebacksRequest.yaml'
responses:
'201':
description: Чарджбеки успешно сохранены
'400':
$ref: '../components/responses/BadResponse.yaml'

View File

@ -0,0 +1,16 @@
post:
summary: Загрузка списка мошеннических операций
operationId: insertFraudPayments
tags:
- load-data
requestBody:
content:
application/json:
schema:
$ref: '../components/requests/FraudPaymentsRequest.yaml'
responses:
'201':
description: Мошеннические операции успешно сохранены
'400':
$ref: '../components/responses/BadResponse.yaml'

View File

@ -1,19 +0,0 @@
post:
summary: Проверка п2п перевода
operationId: inspectP2p
tags:
- inspector
requestBody:
content:
application/json:
schema:
$ref: '../components/schemas/P2pInspectRequest.yaml'
responses:
'201':
description: Пользователь вступил в организацию
content:
application/json:
schema:
$ref: '../components/responses/RiskScoreListResult.yaml'
'400':
$ref: '../components/responses/BadRequest.yaml'

View File

@ -7,14 +7,14 @@ post:
content:
application/json:
schema:
$ref: '../components/schemas/PaymentInspectRequest.yaml'
$ref: '../components/requests/PaymentInspectRequest.yaml'
responses:
'201':
description: Пользователь вступил в организацию
description: Результат проверки риска
content:
application/json:
schema:
$ref: '../components/responses/RiskScoreResult.yaml'
'400':
$ref: '../components/responses/BadRequest.yaml'
$ref: '../components/responses/BadResponse.yaml'

View File

@ -0,0 +1,15 @@
post:
summary: Загрузка изменений по платежу
operationId: insertPaymentsChanges
tags:
- load-data
requestBody:
content:
application/json:
schema:
$ref: '../components/requests/PaymentsChangesRequest.yaml'
responses:
'201':
description: Изменения по платежу успешно сохранены
'400':
$ref: '../components/responses/BadResponse.yaml'

View File

@ -0,0 +1,16 @@
post:
summary: Загрузка результатов возвратов
operationId: insertRefunds
tags:
- load-data
requestBody:
content:
application/json:
schema:
$ref: '../components/requests/RefundsRequest.yaml'
responses:
'201':
description: Возвраты успешно загружены
'400':
$ref: '../components/responses/BadResponse.yaml'

View File

@ -0,0 +1,16 @@
post:
summary: Загрузка результатов выплаты
operationId: insertWithdrawals
tags:
- load-data
requestBody:
content:
application/json:
schema:
$ref: '../components/requests/WithdrawalsRequest.yaml'
responses:
'201':
description: Выплаты успешно загружены
'400':
$ref: '../components/responses/BadResponse.yaml'