diff --git a/README.md b/README.md index 5876e09..a504386 100644 --- a/README.md +++ b/README.md @@ -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). \ No newline at end of file diff --git a/api/payres/spec/definitions/BankCardPaymentSystem.yaml b/api/payres/spec/definitions/BankCardPaymentSystem.yaml index b368b11..2b3e3ca 100644 --- a/api/payres/spec/definitions/BankCardPaymentSystem.yaml +++ b/api/payres/spec/definitions/BankCardPaymentSystem.yaml @@ -1,4 +1,7 @@ -description: Платежная система +description: | + Платежная система. + + Набор систем, доступных для проведения выплат, можно узнать, вызвав соответствующую [операцию](#operation/getMethods). type: string # enum: # - visa diff --git a/api/wallet/spec/definitions/DigitalWalletProvider.yaml b/api/wallet/spec/definitions/DigitalWalletProvider.yaml index 1a16c12..d4f807c 100644 --- a/api/wallet/spec/definitions/DigitalWalletProvider.yaml +++ b/api/wallet/spec/definitions/DigitalWalletProvider.yaml @@ -1,3 +1,7 @@ -description: Провайдер электронных денежных средств +description: | + Провайдер электронных денежных средств. + + Набор провайдеров, доступных для проведения выплат, можно узнать, вызвав + соответствующую [операцию](#operation/getMethods). type: string example: Paypal diff --git a/api/wallet/spec/definitions/GenericProvider.yaml b/api/wallet/spec/definitions/GenericProvider.yaml new file mode 100644 index 0000000..ebb0117 --- /dev/null +++ b/api/wallet/spec/definitions/GenericProvider.yaml @@ -0,0 +1,7 @@ +description: | + Провайдер сервисов выплат. + + Набор провайдеров, доступных для проведения выплат, можно узнать, вызвав + соответствующую [операцию](#operation/getMethods). +type: string +example: YourBankName diff --git a/api/wallet/spec/definitions/WithdrawalMethod.yaml b/api/wallet/spec/definitions/WithdrawalMethod.yaml new file mode 100644 index 0000000..113022c --- /dev/null +++ b/api/wallet/spec/definitions/WithdrawalMethod.yaml @@ -0,0 +1,12 @@ +type: object +discriminator: method +required: + - method +properties: + method: + description: Метод для проведения выплаты + type: string + enum: + - WithdrawalMethodBankCard + - WithdrawalMethodDigitalWallet + - WithdrawalMethodGeneric \ No newline at end of file diff --git a/api/wallet/spec/definitions/WithdrawalMethodBankCard.yaml b/api/wallet/spec/definitions/WithdrawalMethodBankCard.yaml new file mode 100644 index 0000000..c71a4fc --- /dev/null +++ b/api/wallet/spec/definitions/WithdrawalMethodBankCard.yaml @@ -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' \ No newline at end of file diff --git a/api/wallet/spec/definitions/WithdrawalMethodDigitalWallet.yaml b/api/wallet/spec/definitions/WithdrawalMethodDigitalWallet.yaml new file mode 100644 index 0000000..460cdd7 --- /dev/null +++ b/api/wallet/spec/definitions/WithdrawalMethodDigitalWallet.yaml @@ -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' \ No newline at end of file diff --git a/api/wallet/spec/definitions/WithdrawalMethodGeneric.yaml b/api/wallet/spec/definitions/WithdrawalMethodGeneric.yaml new file mode 100644 index 0000000..83f7c57 --- /dev/null +++ b/api/wallet/spec/definitions/WithdrawalMethodGeneric.yaml @@ -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' \ No newline at end of file diff --git a/api/wallet/spec/paths/identities@{identityID}@withdrawal-methods.yaml b/api/wallet/spec/paths/identities@{identityID}@withdrawal-methods.yaml new file mode 100644 index 0000000..f0777e2 --- /dev/null +++ b/api/wallet/spec/paths/identities@{identityID}@withdrawal-methods.yaml @@ -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'