From 577163f391c573d17123233b8384c2cdbdd311b5 Mon Sep 17 00:00:00 2001 From: Konrad Markus Date: Fri, 19 Apr 2019 19:49:58 +0300 Subject: [PATCH] feat(bookings-estimate-v2) Schemas for request and response --- .../v2/bookings-estimate/request.json | 30 +++++ .../v2/bookings-estimate/response.json | 106 ++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 schemas/maas-backend/bookings/v2/bookings-estimate/request.json create mode 100644 schemas/maas-backend/bookings/v2/bookings-estimate/response.json diff --git a/schemas/maas-backend/bookings/v2/bookings-estimate/request.json b/schemas/maas-backend/bookings/v2/bookings-estimate/request.json new file mode 100644 index 000000000..d21d8c6dd --- /dev/null +++ b/schemas/maas-backend/bookings/v2/bookings-estimate/request.json @@ -0,0 +1,30 @@ +{ + "$id": "http://maasglobal.com/maas-backend/bookings/v2/bookings-estimate/request.json", + "description": "Request schema for bookings-create v2", + "type": "object", + "properties": { + "identityId": { + "$ref": "http://maasglobal.com/core/components/units.json#/definitions/identityId" + }, + "payload": { + "type": "object", + "properties": { + "paymentSourceId": { + "$ref": "http://maasglobal.com/core/components/common.json#/definitions/paymentSourceId" + }, + "booking": { + "$ref": "http://maasglobal.com/maas-backend/bookings/bookings-agency-options/response.json#/definitions/option" + }, + "customerSelection": { + "$ref": "http://maasglobal.com/core/components/configurator.json#/definitions/customerSelection" + } + }, + "required": ["paymentSourceId"] + }, + "headers": { + "$ref": "http://maasglobal.com/core/components/api-common.json#/definitions/headers" + } + }, + "required": ["identityId", "payload"], + "additionalProperties": false +} diff --git a/schemas/maas-backend/bookings/v2/bookings-estimate/response.json b/schemas/maas-backend/bookings/v2/bookings-estimate/response.json new file mode 100644 index 000000000..76d5b4448 --- /dev/null +++ b/schemas/maas-backend/bookings/v2/bookings-estimate/response.json @@ -0,0 +1,106 @@ +{ + "$id": "http://maasglobal.com/maas-backend/bookings/v2/bookings-estimate/response.json", + "description": "Response schema for bookings-create v2", + "type": "object", + "properties": { + "invoice": { + "$ref": "http://maasglobal.com/maas-backend/invoices/invoice.json" + }, + "paymentParameters": { + "description": "Payment parameters for asynchronous payment methods", + "type": "object", + "properties": { + "avainpay": { "$ref": "#/definitions/avainpayPaymentParameters" } + }, + "additionalProperties": false + }, + "debug": { + "type": "object", + "additionalProperties": true + } + }, + "required": ["invoice"], + "additionalProperties": false, + "definitions": { + "avainpayPaymentParameters": { + "anyOf": [ + { + "type": "object", + "description": "JSAPI payment parameters", + "properties": { + "appId": { + "description": "App ID", + "type": "string" + }, + "timeStamp": { + "description": "Timestamp", + "type": "string" + }, + "nonceStr": { + "description": "Nonce string", + "type": "string" + }, + "package": { + "description": "Package", + "type": "string" + }, + "signType": { + "description": "Signature type", + "type": "string" + }, + "paySign": { + "description": "Payment signature", + "type": "string" + } + } + }, + { + "type": "object", + "description": "APP payment parameters", + "properties": { + "return_code": { + "description": "The return code, usually 'SUCCESS'", + "type": "string" + }, + "appid": { + "description": "App ID", + "type": "string" + }, + "mch_id": { + "description": "Merchant ID", + "type": "string" + }, + "sub_mch_id": { + "description": "Our sub-merchant ID", + "type": "string" + }, + "nonce_str": { + "description": "Nonce", + "type": "string" + }, + "result_code": { + "description": "The result code, usually 'SUCCESS'", + "type": "string" + }, + "prepay_id": { + "description": "WeChat's prepay ID", + "type": "string" + }, + "trade_type": { + "description": "The trade type, usually 'APP'", + "type": "string" + }, + "code_url": { + "description": "WeChat's code URL", + "type": "string" + }, + "sign": { + "description": "WeChat's message signature", + "type": "string" + } + } + } + ] + } + } +}