From a8208178cd83d0d210451a226d4924bcadb0899b Mon Sep 17 00:00:00 2001 From: CircleCI Date: Wed, 20 Mar 2024 04:25:32 +0000 Subject: [PATCH] JSON Schema Update --- _data/v3.yml | 2 + config/v3/p2p_country_list/example.json | 4 + config/v3/p2p_country_list/receive.json | 155 ++++++++++++++++++++++++ config/v3/p2p_country_list/send.json | 41 +++++++ 4 files changed, 202 insertions(+) create mode 100644 config/v3/p2p_country_list/example.json create mode 100644 config/v3/p2p_country_list/receive.json create mode 100644 config/v3/p2p_country_list/send.json diff --git a/_data/v3.yml b/_data/v3.yml index 714f655d..240d518d 100644 --- a/_data/v3.yml +++ b/_data/v3.yml @@ -135,6 +135,8 @@ groups: title: P2P Advertiser Update - name: p2p_chat_create title: P2P Chat Create + - name: p2p_country_list + title: P2P Country List - name: p2p_order_cancel title: P2P Order Cancel - name: p2p_order_confirm diff --git a/config/v3/p2p_country_list/example.json b/config/v3/p2p_country_list/example.json new file mode 100644 index 00000000..751b46bf --- /dev/null +++ b/config/v3/p2p_country_list/example.json @@ -0,0 +1,4 @@ +{ + "p2p_country_list": 1, + "country": "id" +} diff --git a/config/v3/p2p_country_list/receive.json b/config/v3/p2p_country_list/receive.json new file mode 100644 index 00000000..516b5fab --- /dev/null +++ b/config/v3/p2p_country_list/receive.json @@ -0,0 +1,155 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "P2P Country List (response)", + "description": "List all or specific country and its payment methods.", + "type": "object", + "required": [ + "echo_req", + "msg_type" + ], + "properties": { + "p2p_country_list": { + "description": "Country identified by country code", + "type": "object", + "additionalProperties": true, + "patternProperties": { + "^([a-z]{2})?$": { + "description": "Country code identifier.", + "type": "object", + "additionalProperties": false, + "required": [ + "country_name", + "cross_border_ads_enabled", + "fixed_rate_adverts", + "float_rate_adverts", + "float_rate_offset_limit", + "local_currency", + "payment_methods" + ], + "properties": { + "country_name": { + "description": "Display name of country.", + "type": "string" + }, + "cross_border_ads_enabled": { + "description": "When 1, users in this country may place orders on ads in other countries.", + "type": "integer", + "enum": [ + 0, + 1 + ] + }, + "fixed_rate_adverts": { + "description": "Availability of fixed rate adverts.", + "type": "string", + "enum": [ + "disabled", + "enabled", + "list_only" + ] + }, + "float_rate_adverts": { + "description": "Availability of floating rate adverts.", + "type": "string", + "enum": [ + "disabled", + "enabled", + "list_only" + ] + }, + "float_rate_offset_limit": { + "description": "Maximum rate offset for floating rate adverts.", + "type": "number" + }, + "local_currency": { + "description": "Local currency of the country.", + "type": "string", + "pattern": "^[a-zA-Z0-9]{2,20}$", + "examples": [ + "USD" + ] + }, + "payment_methods": { + "description": "Payment method identifier.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[a-z0-9_]{1,30}$": { + "description": "Payment method identifier.", + "type": "object", + "additionalProperties": false, + "properties": { + "display_name": { + "description": "Display name of payment method.", + "type": "string" + }, + "fields": { + "description": "Payment method field definitions.", + "type": "object", + "additionalProperties": false, + "minProperties": 1, + "patternProperties": { + "^[a-z0-9_]{1,30}$": { + "description": "Field identifier.", + "type": "object", + "additionalProperties": false, + "required": [ + "display_name", + "required", + "type" + ], + "properties": { + "display_name": { + "description": "Display name of payment method field.", + "type": "string" + }, + "required": { + "description": "Is field required or optional.", + "type": "integer" + }, + "type": { + "description": "Field type.", + "type": "string", + "enum": [ + "text", + "memo" + ] + } + } + } + } + }, + "type": { + "description": "Payment method type.", + "type": "string", + "enum": [ + "bank", + "ewallet", + "other" + ] + } + } + } + } + } + } + } + } + }, + "echo_req": { + "description": "Echo of the request made.", + "type": "object" + }, + "msg_type": { + "description": "Action name of the request made.", + "type": "string", + "enum": [ + "p2p_country_list" + ] + }, + "req_id": { + "description": "Optional field sent in request to map to response, present only when request contains `req_id`.", + "type": "integer" + } + } +} diff --git a/config/v3/p2p_country_list/send.json b/config/v3/p2p_country_list/send.json new file mode 100644 index 00000000..8ab10acb --- /dev/null +++ b/config/v3/p2p_country_list/send.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "P2P Country List (request)", + "description": "List all or specific country and its payment methods.", + "type": "object", + "auth_required": 1, + "auth_scopes": [ + "payments" + ], + "additionalProperties": false, + "required": [ + "p2p_country_list" + ], + "properties": { + "p2p_country_list": { + "description": "Must be 1", + "type": "integer", + "enum": [ + 1 + ] + }, + "country": { + "description": "[Optional] 2-letter country code. If not provided all countries are returned.", + "type": "string", + "pattern": "^([a-z]{2})?$" + }, + "loginid": { + "description": "[Optional] The login id of the user. If left unspecified, it defaults to the initial authorized token's login id.", + "type": "string", + "pattern": "^[A-Za-z]+[0-9]+$" + }, + "passthrough": { + "description": "[Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.", + "type": "object" + }, + "req_id": { + "description": "[Optional] Used to map request to response.", + "type": "integer" + } + } +}