Skip to content

Commit

Permalink
feat(payments): modify openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-nicolas committed Nov 7, 2023
1 parent a9e8a6a commit 7347085
Showing 1 changed file with 73 additions and 58 deletions.
131 changes: 73 additions & 58 deletions components/payments/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ paths:
responses:
'200':
$ref: '#/components/responses/ConnectorsConfigs'
/connectors/{connector}:
/connectors/install/{connector}:
post:
summary: Install a connector
tags:
Expand All @@ -265,30 +265,31 @@ paths:
responses:
'204':
$ref: '#/components/responses/NoContent'
/connectors/{connectorId}:
delete:
summary: Uninstall a connector
operationId: uninstallConnector
tags:
- Payments
description: Uninstall a connector by its name.
parameters:
- $ref: '#/components/parameters/Connector'
- $ref: '#/components/parameters/ConnectorID'
responses:
'204':
$ref: '#/components/responses/NoContent'
/connectors/{connector}/config:
/connectors/{connectorId}/config:
get:
summary: Read the config of a connector
operationId: readConnectorConfig
tags:
- Payments
description: Read connector config
parameters:
- $ref: '#/components/parameters/Connector'
- $ref: '#/components/parameters/ConnectorID'
responses:
'200':
$ref: '#/components/responses/ConnectorConfig'
/connectors/{connector}/reset:
/connectors/{connectorId}/reset:
post:
summary: Reset a connector
operationId: resetConnector
Expand All @@ -298,63 +299,38 @@ paths:
Reset a connector by its name.
It will remove the connector and ALL PAYMENTS generated with it.
parameters:
- $ref: '#/components/parameters/Connector'
- $ref: '#/components/parameters/ConnectorID'
responses:
'204':
$ref: '#/components/responses/NoContent'
/connectors/{connector}/tasks:
/connectors/{connectorId}/tasks:
get:
summary: List tasks from a connector
tags:
- Payments
operationId: listConnectorTasks
description: List all tasks associated with this connector.
parameters:
- $ref: '#/components/parameters/Connector'
- $ref: '#/components/parameters/ConnectorID'
- $ref: '#/components/parameters/PageSize'
- $ref: '#/components/parameters/Cursor'
responses:
'200':
$ref: '#/components/responses/Tasks'
/connectors/{connector}/tasks/{taskId}:
/connectors/{connectorId}/tasks/{taskId}:
get:
summary: Read a specific task of the connector
tags:
- Payments
operationId: getConnectorTask
description: Get a specific task associated to the connector.
parameters:
- $ref: '#/components/parameters/Connector'
- $ref: '#/components/parameters/ConnectorID'
- $ref: '#/components/parameters/TaskId'
responses:
'200':
$ref: '#/components/responses/Task'
/connectors/{connector}/transfers:
post:
summary: Transfer funds between Connector accounts
tags:
- Payments
operationId: connectorsTransfer
description: Execute a transfer between two accounts.
parameters:
- $ref: '#/components/parameters/Connector'
requestBody:
$ref: '#/components/requestBodies/Transfer'
responses:
'200':
$ref: '#/components/responses/Transfer'
get:
summary: List transfers and their statuses
tags:
- Payments
operationId: listConnectorsTransfers
description: List transfers
parameters:
- $ref: '#/components/parameters/Connector'
responses:
'200':
$ref: '#/components/responses/Transfers'


