generated from PenaSide/GolangTemplate
docs(swagger): actualize /cart/pay, get /wallet
This commit is contained in:
parent
657db37ff6
commit
3005c87ccf
122
openapi.yaml
122
openapi.yaml
@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Customer - сервис для управления клиентами
|
||||
description: |-
|
||||
@ -396,17 +396,6 @@ paths:
|
||||
security:
|
||||
- Bearer: []
|
||||
description: Запрос на проведение оплаты корзины
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [userId]
|
||||
properties:
|
||||
userId:
|
||||
type: string
|
||||
description: ID для того, чтобы указать сервису оплаты, какой юзер оплатил
|
||||
example: "807f1f77bcf81cd799439011"
|
||||
responses:
|
||||
'200':
|
||||
description: успешная оплата корзины
|
||||
@ -473,70 +462,40 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
post:
|
||||
tags:
|
||||
- wallet
|
||||
summary: Зачислить деньги на кошелёк
|
||||
description: "Прибавляем полученное значение к cash и при необходимости приводим к валюте кошелька"
|
||||
operationId: putMoney
|
||||
security:
|
||||
- Bearer: []
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [cash, currency, userId]
|
||||
properties:
|
||||
cash:
|
||||
type: integer
|
||||
format: int64
|
||||
example: 10000
|
||||
currency:
|
||||
type: string
|
||||
example: "USD"
|
||||
userId:
|
||||
type: string
|
||||
example: "807f1f77bcf81cd799439011"
|
||||
responses:
|
||||
'200':
|
||||
description: успешное внесение денег на кошелёк
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Account"
|
||||
'400':
|
||||
description: Такая валюта не одобрена
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
'404':
|
||||
description: Аккаунт не найден
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
get:
|
||||
tags:
|
||||
- wallet
|
||||
summary: Запрос на получение ссылки на оплату
|
||||
operationId: requestMoney
|
||||
description: >-
|
||||
- Формируем запрос к сервису оплаты, с необходимыми постбэками
|
||||
|
||||
- Получаем ответ от сервиса оплаты с ссылкой на оплату, которую надо передать пользователю
|
||||
|
||||
security:
|
||||
- Bearer: []
|
||||
parameters:
|
||||
- name: cash
|
||||
in: query
|
||||
description: Количество денег
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
default: 10000
|
||||
description: >-
|
||||
- Формируем запрос к сервису оплаты, с необходимыми постбэками
|
||||
- Получаем ответ от сервиса оплаты с ссылкой на оплату, которую надо передать пользователю
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [type, currency, amount]
|
||||
properties:
|
||||
type:
|
||||
$ref: '#/components/schemas/PaymentType'
|
||||
currency:
|
||||
type: string
|
||||
description: "ISO-4217 формат"
|
||||
example: "RUB"
|
||||
amount:
|
||||
type: integer
|
||||
example: 15020
|
||||
bankCard:
|
||||
$ref: '#/components/schemas/BankCard'
|
||||
phoneNumber:
|
||||
type: string
|
||||
example: "79000000000"
|
||||
login:
|
||||
type: string
|
||||
example: "login_test"
|
||||
responses:
|
||||
'200':
|
||||
description: Успешный запрос денег
|
||||
@ -696,6 +655,31 @@ components:
|
||||
type: string
|
||||
example: ООО \"Моя Оборона\"
|
||||
|
||||
BankCard:
|
||||
type: object
|
||||
required: [number, expiryYear, expiryMonth]
|
||||
properties:
|
||||
number:
|
||||
type: string
|
||||
example: "RUB"
|
||||
description: Номер карты
|
||||
expiryYear:
|
||||
type: string
|
||||
example: "21"
|
||||
description: Год истечения срока карты
|
||||
expiryMonth:
|
||||
type: string
|
||||
example: "05"
|
||||
description: Месяц истечения срока карты
|
||||
csc:
|
||||
type: string
|
||||
example: "05"
|
||||
description: Код CVC2 или CVV2, 3 или 4 символа, печатается на обратной стороне карты
|
||||
cardholder:
|
||||
type: string
|
||||
description: Имя владельца карты
|
||||
example: "IVAN IVANOV"
|
||||
|
||||
Wallet:
|
||||
type: object
|
||||
required: [currency, cash, money, purchasesAmount, spent]
|
||||
|
Loading…
Reference in New Issue
Block a user