Skip to content

Commit

Permalink
Schemas for payment endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuunguyeen committed Dec 12, 2023
1 parent bacf310 commit aa9f191
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 1 deletion.
2 changes: 1 addition & 1 deletion maas-schemas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maas-schemas",
"version": "21.0.0",
"version": "21.1.0",
"description": "Schemas for MaaS infrastructure",
"main": "index.js",
"engine": {
Expand Down
21 changes: 21 additions & 0 deletions maas-schemas/schemas/tsp/payments-initiate/request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$id": "https://schemas.maas.global/tsp/payments-initiate/request.json",
"description": "Request schema for creating payment through TSP api",
"type": "object",
"properties": {
"tspId": {
"$ref": "https://schemas.maas.global/core/booking.json#/definitions/tspId"
},
"paymentAmount": {
"type": "number"
}
},
"required": ["tspId", "paymentAmount"],
"additionalProperties": false,
"examples": [
{
"tspId": "00000000-cafe-cafe-cafe-cafecafecafe",
"paymentAmount": 2405
}
]
}
25 changes: 25 additions & 0 deletions maas-schemas/schemas/tsp/payments-initiate/response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$id": "https://schemas.maas.global/tsp/payments-initiate/request.json",
"description": "Response schema for creating payment through TSP api",
"type": "object",
"properties": {
"tspId": {
"$ref": "https://schemas.maas.global/core/booking.json#/definitions/tspId"
},
"amount": {
"type": "number"
},
"paymentStatus": {
"type": "string"
}
},
"required": ["tspId", "amount", "paymentStatus"],
"additionalProperties": false,
"examples": [
{
"tspId": "00000000-cafe-cafe-cafe-cafecafecafe",
"amount": 2405,
"paymentStatus": "CONFIRMED"
}
]
}
17 changes: 17 additions & 0 deletions maas-schemas/schemas/tsp/payments-retrieve/request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$id": "https://schemas.maas.global/tsp/payments-retrieve/request.json",
"description": "Request schema for retrieving a TSP payment from TSP api",
"type": "object",
"properties": {
"tspId": {
"$ref": "https://schemas.maas.global/core/booking.json#/definitions/tspId"
}
},
"required": ["tspId"],
"additionalProperties": false,
"examples": [
{
"tspId": "00000000-cafe-cafe-cafe-cafecafecafe"
}
]
}
25 changes: 25 additions & 0 deletions maas-schemas/schemas/tsp/payments-retrieve/response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$id": "https://schemas.maas.global/tsp/payments-retrieve/request.json",
"description": "Response schema for retrieving a TSP payment from TSP api",
"type": "object",
"properties": {
"tspId": {
"$ref": "https://schemas.maas.global/core/booking.json#/definitions/tspId"
},
"amount": {
"type": "number"
},
"paymentStatus": {
"type": "string"
}
},
"required": ["tspId", "amount", "paymentStatus"],
"additionalProperties": false,
"examples": [
{
"tspId": "00000000-cafe-cafe-cafe-cafecafecafe",
"amount": 2405,
"paymentStatus": "PENDING"
}
]
}

0 comments on commit aa9f191

Please sign in to comment.