# ---------------------- COMPONENTS ----------------------
components:
# ---------------------- PARAMETERS ----------------------
Expand Down Expand Up @@ -417,6 +393,14 @@ components:
description: The account ID.
example: XXX
required: true
ConnectorID:
name: connectorId
in: path
schema:
type: string
description: The connector ID.
example: XXX
required: true
TransferId:
name: transferId
in: path
Expand Down Expand Up @@ -765,9 +749,10 @@ components:
properties:
provider:
$ref: '#/components/schemas/Connector'
enabled:
type: boolean
example: true
name:
type: string
connectorID:
type: string
BankAccountResponse:
type: object
required:
Expand Down Expand Up @@ -880,8 +865,12 @@ components:
StripeConfig:
type: object
required:
- name
- apiKey
properties:
name:
type: string
example: 'My Stripe Account'
pollingPeriod:
type: string
example: '60s'
Expand All @@ -902,8 +891,12 @@ components:
DummyPayConfig:
type: object
required:
- name
- directory
properties:
name:
type: string
example: 'My DummyPay Account'
filePollingPeriod:
type: string
example: '60s'
Expand All @@ -920,8 +913,12 @@ components:
WiseConfig:
type: object
required:
- name
- apiKey
properties:
name:
type: string
example: 'My Wise Account'
apiKey:
type: string
example: 'XXX'
Expand All @@ -934,9 +931,13 @@ components:
ModulrConfig:
type: object
required:
- name
- apiKey
- apiSecret
properties:
name:
type: string
example: 'My Modulr Account'
apiKey:
type: string
example: 'XXX'
Expand All @@ -955,13 +956,17 @@ components:
BankingCircleConfig:
type: object
required:
- name
- username
- password
- endpoint
- authorizationEndpoint
- userCertificate
- userCertificateKey
properties:
name:
type: string
example: 'My Banking Circle Account'
username:
type: string
example: 'XXX'
Expand Down Expand Up @@ -989,10 +994,14 @@ components:
MangoPayConfig:
type: object
required:
- name
- clientID
- apiKey
- endpoint
properties:
name:
type: string
example: 'My MangoPay Account'
pollingPeriod:
type: string
example: '60s'
Expand All @@ -1011,10 +1020,14 @@ components:
MoneycorpConfig:
type: object
required:
- name
- clientID
- apiKey
- endpoint
properties:
name:
type: string
example: 'My Moneycorp Account'
clientID:
type: string
example: 'XXX'
Expand All @@ -1033,9 +1046,13 @@ components:
CurrencyCloudConfig:
type: object
required:
- name
- apiKey
- loginID
properties:
name:
type: string
example: 'My CurrencyCloud Account'
apiKey:
type: string
example: 'XXX'
Expand All @@ -1062,7 +1079,7 @@ components:
- description
- sourceAccountID
- destinationAccountID
- provider
- connectorID
- type
- amount
- asset
Expand All @@ -1087,8 +1104,8 @@ components:
type: string
destinationAccountID:
type: string
provider:
$ref: '#/components/schemas/Connector'
connectorID:
type: string
type:
type: string
enum:
Expand Down Expand Up @@ -1131,7 +1148,7 @@ components:
- id
- createdAt
- country
- provider
- connectorID
properties:
id:
type: string
Expand All @@ -1140,8 +1157,8 @@ components:
format: date-time
country:
type: string
provider:
$ref: '#/components/schemas/Connector'
connectorID:
type: string
iban:
type: string
accountNumber:
Expand All @@ -1156,7 +1173,6 @@ components:
- sourceAccountID
- destinationAccountID
- type
- provider
- status
- initialAmount
- scheme
Expand All @@ -1175,15 +1191,15 @@ components:
type: string
destinationAccountID:
type: string
connectorID:
type: string
type:
type: string
enum:
- PAY-IN
- PAYOUT
- TRANSFER
- OTHER
provider:
$ref: '#/components/schemas/Connector'
status:
$ref: '#/components/schemas/PaymentStatus'
initialAmount:
Expand Down Expand Up @@ -1261,8 +1277,8 @@ components:
required:
- id
- createdAt
- provider
- reference
- connectorID
- defaultCurrency
- defaultAsset
- accountName
Expand All @@ -1274,10 +1290,10 @@ components:
createdAt:
type: string
format: date-time
provider:
$ref: '#/components/schemas/Connector'
reference:
type: string
connectorID:
type: string
defaultCurrency:
type: string
deprecated: true
Expand Down Expand Up @@ -1332,7 +1348,6 @@ components:
format: uuid
connectorId:
type: string
format: uuid
createdAt:
type: string
format: date-time
Expand Down Expand Up @@ -1497,14 +1512,14 @@ components:
type: object
required:
- country
- provider
- connectorID
- name
properties:
country:
type: string
example: GB
provider:
$ref: '#/components/schemas/Connector'
connectorID:
type: string
name:
type: string
example: 'My account'
Expand All @@ -1522,7 +1537,7 @@ components:
- description
- sourceAccountID
- destinationAccountID
- provider
- connectorID
- type
- amount
- asset
Expand All @@ -1540,8 +1555,8 @@ components:
type: string
destinationAccountID:
type: string
provider:
$ref: '#/components/schemas/Connector'
connectorID:
type: string
type:
type: string
enum:
Expand Down

0 comments on commit 7347085

Please sign in to comment.