Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added spec for 'incomingPaymentCreated' and schema for 'amount' in webhooks.yaml #2978

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
"build": "pnpm build:deps && pnpm clean && tsc --build tsconfig.json && pnpm copy-files",
"clean": "rm -fr dist/",
"copy-files": "cp src/graphql/schema.graphql dist/graphql/ && cp -r ./src/openapi ./dist/",
"copy-op-schemas": "cp ./node_modules/@interledger/open-payments/dist/openapi/specs/schemas.yaml ./src/openapi/specs/",
"prepack": "pnpm build",
"postinstall": "pnpm copy-op-schemas",
"dev": "ts-node-dev --inspect=0.0.0.0:9229 --respawn --transpile-only --require ./src/telemetry/index.ts src/index.ts"
},
"devDependencies": {
Expand Down
41 changes: 36 additions & 5 deletions packages/backend/src/openapi/specs/webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ info:
servers:
- url: 'https://account-servicing-entity.com/webhooks'
webhooks:
incomingPaymentCreated:
post:
requestBody:
description: Notify account servicing entity that an incoming payment was created.
content:
application/json:
schema:
$ref: '#/components/schemas/incomingPaymentEvent'
responses:
'200':
description: Returns a 200 status to indicate that the data was received successfully.
incomingPaymentCompleted:
post:
requestBody:
Expand Down Expand Up @@ -148,9 +159,9 @@ components:
completed:
type: boolean
incomingAmount:
$ref: ./schemas.yaml#/components/schemas/amount
$ref: '#/components/schemas/amount'
receivedAmount:
$ref: ./schemas.yaml#/components/schemas/amount
$ref: '#/components/schemas/amount'
metadata:
type: object
additionalProperties: true
Expand Down Expand Up @@ -214,9 +225,9 @@ components:
type: string
format: uri
debitAmount:
$ref: ./schemas.yaml#/components/schemas/amount
$ref: '#/components/schemas/amount'
sentAmount:
$ref: ./schemas.yaml#/components/schemas/amount
$ref: '#/components/schemas/amount'
metadata:
type: object
additionalProperties: true
Expand Down Expand Up @@ -293,7 +304,7 @@ components:
type: string
format: date-time
receivedAmount:
$ref: ./schemas.yaml#/components/schemas/amount
$ref: '#/components/schemas/amount'
additionalProperties: false
liquidityEvent:
required:
Expand Down Expand Up @@ -341,3 +352,23 @@ components:
scale:
type: number
additionalProperties: false
amount:
type: object
properties:
value:
type: string
format: uint64
description: 'The value is an unsigned 64-bit integer amount, represented as a string.'
assetCode:
type: string
description: The assetCode is a code that indicates the underlying asset. This SHOULD be an ISO4217 currency code.
assetScale:
type: integer
minimum: 0
maximum: 255
description: The scale of amounts denoted in the corresponding asset code.
required:
- value
- assetCode
- assetScale
additionalProperties: false
Loading