From aa9f1913019ba4799dd5b3ddd7a21c42b18ee8a5 Mon Sep 17 00:00:00 2001 From: hieuunguyeen Date: Thu, 7 Dec 2023 17:33:26 +0200 Subject: [PATCH] Schemas for payment endpoints --- maas-schemas/package.json | 2 +- .../tsp/payments-initiate/request.json | 21 ++++++++++++++++ .../tsp/payments-initiate/response.json | 25 +++++++++++++++++++ .../tsp/payments-retrieve/request.json | 17 +++++++++++++ .../tsp/payments-retrieve/response.json | 25 +++++++++++++++++++ 5 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 maas-schemas/schemas/tsp/payments-initiate/request.json create mode 100644 maas-schemas/schemas/tsp/payments-initiate/response.json create mode 100644 maas-schemas/schemas/tsp/payments-retrieve/request.json create mode 100644 maas-schemas/schemas/tsp/payments-retrieve/response.json diff --git a/maas-schemas/package.json b/maas-schemas/package.json index 156441af0..a1f892ee3 100644 --- a/maas-schemas/package.json +++ b/maas-schemas/package.json @@ -1,6 +1,6 @@ { "name": "maas-schemas", - "version": "21.0.0", + "version": "21.1.0", "description": "Schemas for MaaS infrastructure", "main": "index.js", "engine": { diff --git a/maas-schemas/schemas/tsp/payments-initiate/request.json b/maas-schemas/schemas/tsp/payments-initiate/request.json new file mode 100644 index 000000000..7102646f3 --- /dev/null +++ b/maas-schemas/schemas/tsp/payments-initiate/request.json @@ -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 + } + ] +} diff --git a/maas-schemas/schemas/tsp/payments-initiate/response.json b/maas-schemas/schemas/tsp/payments-initiate/response.json new file mode 100644 index 000000000..944991282 --- /dev/null +++ b/maas-schemas/schemas/tsp/payments-initiate/response.json @@ -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" + } + ] +} diff --git a/maas-schemas/schemas/tsp/payments-retrieve/request.json b/maas-schemas/schemas/tsp/payments-retrieve/request.json new file mode 100644 index 000000000..6203eb62b --- /dev/null +++ b/maas-schemas/schemas/tsp/payments-retrieve/request.json @@ -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" + } + ] +} diff --git a/maas-schemas/schemas/tsp/payments-retrieve/response.json b/maas-schemas/schemas/tsp/payments-retrieve/response.json new file mode 100644 index 000000000..2a63ac73d --- /dev/null +++ b/maas-schemas/schemas/tsp/payments-retrieve/response.json @@ -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" + } + ] +}