APM-83: Get withdrawal methods (#11)

* added get methods method

* fixed

* fixed schema

* renamed

* renamed to withdrawal
This commit is contained in:
Артем 2022-03-22 11:13:50 +03:00 committed by GitHub
parent 932fa254a0
commit ce0dd21356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 106 additions and 2 deletions

View File

@ -1 +1,17 @@
# Wallet API Specification
## Points of extensions
### Generic destination resources
This allows adding new destination resources which should be handled by _wapi_ in a generic manner.
Provided through vendor extension `x-vality-genericMethod`, which should be a JSON object. You can set it on a model discriminated against `DestinationResource`. When it's set on an object its `type` value will be used to identify this resource's [payment service](https://github.com/valitydev/fistful-proto/blob/eeff5ba9/proto/base.thrift#L167).
At the moment this object may contain following properties:
1. `schema` object, which should be a valid JSON schema.
A `DestinationResource` object following this schema will be interpreted as _generic resource data_ and passed down as part of [`ResourceGeneric.generic.data`](https://github.com/valitydev/fistful-proto/blob/eeff5ba9/proto/base.thrift#L179) thrift model (which will eventually become [`GenericPaymentTool.data`](https://github.com/valitydev/damsel/blob/b25d3365/proto/domain.thrift#L1855)).
When `id` schema property is defined, its value will be used to annotate _generic resource data_ data, namely through [MIME type](https://github.com/valitydev/fistful-proto/blob/eeff5ba9/proto/base.thrift#L174).

View File

@ -1,4 +1,7 @@
description: Платежная система
description: |
Платежная система.
Набор систем, доступных для проведения выплат, можно узнать, вызвав соответствующую [операцию](#operation/getMethods).
type: string
# enum:
# - visa

View File

@ -1,3 +1,7 @@
description: Провайдер электронных денежных средств
description: |
Провайдер электронных денежных средств.
Набор провайдеров, доступных для проведения выплат, можно узнать, вызвав
соответствующую [операцию](#operation/getMethods).
type: string
example: Paypal

View File

@ -0,0 +1,7 @@
description: |
Провайдер сервисов выплат.
Набор провайдеров, доступных для проведения выплат, можно узнать, вызвав
соответствующую [операцию](#operation/getMethods).
type: string
example: YourBankName

View File

@ -0,0 +1,12 @@
type: object
discriminator: method
required:
- method
properties:
method:
description: Метод для проведения выплаты
type: string
enum:
- WithdrawalMethodBankCard
- WithdrawalMethodDigitalWallet
- WithdrawalMethodGeneric

View File

@ -0,0 +1,13 @@
type: object
allOf:
- $ref: '#/definitions/WithdrawalMethod'
- type: object
required:
- paymentSystems
properties:
paymentSystems:
description: Список платежных систем
type: array
items:
x-rebillyMerge:
- $ref: '#/definitions/BankCardPaymentSystem'

View File

@ -0,0 +1,13 @@
type: object
allOf:
- $ref: '#/definitions/WithdrawalMethod'
- type: object
required:
- providers
properties:
providers:
description: Список провайдеров электронных денежных средств
type: array
items:
x-rebillyMerge:
- $ref: '#/definitions/DigitalWalletProvider'

View File

@ -0,0 +1,13 @@
type: object
allOf:
- $ref: '#/definitions/WithdrawalMethod'
- type: object
required:
- providers
properties:
providers:
description: Список провайдеров сервисов выплат
type: array
items:
x-rebillyMerge:
- $ref: '#/definitions/GenericProvider'

View File

@ -0,0 +1,23 @@
get:
summary: Получить выплатные методы доступные по личности владельца
tags:
- Identities
operationId: getWithdrawalMethods
parameters:
- $ref: '#/parameters/requestID'
- $ref: '#/parameters/deadline'
- $ref: '#/parameters/identityID'
responses:
'200':
description: Найденные методы
schema:
type: object
properties:
methods:
type: array
items:
$ref: '#/definitions/WithdrawalMethod'
'400':
$ref: '#/responses/BadRequest'
'401':
$ref: '#/responses/Unauthorized'