From 3d9539609c287082308dcd6fd284f26f9c5b93a8 Mon Sep 17 00:00:00 2001 From: EmanueleBVtech Date: Tue, 10 Dec 2024 12:26:41 +0100 Subject: [PATCH] moving to v2 --- .../ecommerce-webview/v1/_openapi.json.tpl | 12 - .../ecommerce-webview/v2/_openapi.json.tpl | 384 ++++++++++++++++++ 2 files changed, 384 insertions(+), 12 deletions(-) create mode 100644 src/domains/ecommerce-app/api/ecommerce-webview/v2/_openapi.json.tpl diff --git a/src/domains/ecommerce-app/api/ecommerce-webview/v1/_openapi.json.tpl b/src/domains/ecommerce-app/api/ecommerce-webview/v1/_openapi.json.tpl index 4935a0d1c6..64ea0b2829 100644 --- a/src/domains/ecommerce-app/api/ecommerce-webview/v1/_openapi.json.tpl +++ b/src/domains/ecommerce-app/api/ecommerce-webview/v1/_openapi.json.tpl @@ -319,18 +319,6 @@ { "type": "object", "properties": { - "closePaymentResultError": { - "type": "object", - "description": "Error details for close payment result", - "properties": { - "statusCode": { - "type": "number" - }, - "description": { - "type": "string" - } - } - }, "status": { "$ref": "#/components/schemas/TransactionStatus" }, diff --git a/src/domains/ecommerce-app/api/ecommerce-webview/v2/_openapi.json.tpl b/src/domains/ecommerce-app/api/ecommerce-webview/v2/_openapi.json.tpl new file mode 100644 index 0000000000..4935a0d1c6 --- /dev/null +++ b/src/domains/ecommerce-app/api/ecommerce-webview/v2/_openapi.json.tpl @@ -0,0 +1,384 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "0.0.1", + "title": "Pagopa eCommerce services for app IO", + "description": "API's exposed from eCommerce services to io webview to allow get transaction.", + "contact": { + "name": "pagoPA - Touchpoints team" + } + }, + "tags": [ + { + "name": "ecommerce-transactions", + "description": "Api's for performing a transaction", + "externalDocs": { + "url": "https://pagopa.atlassian.net/wiki/spaces/I/pages/611287199/-servizio+transactions+service", + "description": "Technical specifications" + } + } + ], + "servers": [ + { + "url": "https://${host}" + } + ], + "externalDocs": { + "url": "https://pagopa.atlassian.net/wiki/spaces/I/pages/492339720/pagoPA+eCommerce+Design+Review", + "description": "Design review" + }, + "paths": { + "/transactions/{transactionId}": { + "get": { + "tags": [ + "ecommerce-transactions" + ], + "operationId": "getTransactionInfo", + "parameters": [ + { + "in": "path", + "name": "transactionId", + "schema": { + "type": "string" + }, + "required": true, + "description": "Transaction ID" + } + ], + "security": [ + { + "eCommerceSessionToken": [] + } + ], + "summary": "Get transaction information", + "description": "Return information for the input specific transaction resource", + "responses": { + "200": { + "description": "Transaction data successfully retrieved", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionInfo" + } + } + } + }, + "400": { + "description": "Invalid transaction id", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } + } + }, + "401": { + "description": "Unauthorized, access token missing or invalid" + }, + "404": { + "description": "Transaction not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } + } + }, + "504": { + "description": "Gateway timeout", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemJson" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ProblemJson": { + "type": "object", + "properties": { + "type": { + "type": "string", + "format": "uri", + "description": "An absolute URI that identifies the problem type. When dereferenced,\nit SHOULD provide human-readable documentation for the problem type\n(e.g., using HTML).", + "default": "about:blank", + "example": "https://example.com/problem/constraint-violation" + }, + "title": { + "type": "string", + "description": "A short, summary of the problem type. Written in english and readable\nfor engineers (usually not suited for non technical stakeholders and\nnot localized); example: Service Unavailable" + }, + "status": { + "$ref": "#/components/schemas/HttpStatusCode" + }, + "detail": { + "type": "string", + "description": "A human readable explanation specific to this occurrence of the\nproblem.", + "example": "There was an error processing the request" + }, + "instance": { + "type": "string", + "format": "uri", + "description": "An absolute URI that identifies the specific occurrence of the problem.\nIt may or may not yield further information if dereferenced." + } + } + }, + "HttpStatusCode": { + "type": "integer", + "format": "int32", + "description": "The HTTP status code generated by the origin server for this occurrence\nof the problem.", + "minimum": 100, + "maximum": 600, + "exclusiveMaximum": true, + "example": 500 + }, + "RptId": { + "type": "string", + "pattern": "([a-zA-Z0-9]{1,35})|(RFd{2}[a-zA-Z0-9]{1,21})" + }, + "PaymentInfo": { + "description": "Informations about transaction payments", + "type": "object", + "properties": { + "paymentToken": { + "type": "string" + }, + "rptId": { + "$ref": "#/components/schemas/RptId" + }, + "reason": { + "type": "string" + }, + "amount": { + "$ref": "#/components/schemas/AmountEuroCents" + }, + "isAllCCP": { + "description": "Flag for the inclusion of Poste bundles. false -> excluded, true -> included", + "type": "boolean" + }, + "transferList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Transfer" + }, + "minItems": 1, + "maxItems": 5 + } + }, + "required": [ + "rptId", + "amount" + ], + "example": { + "rptId": "77777777777302012387654312384", + "paymentToken": "paymentToken1", + "reason": "reason1", + "amount": 600, + "authToken": "authToken1", + "isAllCCP": false, + "transferList": [ + { + "paFiscalCode": "77777777777", + "digitalStamp": false, + "transferCategory": "transferCategory1", + "transferAmount": 500 + }, + { + "paFiscalCode": "11111111111", + "digitalStamp": true, + "transferCategory": "transferCategory2", + "transferAmount": 100 + } + ] + } + }, + "NewTransactionResponse": { + "type": "object", + "description": "Transaction data returned when creating a new transaction", + "properties": { + "transactionId": { + "type": "string" + }, + "payments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentInfo" + }, + "minItems": 1, + "maxItems": 1, + "example": [ + { + "rptId": "77777777777302012387654312384", + "paymentToken": "paymentToken1", + "reason": "reason1", + "amount": 600, + "transferList": [ + { + "paFiscalCode": "77777777777", + "digitalStamp": false, + "transferCategory": "transferCategory1", + "transferAmount": 500 + }, + { + "paFiscalCode": "11111111111", + "digitalStamp": true, + "transferCategory": "transferCategory2", + "transferAmount": 100 + } + ] + } + ] + }, + "status": { + "$ref": "#/components/schemas/TransactionStatus" + }, + "feeTotal": { + "$ref": "#/components/schemas/AmountEuroCents" + }, + "clientId": { + "description": "transaction client id", + "type": "string", + "enum": [ + "IO" + ] + }, + "sendPaymentResultOutcome": { + "description": "The outcome of sendPaymentResult api (OK, KO, NOT_RECEIVED)", + "type": "string", + "enum": [ + "OK", + "KO", + "NOT_RECEIVED" + ] + }, + "authorizationCode": { + "type": "string", + "description": "Payment gateway-specific authorization code related to the transaction" + }, + "errorCode": { + "type": "string", + "description": "Payment gateway-specific error code from the gateway" + }, + "gateway": { + "type": "string", + "pattern": "XPAY|VPOS|NPG|REDIRECT", + "description": "Pgs identifier" + } + }, + "required": [ + "transactionId", + "status", + "payments" + ] + }, + "AmountEuroCents": { + "description": "Amount for payments, in euro cents", + "type": "integer", + "minimum": 0, + "maximum": 99999999 + }, + "TransactionStatus": { + "type": "string", + "description": "Possible statuses a transaction can be in", + "enum": [ + "ACTIVATED", + "AUTHORIZATION_REQUESTED", + "AUTHORIZATION_COMPLETED", + "CLOSURE_REQUESTED", + "CLOSED", + "CLOSURE_ERROR", + "NOTIFIED_OK", + "NOTIFIED_KO", + "NOTIFICATION_ERROR", + "NOTIFICATION_REQUESTED", + "EXPIRED", + "REFUNDED", + "CANCELED", + "EXPIRED_NOT_AUTHORIZED", + "UNAUTHORIZED", + "REFUND_ERROR", + "REFUND_REQUESTED", + "CANCELLATION_REQUESTED", + "CANCELLATION_EXPIRED" + ] + }, + "TransactionInfo": { + "description": "Transaction data returned when querying for an existing transaction", + "allOf": [ + { + "$ref": "#/components/schemas/NewTransactionResponse" + }, + { + "type": "object", + "properties": { + "closePaymentResultError": { + "type": "object", + "description": "Error details for close payment result", + "properties": { + "statusCode": { + "type": "number" + }, + "description": { + "type": "string" + } + } + }, + "status": { + "$ref": "#/components/schemas/TransactionStatus" + }, + "gatewayAuthorizationStatus": { + "type": "string", + "description": "Payment gateway authorization status" + } + }, + "required": [ + "status" + ] + } + ] + }, + "Transfer": { + "type": "object", + "description": "The dto that contains information about the creditor entities", + "properties": { + "paFiscalCode": { + "type": "string", + "description": "The creditor institution fiscal code", + "pattern": "^[a-zA-Z0-9]{11}" + }, + "digitalStamp": { + "type": "boolean", + "description": "True if it is a digital stamp. False otherwise" + }, + "transferCategory": { + "type": "string", + "description": "The taxonomy of the transfer" + }, + "transferAmount": { + "$ref": "#/components/schemas/AmountEuroCents" + } + }, + "required": [ + "paFiscalCode", + "digitalStamp", + "transferAmount" + ] + } + }, + "securitySchemes": { + "eCommerceSessionToken": { + "type": "http", + "scheme": "bearer", + "description": "JWT session token taken from /sessions response body" + } + } + } +} \ No newline at end of file