diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 8142d49..f52ced7 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-mbd-service description: Microservice that handles services for eBollo type: application -version: 0.103.0 -appVersion: 1.1.4 +version: 0.97.0 +appVersion: 1.0.1-4-fix-dati-servizio dependencies: - name: microservice-chart version: 7.1.1 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 776e806..2dfab1b 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "pagopa-mbd-service" image: repository: ghcr.io/pagopa/pagopa-mbd-service - tag: "1.1.4" + tag: "1.0.1-4-fix-dati-servizio" pullPolicy: Always livenessProbe: handlerType: httpGet @@ -73,10 +73,10 @@ microservice-chart: WEBSITE_SITE_NAME: 'mbd-service' # required to show cloud role name in application insights APP_LOG_LEVEL: 'DEBUG' DEFAULT_LOGGING_LEVEL: 'INFO' - DEMAND_PAYMENT_ENDPOINT: 'https://api.dev.platform.pagopa.it/nodo-auth/node-for-psp/v1' - CART_ENDPOINT: 'https://api.dev.platform.pagopa.it/checkout/carts-auth/v1/carts' - PAYMENT_RECEIPT_ENDPOINT: 'https://api.dev.platform.pagopa.it/gpd/payments-receipts-service/v1' - MBD_BASE_URL: 'https://api.dev.platform.pagopa.it/mbd/mbd-payment/v1/' + DEMAND_PAYMENT_ENDPOINT: 'https://api.uat.platform.pagopa.it/nodo-auth/node-for-psp/v1' + CART_ENDPOINT: 'https://api.uat.platform.pagopa.it/checkout/carts-auth/v1/carts' + PAYMENT_RECEIPT_ENDPOINT: 'https://api.uat.platform.pagopa.it/gpd/payments-receipts-service/v1' + MBD_BASE_URL: 'https://api.dev.platform.pagopa.it/pagopa-mbd-service/v1' MBD_ID_PSP: 'ABI50004' MBD_ID_BROKER_PSP: '99999000011' MBD_CHANNEL_ID: '99999000011_03' diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 0e5ee03..1ff14fb 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "pagopa-mbd-service" image: repository: ghcr.io/pagopa/pagopa-mbd-service - tag: "1.1.4" + tag: "1.0.1-4-fix-dati-servizio" pullPolicy: Always livenessProbe: handlerType: httpGet @@ -76,7 +76,7 @@ microservice-chart: DEMAND_PAYMENT_ENDPOINT: 'https://api.platform.pagopa.it/nodo-auth/node-for-psp/v1' CART_ENDPOINT: 'https://api.platform.pagopa.it/checkout/carts-auth/v1/carts' PAYMENT_RECEIPT_ENDPOINT: 'https://api.platform.pagopa.it/gpd/payments-receipts-service/v1' - MBD_BASE_URL: 'https://api.platform.pagopa.it/mbd/mbd-payment/v1/' + MBD_BASE_URL: 'https://api.dev.platform.pagopa.it/pagopa-mbd-service/v1' MBD_ID_PSP: 'ABI50004' MBD_ID_BROKER_PSP: '99999000011' MBD_CHANNEL_ID: '99999000011_03' diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index fb03c10..34ea937 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "pagopa-mbd-service" image: repository: ghcr.io/pagopa/pagopa-mbd-service - tag: "1.1.4" + tag: "1.0.1-4-fix-dati-servizio" pullPolicy: Always livenessProbe: handlerType: httpGet @@ -76,7 +76,7 @@ microservice-chart: DEMAND_PAYMENT_ENDPOINT: 'https://api.uat.platform.pagopa.it/nodo-auth/node-for-psp/v1' CART_ENDPOINT: 'https://api.uat.platform.pagopa.it/checkout/carts-auth/v1/carts' PAYMENT_RECEIPT_ENDPOINT: 'https://api.uat.platform.pagopa.it/gpd/payments-receipts-service/v1' - MBD_BASE_URL: 'https://api.uat.platform.pagopa.it/mbd/mbd-payment/v1/' + MBD_BASE_URL: 'https://api.dev.platform.pagopa.it/pagopa-mbd-service/v1' MBD_ID_PSP: 'ABI50004' MBD_ID_BROKER_PSP: '99999000011' MBD_CHANNEL_ID: '99999000011_03' diff --git a/openapi/openapi.json b/openapi/openapi.json index dbc4e7b..9c7a5f3 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -1,526 +1,493 @@ { - "openapi": "3.0.1", - "info": { - "title": "mbd-service", - "description": "MBD Service", - "termsOfService": "https://www.pagopa.gov.it/", - "version": "1.1.4" + "openapi" : "3.0.1", + "info" : { + "title" : "mbd-service", + "description" : "@project.description@", + "termsOfService" : "https://www.pagopa.gov.it/", + "version" : "1.0.1-4-fix-dati-servizio" }, - "servers": [ - { - "url": "", - "description": "Generated server url" - } - ], - "paths": { - "/info": { - "get": { - "tags": [ - "Home" - ], - "summary": "health check", - "description": "Return OK if application is started", - "operationId": "healthCheck", - "responses": { - "200": { - "description": "OK", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "servers" : [ { + "url" : "", + "description" : "Generated server url" + } ], + "paths" : { + "/info" : { + "get" : { + "tags" : [ "Home" ], + "summary" : "health check", + "description" : "Return OK if application is started", + "operationId" : "healthCheck", + "responses" : { + "200" : { + "description" : "OK", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/AppInfo" + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/AppInfo" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } + "parameters" : [ { + "name" : "X-Request-Id", + "in" : "header", + "description" : "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", + "schema" : { + "type" : "string" } - ] + } ] }, - "/organizations/{fiscalCodeEC}/mbd": { - "post": { - "tags": [ - "mbd-controller" - ], - "summary": "getMbd", - "description": "Return mbd data for payment on requirement ", - "operationId": "getMdb", - "parameters": [ - { - "name": "fiscalCodeEC", - "in": "path", - "required": true, - "schema": { - "type": "string" - } + "/organizations/{fiscalCodeEC}/mbd" : { + "post" : { + "tags" : [ "mbd-controller" ], + "summary" : "getMbd", + "description" : "Return mbd data for payment on requirement ", + "operationId" : "getMdb", + "parameters" : [ { + "name" : "fiscalCodeEC", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetMbdRequest" + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetMbdRequest" } } }, - "required": true + "required" : true }, - "responses": { - "200": { - "description": "OK", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "responses" : { + "200" : { + "description" : "OK", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetCartResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetCartResponse" } } } }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "400" : { + "description" : "Bad Request", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Unauthorized", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "403": { - "description": "Forbidden", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "403" : { + "description" : "Forbidden", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "ibans for the brokerCode not found", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "ibans for the brokerCode not found", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "429" : { + "description" : "Too many requests", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetCartErrorResponse" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetCartErrorResponse" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } + "parameters" : [ { + "name" : "X-Request-Id", + "in" : "header", + "description" : "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", + "schema" : { + "type" : "string" } - ] + } ] }, - "/organizations/{fiscalCode}/receipt/{nav}": { - "get": { - "tags": [ - "mbd-controller" - ], - "summary": "getPaymentReceipt", - "description": "Return receipt of payment on requirement ", - "operationId": "getPaymentReceipts", - "parameters": [ - { - "name": "fiscalCode", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "nav", - "in": "path", - "required": true, - "schema": { - "type": "string" - } + "/organizations/{fiscalCode}/receipt/{nav}" : { + "get" : { + "tags" : [ "mbd-controller" ], + "summary" : "getPaymentReceipt", + "description" : "Return receipt of payment on requirement ", + "operationId" : "getPaymentReceipts", + "parameters" : [ { + "name" : "fiscalCode", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } - ], - "responses": { - "200": { - "description": "OK", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + }, { + "name" : "nav", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetMdbReceipt" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetMdbReceipt" } } } }, - "400": { - "description": "Bad Request", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "400" : { + "description" : "Bad Request", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401": { - "description": "Unauthorized", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "401" : { + "description" : "Unauthorized", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/xml": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "403": { - "description": "Forbidden", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "403" : { + "description" : "Forbidden", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "404": { - "description": "ibans for the brokerCode not found", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "404" : { + "description" : "ibans for the brokerCode not found", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "429": { - "description": "Too many requests", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "429" : { + "description" : "Too many requests", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } } }, - "500": { - "description": "Service unavailable", - "headers": { - "X-Request-Id": { - "description": "This header identifies the call", - "schema": { - "type": "string" + "500" : { + "description" : "Service unavailable", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" } } }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemJson" + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" } } } } }, - "security": [ - { - "ApiKey": [] - } - ] + "security" : [ { + "ApiKey" : [ ] + } ] }, - "parameters": [ - { - "name": "X-Request-Id", - "in": "header", - "description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", - "schema": { - "type": "string" - } + "parameters" : [ { + "name" : "X-Request-Id", + "in" : "header", + "description" : "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.", + "schema" : { + "type" : "string" } - ] + } ] } }, - "components": { - "schemas": { - "GetMbdRequest": { - "required": [ - "idCIService", - "returnUrls" - ], - "type": "object", - "properties": { - "paymentNotices": { - "maxItems": 1, - "minItems": 1, - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentNotice" + "components" : { + "schemas" : { + "GetMbdRequest" : { + "required" : [ "idCIService", "returnUrls" ], + "type" : "object", + "properties" : { + "paymentNotices" : { + "maxItems" : 1, + "minItems" : 1, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentNotice" } }, - "idCIService": { - "type": "string" + "idCIService" : { + "type" : "string" }, - "returnUrls": { - "$ref": "#/components/schemas/ReturnUrls" + "returnUrls" : { + "$ref" : "#/components/schemas/ReturnUrls" } } }, - "PaymentNotice": { - "required": [ - "amount", - "email", - "firstName", - "fiscalCode", - "lastName", - "province" - ], - "type": "object", - "properties": { - "firstName": { - "type": "string" + "PaymentNotice" : { + "required" : [ "amount", "email", "firstName", "fiscalCode", "lastName", "province" ], + "type" : "object", + "properties" : { + "firstName" : { + "type" : "string" }, - "lastName": { - "type": "string" + "lastName" : { + "type" : "string" }, - "fiscalCode": { - "type": "string" + "fiscalCode" : { + "type" : "string" }, - "email": { - "type": "string" + "email" : { + "type" : "string" }, - "amount": { - "type": "integer", - "format": "int64" + "amount" : { + "type" : "integer", + "format" : "int64" }, - "province": { - "type": "string" + "province" : { + "type" : "string" }, - "documentHash": { - "maxLength": 44, - "minLength": 44, - "type": "string" + "documentHash" : { + "maxLength" : 44, + "minLength" : 44, + "type" : "string" } } }, - "ReturnUrls": { - "required": [ - "cancelUrl", - "errorUrl", - "successUrl" - ], - "type": "object", - "properties": { - "successUrl": { - "type": "string" + "ReturnUrls" : { + "required" : [ "cancelUrl", "errorUrl", "successUrl" ], + "type" : "object", + "properties" : { + "successUrl" : { + "type" : "string" }, - "cancelUrl": { - "type": "string" + "cancelUrl" : { + "type" : "string" }, - "errorUrl": { - "type": "string" + "errorUrl" : { + "type" : "string" } } }, - "GetCartErrorResponse": { - "type": "object", - "properties": { - "errorUrl": { - "type": "string" + "ProblemJson" : { + "type" : "object", + "properties" : { + "title" : { + "type" : "string", + "description" : "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + }, + "status" : { + "maximum" : 600, + "minimum" : 100, + "type" : "integer", + "description" : "The HTTP status code generated by the origin server for this occurrence of the problem.", + "format" : "int32", + "example" : 200 + }, + "detail" : { + "type" : "string", + "description" : "A human readable explanation specific to this occurrence of the problem.", + "example" : "There was an error processing the request" } } }, - "ProblemJson": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable" + "GetCartResponse" : { + "type" : "object", + "properties" : { + "checkoutRedirectUrl" : { + "type" : "string" }, - "status": { - "maximum": 600, - "minimum": 100, - "type": "integer", - "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", - "format": "int32", - "example": 200 + "navDownloadLink" : { + "type" : "string" }, - "detail": { - "type": "string", - "description": "A human readable explanation specific to this occurrence of the problem.", - "example": "There was an error processing the request" + "mbdNav" : { + "type" : "string" } } }, - "GetCartResponse": { - "type": "object", - "properties": { - "checkoutRedirectUrl": { - "type": "string" + "GetCartErrorResponse" : { + "type" : "object", + "properties" : { + "errorUrl" : { + "type" : "string" } } }, - "GetMdbReceipt": { - "type": "object", - "properties": { - "content": { - "type": "array", - "items": { - "type": "string", - "format": "byte" + "GetMdbReceipt" : { + "type" : "object", + "properties" : { + "content" : { + "type" : "array", + "items" : { + "type" : "string", + "format" : "byte" } } } }, - "AppInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" + "AppInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" }, - "version": { - "type": "string" + "version" : { + "type" : "string" }, - "environment": { - "type": "string" + "environment" : { + "type" : "string" } } } }, - "securitySchemes": { - "ApiKey": { - "type": "apiKey", - "description": "The API key to access this function app.", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" + "securitySchemes" : { + "ApiKey" : { + "type" : "apiKey", + "description" : "The API key to access this function app.", + "name" : "Ocp-Apim-Subscription-Key", + "in" : "header" } } } -} +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index f0a62cd..808d50d 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ it.gov.pagopa.ebollo mbd-service - 1.1.4 + 1.0.1-4-fix-dati-servizio MBD Service MBD Service @@ -161,7 +161,7 @@ - ${project.basedir}/src/main/resources/envelope.xsd + ${project.basedir}/src/main/resources/service.xsd diff --git a/src/main/java/it/gov/pagopa/mbd/service/client/ReactiveClient.java b/src/main/java/it/gov/pagopa/mbd/service/client/ReactiveClient.java index 57399f4..da98728 100644 --- a/src/main/java/it/gov/pagopa/mbd/service/client/ReactiveClient.java +++ b/src/main/java/it/gov/pagopa/mbd/service/client/ReactiveClient.java @@ -1,5 +1,6 @@ package it.gov.pagopa.mbd.service.client; +import com.fasterxml.jackson.databind.ObjectMapper; import it.gov.pagopa.mbd.service.exception.WebClientException; import it.gov.pagopa.mbd.service.model.carts.GetCartRequest; import it.gov.pagopa.mbd.service.model.carts.GetCartResponse; diff --git a/src/main/java/it/gov/pagopa/mbd/service/mapper/RequestMapper.java b/src/main/java/it/gov/pagopa/mbd/service/mapper/RequestMapper.java index 041f47d..8163230 100644 --- a/src/main/java/it/gov/pagopa/mbd/service/mapper/RequestMapper.java +++ b/src/main/java/it/gov/pagopa/mbd/service/mapper/RequestMapper.java @@ -3,13 +3,10 @@ import it.gov.pagopa.mbd.service.exception.CartMappingException; import it.gov.pagopa.mbd.service.model.carts.CartPaymentNotice; import it.gov.pagopa.mbd.service.model.carts.GetCartRequest; -import it.gov.pagopa.mbd.service.model.mdb.PaymentNotice; -import it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo.CtDebitore; -import it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo.CtEnteCreditore; -import it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo.CtHashDocumento; -import it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo.Ctebollo; import it.gov.pagopa.mbd.service.model.carts.ReturnUrls; import it.gov.pagopa.mbd.service.model.mdb.GetMbdRequest; +import it.gov.pagopa.mbd.service.model.mdb.PaymentNotice; +import it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo.CtService; import it.gov.pagopa.mbd.service.model.xml.node.nodeforpsp.CtPaymentOptionDescription; import it.gov.pagopa.mbd.service.model.xml.node.nodeforpsp.CtPaymentOptionsDescriptionList; import it.gov.pagopa.mbd.service.model.xml.node.nodeforpsp.DemandPaymentNoticeRequest; @@ -17,6 +14,7 @@ import org.springframework.oxm.jaxb.Jaxb2Marshaller; import org.springframework.xml.transform.StringResult; +import java.math.RoundingMode; import java.util.Base64; import java.util.Collections; import java.util.List; @@ -32,33 +30,36 @@ public static DemandPaymentNoticeRequest mapDemandPaymentNoticeRequest( PaymentNotice paymentNotice = getMdbRequest.getPaymentNotices().get(0); - Ctebollo ctMarcaDaBollo = - Ctebollo.builder() - .debitore(CtDebitore.builder() - .codiceFiscaleDebitore(paymentNotice.getFiscalCode()) - .nomeDebitore(paymentNotice.getFirstName()) - .cognomeDebitore(paymentNotice.getLastName()) - .emailDebitore(paymentNotice.getEmail()) - .provinciaResidenza(paymentNotice.getProvince()) - .build()) - .enteCreditore(CtEnteCreditore.builder() - .codiceFiscaleEnte(fiscalCodeEC) - .build()) - .hashDocumento(CtHashDocumento.builder() - .hashDocumento(paymentNotice.getDocumentHash()) - .build()) + CtService ctMarcaDaBollo = + CtService.builder() + .debtorFiscalCode(paymentNotice.getFiscalCode()) + .debtorName(paymentNotice.getFirstName()) + .debtorSurname(paymentNotice.getLastName()) + .debtorEmail(paymentNotice.getEmail()) + .debtorProvince(paymentNotice.getProvince()) + .ciFiscalCode(fiscalCodeEC) + .documentHash(paymentNotice.getDocumentHash()) .build(); - StringResult sw = new StringResult(); - marshaller.marshal(ctMarcaDaBollo, sw); - return DemandPaymentNoticeRequest.builder() .idPSP(idPsp) .idBrokerPSP(idBrokerPsp) .idChannel(idChannel) .idSoggettoServizio(getMdbRequest.getIdCIService()) .password("") - .datiSpecificiServizio(Base64.getMimeEncoder().encode(sw.toString().getBytes())) + .datiSpecificiServizio(Base64.getMimeEncoder().encode( + ("\n" + + "\n" + + " "+getMdbRequest.getPaymentNotices().get(0).getAmount()+"\n" + + " "+ctMarcaDaBollo.getDebtorFiscalCode()+"\n" + + " "+ctMarcaDaBollo.getDebtorName()+"\n" + + " "+ctMarcaDaBollo.getDebtorSurname()+"\n" + + " "+ctMarcaDaBollo.getDebtorEmail()+"\n" + + " "+ctMarcaDaBollo.getDebtorProvince()+"\n" + + " "+ctMarcaDaBollo.getCiFiscalCode()+"\n" + + " "+ctMarcaDaBollo.getDocumentHash()+"\n" + + "").getBytes() + )) .build(); } @@ -72,20 +73,19 @@ public static GetCartRequest mapCartRequest( ctPaymentOptionsDescriptionList.getPaymentOptionDescription(); assertNotNull(ctPaymentOptionsDescriptions); assertTrue(!ctPaymentOptionsDescriptions.isEmpty(), "Missing PaymentOption"); - CtPaymentOptionDescription ctPaymentOptionDescription = ctPaymentOptionsDescriptions.get(0); assertNotNull(demandPaymentNoticeResponse.getQrCode()); return GetCartRequest.builder() .emailNotice(request.getPaymentNotices().get(0).getEmail()) .returnUrls(ReturnUrls.builder() - .cancelUrl(request.getReturnUrls().getCancelUrl()) - .errorUrl(request.getReturnUrls().getErrorUrl()) - .successUrl(request.getReturnUrls().getSuccessUrl()) + .returnCancelUrl(request.getReturnUrls().getCancelUrl()) + .returnErrorUrl(request.getReturnUrls().getErrorUrl()) + .returnOkUrl(request.getReturnUrls().getSuccessUrl()) .build()) .paymentNotices(Collections.singletonList( CartPaymentNotice.builder() .fiscalCode(demandPaymentNoticeResponse.getQrCode().getFiscalCode()) - .amount(ctPaymentOptionDescription.getAmount().toBigIntegerExact().longValue()) - .companyName(demandPaymentNoticeResponse.getOfficeName()) + .amount(request.getPaymentNotices().get(0).getAmount()) + .companyName(demandPaymentNoticeResponse.getCompanyName()) .description(demandPaymentNoticeResponse.getPaymentDescription()) .noticeNumber(demandPaymentNoticeResponse.getQrCode().getNoticeNumber()) .build() diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/carts/GetCartRequest.java b/src/main/java/it/gov/pagopa/mbd/service/model/carts/GetCartRequest.java index 23464d6..d248b8f 100644 --- a/src/main/java/it/gov/pagopa/mbd/service/model/carts/GetCartRequest.java +++ b/src/main/java/it/gov/pagopa/mbd/service/model/carts/GetCartRequest.java @@ -18,4 +18,6 @@ public class GetCartRequest { private ReturnUrls returnUrls; + + } diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/carts/GetCartResponse.java b/src/main/java/it/gov/pagopa/mbd/service/model/carts/GetCartResponse.java index d6f1cf5..ed59038 100644 --- a/src/main/java/it/gov/pagopa/mbd/service/model/carts/GetCartResponse.java +++ b/src/main/java/it/gov/pagopa/mbd/service/model/carts/GetCartResponse.java @@ -13,4 +13,8 @@ public class GetCartResponse { private String checkoutRedirectUrl; + private String navDownloadLink; + + private String mbdNav; + } diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/carts/ReturnUrls.java b/src/main/java/it/gov/pagopa/mbd/service/model/carts/ReturnUrls.java index b8a3b50..f0b20d5 100644 --- a/src/main/java/it/gov/pagopa/mbd/service/model/carts/ReturnUrls.java +++ b/src/main/java/it/gov/pagopa/mbd/service/model/carts/ReturnUrls.java @@ -11,8 +11,8 @@ @Builder public class ReturnUrls { - private String successUrl; - private String cancelUrl; - private String errorUrl; + private String returnOkUrl; + private String returnCancelUrl; + private String returnErrorUrl; } diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtDebitore.java b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtDebitore.java deleted file mode 100644 index 5c256b9..0000000 --- a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtDebitore.java +++ /dev/null @@ -1,189 +0,0 @@ -// -// Questo file è stato generato dall'Eclipse Implementation of JAXB, v3.0.0 -// Vedere https://eclipse-ee4j.github.io/jaxb-ri -// Qualsiasi modifica a questo file andrà persa durante la ricompilazione dello schema di origine. -// Generato il: 2024.11.28 alle 03:00:54 PM CET -// - - -package it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo; - -import jakarta.xml.bind.annotation.XmlAccessType; -import jakarta.xml.bind.annotation.XmlAccessorType; -import jakarta.xml.bind.annotation.XmlElement; -import jakarta.xml.bind.annotation.XmlType; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - - -/** - *

Classe Java per ctDebitore complex type. - * - *

Il seguente frammento di schema specifica il contenuto previsto contenuto in questa classe. - * - *

- * <complexType name="ctDebitore">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="codiceFiscaleDebitore" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="nomeDebitore" type="{http://PuntoAccessoPSP.spcoop.gov.it/ebollo}stText50"/>
- *         <element name="cognomeDebitore" type="{http://PuntoAccessoPSP.spcoop.gov.it/ebollo}stText50"/>
- *         <element name="emailDebitore" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="provinciaResidenza" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ctDebitore", propOrder = { - "codiceFiscaleDebitore", - "nomeDebitore", - "cognomeDebitore", - "emailDebitore", - "provinciaResidenza" -}) -@AllArgsConstructor -@NoArgsConstructor -@Builder -@Data -public class CtDebitore { - - @XmlElement(required = true) - protected String codiceFiscaleDebitore; - @XmlElement(required = true) - protected String nomeDebitore; - @XmlElement(required = true) - protected String cognomeDebitore; - @XmlElement(required = true) - protected String emailDebitore; - @XmlElement(required = true) - protected String provinciaResidenza; - - /** - * Recupera il valore della proprietà codiceFiscaleDebitore. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCodiceFiscaleDebitore() { - return codiceFiscaleDebitore; - } - - /** - * Imposta il valore della proprietà codiceFiscaleDebitore. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCodiceFiscaleDebitore(String value) { - this.codiceFiscaleDebitore = value; - } - - /** - * Recupera il valore della proprietà nomeDebitore. - * - * @return - * possible object is - * {@link String } - * - */ - public String getNomeDebitore() { - return nomeDebitore; - } - - /** - * Imposta il valore della proprietà nomeDebitore. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setNomeDebitore(String value) { - this.nomeDebitore = value; - } - - /** - * Recupera il valore della proprietà cognomeDebitore. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCognomeDebitore() { - return cognomeDebitore; - } - - /** - * Imposta il valore della proprietà cognomeDebitore. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCognomeDebitore(String value) { - this.cognomeDebitore = value; - } - - /** - * Recupera il valore della proprietà emailDebitore. - * - * @return - * possible object is - * {@link String } - * - */ - public String getEmailDebitore() { - return emailDebitore; - } - - /** - * Imposta il valore della proprietà emailDebitore. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEmailDebitore(String value) { - this.emailDebitore = value; - } - - /** - * Recupera il valore della proprietà provinciaResidenza. - * - * @return - * possible object is - * {@link String } - * - */ - public String getProvinciaResidenza() { - return provinciaResidenza; - } - - /** - * Imposta il valore della proprietà provinciaResidenza. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProvinciaResidenza(String value) { - this.provinciaResidenza = value; - } - -} diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtEnteCreditore.java b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtEnteCreditore.java deleted file mode 100644 index 10148da..0000000 --- a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtEnteCreditore.java +++ /dev/null @@ -1,77 +0,0 @@ -// -// Questo file è stato generato dall'Eclipse Implementation of JAXB, v3.0.0 -// Vedere https://eclipse-ee4j.github.io/jaxb-ri -// Qualsiasi modifica a questo file andrà persa durante la ricompilazione dello schema di origine. -// Generato il: 2024.11.28 alle 03:00:54 PM CET -// - - -package it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo; - -import jakarta.xml.bind.annotation.XmlAccessType; -import jakarta.xml.bind.annotation.XmlAccessorType; -import jakarta.xml.bind.annotation.XmlElement; -import jakarta.xml.bind.annotation.XmlType; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - - -/** - *

Classe Java per ctEnteCreditore complex type. - * - *

Il seguente frammento di schema specifica il contenuto previsto contenuto in questa classe. - * - *

- * <complexType name="ctEnteCreditore">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="codiceFiscaleEnte" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ctEnteCreditore", propOrder = { - "codiceFiscaleEnte" -}) -@AllArgsConstructor -@NoArgsConstructor -@Builder -@Data -public class CtEnteCreditore { - - @XmlElement(required = true) - protected String codiceFiscaleEnte; - - /** - * Recupera il valore della proprietà codiceFiscaleEnte. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCodiceFiscaleEnte() { - return codiceFiscaleEnte; - } - - /** - * Imposta il valore della proprietà codiceFiscaleEnte. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCodiceFiscaleEnte(String value) { - this.codiceFiscaleEnte = value; - } - -} diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtHashDocumento.java b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtHashDocumento.java deleted file mode 100644 index 74c5cca..0000000 --- a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtHashDocumento.java +++ /dev/null @@ -1,77 +0,0 @@ -// -// Questo file è stato generato dall'Eclipse Implementation of JAXB, v3.0.0 -// Vedere https://eclipse-ee4j.github.io/jaxb-ri -// Qualsiasi modifica a questo file andrà persa durante la ricompilazione dello schema di origine. -// Generato il: 2024.11.28 alle 03:00:54 PM CET -// - - -package it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo; - -import jakarta.xml.bind.annotation.XmlAccessType; -import jakarta.xml.bind.annotation.XmlAccessorType; -import jakarta.xml.bind.annotation.XmlElement; -import jakarta.xml.bind.annotation.XmlType; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - - -/** - *

Classe Java per ctHashDocumento complex type. - * - *

Il seguente frammento di schema specifica il contenuto previsto contenuto in questa classe. - * - *

- * <complexType name="ctHashDocumento">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="hashDocumento" type="{http://PuntoAccessoPSP.spcoop.gov.it/ebollo}stTextBase64"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ctHashDocumento", propOrder = { - "hashDocumento" -}) -@AllArgsConstructor -@NoArgsConstructor -@Data -@Builder -public class CtHashDocumento { - - @XmlElement(required = true) - protected String hashDocumento; - - /** - * Recupera il valore della proprietà hashDocumento. - * - * @return - * possible object is - * {@link String } - * - */ - public String getHashDocumento() { - return hashDocumento; - } - - /** - * Imposta il valore della proprietà hashDocumento. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setHashDocumento(String value) { - this.hashDocumento = value; - } - -} diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtService.java b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtService.java new file mode 100644 index 0000000..9a1693c --- /dev/null +++ b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/CtService.java @@ -0,0 +1,243 @@ +// +// Questo file è stato generato dall'Eclipse Implementation of JAXB, v3.0.0 +// Vedere https://eclipse-ee4j.github.io/jaxb-ri +// Qualsiasi modifica a questo file andrà persa durante la ricompilazione dello schema di origine. +// Generato il: 2024.12.12 alle 03:15:53 PM CET +// + + +package it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo; + +import jakarta.xml.bind.annotation.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + *

Classe Java per ctService complex type. + * + *

Il seguente frammento di schema specifica il contenuto previsto contenuto in questa classe. + * + *

+ * <complexType name="ctService">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="debtorFiscalCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="debtorName" type="{http://PuntoAccessoPSP.spcoop.gov.it/GeneralService}stText50"/>
+ *         <element name="debtorSurname" type="{http://PuntoAccessoPSP.spcoop.gov.it/GeneralService}stText50"/>
+ *         <element name="debtorEmail" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="debtorProvince" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="ciFiscalCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="documentHash" type="{http://PuntoAccessoPSP.spcoop.gov.it/GeneralService}stTextBase64"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ctService", propOrder = { + "debtorFiscalCode", + "debtorName", + "debtorSurname", + "debtorEmail", + "debtorProvince", + "ciFiscalCode", + "documentHash" +}) +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Data +@XmlRootElement +public class CtService { + + @XmlElement(required = true) + protected String debtorFiscalCode; + @XmlElement(required = true) + protected String debtorName; + @XmlElement(required = true) + protected String debtorSurname; + @XmlElement(required = true) + protected String debtorEmail; + @XmlElement(required = true) + protected String debtorProvince; + @XmlElement(required = true) + protected String ciFiscalCode; + @XmlElement(required = true) + protected String documentHash; + + /** + * Recupera il valore della proprietà debtorFiscalCode. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDebtorFiscalCode() { + return debtorFiscalCode; + } + + /** + * Imposta il valore della proprietà debtorFiscalCode. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDebtorFiscalCode(String value) { + this.debtorFiscalCode = value; + } + + /** + * Recupera il valore della proprietà debtorName. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDebtorName() { + return debtorName; + } + + /** + * Imposta il valore della proprietà debtorName. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDebtorName(String value) { + this.debtorName = value; + } + + /** + * Recupera il valore della proprietà debtorSurname. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDebtorSurname() { + return debtorSurname; + } + + /** + * Imposta il valore della proprietà debtorSurname. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDebtorSurname(String value) { + this.debtorSurname = value; + } + + /** + * Recupera il valore della proprietà debtorEmail. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDebtorEmail() { + return debtorEmail; + } + + /** + * Imposta il valore della proprietà debtorEmail. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDebtorEmail(String value) { + this.debtorEmail = value; + } + + /** + * Recupera il valore della proprietà debtorProvince. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDebtorProvince() { + return debtorProvince; + } + + /** + * Imposta il valore della proprietà debtorProvince. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDebtorProvince(String value) { + this.debtorProvince = value; + } + + /** + * Recupera il valore della proprietà ciFiscalCode. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCiFiscalCode() { + return ciFiscalCode; + } + + /** + * Imposta il valore della proprietà ciFiscalCode. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCiFiscalCode(String value) { + this.ciFiscalCode = value; + } + + /** + * Recupera il valore della proprietà documentHash. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDocumentHash() { + return documentHash; + } + + /** + * Imposta il valore della proprietà documentHash. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDocumentHash(String value) { + this.documentHash = value; + } + +} diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/Ctebollo.java b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/Ctebollo.java deleted file mode 100644 index 11c9453..0000000 --- a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/Ctebollo.java +++ /dev/null @@ -1,131 +0,0 @@ -// -// Questo file è stato generato dall'Eclipse Implementation of JAXB, v3.0.0 -// Vedere https://eclipse-ee4j.github.io/jaxb-ri -// Qualsiasi modifica a questo file andrà persa durante la ricompilazione dello schema di origine. -// Generato il: 2024.11.28 alle 03:00:54 PM CET -// - - -package it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo; - -import jakarta.xml.bind.annotation.*; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - - -/** - *

Classe Java per ctebollo complex type. - * - *

Il seguente frammento di schema specifica il contenuto previsto contenuto in questa classe. - * - *

- * <complexType name="ctebollo">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="debitore" type="{http://PuntoAccessoPSP.spcoop.gov.it/ebollo}ctDebitore"/>
- *         <element name="enteCreditore" type="{http://PuntoAccessoPSP.spcoop.gov.it/ebollo}ctEnteCreditore"/>
- *         <element name="hashDocumento" type="{http://PuntoAccessoPSP.spcoop.gov.it/ebollo}ctHashDocumento"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ctebollo", propOrder = { - "debitore", - "enteCreditore", - "hashDocumento" -}) -@XmlRootElement -@AllArgsConstructor -@NoArgsConstructor -@Data -@Builder -public class Ctebollo { - - @XmlElement(required = true) - protected CtDebitore debitore; - @XmlElement(required = true) - protected CtEnteCreditore enteCreditore; - @XmlElement(required = true) - protected CtHashDocumento hashDocumento; - - /** - * Recupera il valore della proprietà debitore. - * - * @return - * possible object is - * {@link CtDebitore } - * - */ - public CtDebitore getDebitore() { - return debitore; - } - - /** - * Imposta il valore della proprietà debitore. - * - * @param value - * allowed object is - * {@link CtDebitore } - * - */ - public void setDebitore(CtDebitore value) { - this.debitore = value; - } - - /** - * Recupera il valore della proprietà enteCreditore. - * - * @return - * possible object is - * {@link CtEnteCreditore } - * - */ - public CtEnteCreditore getEnteCreditore() { - return enteCreditore; - } - - /** - * Imposta il valore della proprietà enteCreditore. - * - * @param value - * allowed object is - * {@link CtEnteCreditore } - * - */ - public void setEnteCreditore(CtEnteCreditore value) { - this.enteCreditore = value; - } - - /** - * Recupera il valore della proprietà hashDocumento. - * - * @return - * possible object is - * {@link CtHashDocumento } - * - */ - public CtHashDocumento getHashDocumento() { - return hashDocumento; - } - - /** - * Imposta il valore della proprietà hashDocumento. - * - * @param value - * allowed object is - * {@link CtHashDocumento } - * - */ - public void setHashDocumento(CtHashDocumento value) { - this.hashDocumento = value; - } - -} diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/ObjectFactory.java b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/ObjectFactory.java index c40f852..fa35bf7 100644 --- a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/ObjectFactory.java +++ b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/ObjectFactory.java @@ -2,7 +2,7 @@ // Questo file è stato generato dall'Eclipse Implementation of JAXB, v3.0.0 // Vedere https://eclipse-ee4j.github.io/jaxb-ri // Qualsiasi modifica a questo file andrà persa durante la ricompilazione dello schema di origine. -// Generato il: 2024.11.28 alle 03:00:54 PM CET +// Generato il: 2024.12.12 alle 03:15:53 PM CET // @@ -18,7 +18,7 @@ /** * This object contains factory methods for each * Java content interface and Java element interface - * generated in the it.gov.spcoop.puntoaccessopsp.ebollo package. + * generated in the it.gov.spcoop.puntoaccessopsp.generalservice package. *

An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML @@ -32,58 +32,34 @@ @XmlRegistry public class ObjectFactory { - private final static QName _Service_QNAME = new QName("http://PuntoAccessoPSP.spcoop.gov.it/ebollo", "service"); + private final static QName _Service_QNAME = new QName("http://PuntoAccessoPSP.spcoop.gov.it/GeneralService", "service"); /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: it.gov.spcoop.puntoaccessopsp.ebollo + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: it.gov.spcoop.puntoaccessopsp.generalservice * */ public ObjectFactory() { } /** - * Create an instance of {@link Ctebollo } + * Create an instance of {@link CtService } * */ - public Ctebollo createCtebollo() { - return new Ctebollo(); + public CtService createCtService() { + return new CtService(); } /** - * Create an instance of {@link CtDebitore } - * - */ - public CtDebitore createCtDebitore() { - return new CtDebitore(); - } - - /** - * Create an instance of {@link CtEnteCreditore } - * - */ - public CtEnteCreditore createCtEnteCreditore() { - return new CtEnteCreditore(); - } - - /** - * Create an instance of {@link CtHashDocumento } - * - */ - public CtHashDocumento createCtHashDocumento() { - return new CtHashDocumento(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Ctebollo }{@code >} + * Create an instance of {@link JAXBElement }{@code <}{@link CtService }{@code >} * * @param value * Java instance representing xml element's value. * @return - * the new instance of {@link JAXBElement }{@code <}{@link Ctebollo }{@code >} + * the new instance of {@link JAXBElement }{@code <}{@link CtService }{@code >} */ - @XmlElementDecl(namespace = "http://PuntoAccessoPSP.spcoop.gov.it/ebollo", name = "service") - public JAXBElement createService(Ctebollo value) { - return new JAXBElement(_Service_QNAME, Ctebollo.class, null, value); + @XmlElementDecl(namespace = "http://PuntoAccessoPSP.spcoop.gov.it/GeneralService", name = "service") + public JAXBElement createService(CtService value) { + return new JAXBElement(_Service_QNAME, CtService.class, null, value); } } diff --git a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/package-info.java b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/package-info.java index cb6ca5d..4c6749d 100644 --- a/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/package-info.java +++ b/src/main/java/it/gov/pagopa/mbd/service/model/xml/node/marcaDaBollo/package-info.java @@ -2,8 +2,8 @@ // Questo file è stato generato dall'Eclipse Implementation of JAXB, v3.0.0 // Vedere https://eclipse-ee4j.github.io/jaxb-ri // Qualsiasi modifica a questo file andrà persa durante la ricompilazione dello schema di origine. -// Generato il: 2024.11.28 alle 03:00:54 PM CET +// Generato il: 2024.12.12 alle 03:15:53 PM CET // -@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://PuntoAccessoPSP.spcoop.gov.it/ebollo", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://PuntoAccessoPSP.spcoop.gov.it/GeneralService", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package it.gov.pagopa.mbd.service.model.xml.node.marcaDaBollo; diff --git a/src/main/java/it/gov/pagopa/mbd/service/service/impl/MbdServiceImpl.java b/src/main/java/it/gov/pagopa/mbd/service/service/impl/MbdServiceImpl.java index bb93937..7b037a1 100644 --- a/src/main/java/it/gov/pagopa/mbd/service/service/impl/MbdServiceImpl.java +++ b/src/main/java/it/gov/pagopa/mbd/service/service/impl/MbdServiceImpl.java @@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.oxm.XmlMappingException; @@ -27,6 +28,9 @@ import java.util.HashMap; import java.util.Set; +import static org.apache.http.HttpHeaders.CONTENT_TYPE; +import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; + @Service @Slf4j public class MbdServiceImpl implements MbdService { @@ -101,14 +105,14 @@ public Mono getMbd(String fiscalCodeEC, GetMbdRequest request) { log.error("Encountered an error during getCart Call: {}", e.getMessage()); return new AppException(AppError.CART_REQUEST_CALL_ERROR, e); }) - .map(item -> ResponseEntity.ok() - .header("MBD-Link", - StringUtils.joinWith("/", mdbLinkBaseUrl, - "mbd/v1/organizations", fiscalCodeEC, - "receipt", hashMap.get("demandPaymentNoticeResponse").getQrCode().getNoticeNumber())) - .header( "MBD-NAV", hashMap.get("demandPaymentNoticeResponse").getQrCode() - .getNoticeNumber()) - .body(item)); + .map(item -> { + String noticeNumber = hashMap.get("demandPaymentNoticeResponse").getQrCode().getNoticeNumber(); + item.setMbdNav(noticeNumber); + item.setNavDownloadLink(StringUtils.joinWith("/", mdbLinkBaseUrl, + "organizations", fiscalCodeEC, + "receipt", noticeNumber)); + return ResponseEntity.ok().header(CONTENT_TYPE, APPLICATION_JSON_VALUE).body(item); + }); } @@ -121,7 +125,7 @@ public Mono getPaymentReceipts(String fiscalCode, String nav) { return Mono.error(new AppException(AppError.PAYMENT_RECEIPTS_CALL_ERROR, e)); }) .map(item -> ResponseEntity.ok() - .header("Content-Type", MediaType.APPLICATION_JSON_VALUE) + .header("Content-Type", APPLICATION_JSON_VALUE) .body(GetMdbReceipt.builder().content(item.getMBDAttachment()).build())); } diff --git a/src/main/resources/MarcaDaBollo.xsd b/src/main/resources/_MarcaDaBollo.xsd similarity index 100% rename from src/main/resources/MarcaDaBollo.xsd rename to src/main/resources/_MarcaDaBollo.xsd diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 41a6d8a..11131ba 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -25,10 +25,10 @@ logging.level.it.gov.pagopa=${APP_LOGGING_LEVEL:INFO} # CORS configuration cors.configuration=${CORS_CONFIGURATION:{"origins": ["*"], "methods": ["*"]}} #Client -mbd.client.demandPayment.endpoint=${DEMAND_PAYMENT_ENDPOINT:http://localhost:8080} +mbd.client.demandPayment.endpoint=${DEMAND_PAYMENT_ENDPOINT:https://api.dev.platform.pagopa.it/nodo-auth/node-for-psp/v1} mbd.client.cart.endpoint=${CART_ENDPOINT:http://localhost:8080} mbd.client.paymentReceipt.endpoint=${PAYMENT_RECEIPT_ENDPOINT:http://localhost:8080}/payments/%s/receipts/%s -mbd.client.demandPayment.subscriptionKey=${DEMAND_PAYMENT_SUBKEY:} +mbd.client.demandPayment.subscriptionKey=${DEMAND_PAYMENT_SUBKEY:66f323afe41f445d9dc1d1d38f5f9250} mbd.client.cart.subscriptionKey=${CART_SUBKEY:} mbd.client.paymentReceipt.subscriptionKey=${PAYMENT_RECEIPT_SUBKEY:} mbd.link.baseUrl=${MBD_BASE_URL:http://localhost:8080} diff --git a/src/main/resources/service.xsd b/src/main/resources/service.xsd new file mode 100644 index 0000000..ae2936d --- /dev/null +++ b/src/main/resources/service.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/java/it/gov/pagopa/mbd/service/controller/HomeControllerTest.java b/src/test/java/it/gov/pagopa/mbd/service/controller/HomeControllerTest.java index 04ac87c..df39c02 100644 --- a/src/test/java/it/gov/pagopa/mbd/service/controller/HomeControllerTest.java +++ b/src/test/java/it/gov/pagopa/mbd/service/controller/HomeControllerTest.java @@ -1,9 +1,14 @@ package it.gov.pagopa.mbd.service.controller; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.reactive.server.WebTestClient; +@ExtendWith(SpringExtension.class) +@WebFluxTest(controllers = HomeController.class) class HomeControllerTest { @Autowired @@ -16,6 +21,6 @@ void healthCheckTestSuccess() throws Exception { @Test void homeTestSuccess() throws Exception { - webClient.get().exchange().expectStatus().is3xxRedirection(); + webClient.get().exchange().expectStatus().is2xxSuccessful(); } } \ No newline at end of file diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index 687ff7a..8eba057 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -9,14 +9,18 @@ server.servlet.context-path=/ server.port=8080 server.shutdown=GRACEFUL # logging -logging.level.root=DEBUG +logging.level.root=INFO logging.level.it.gov.pagopa=DEBUG # CORS configuration cors.configuration={"origins": ["*"], "methods": ["*"]} #Client +mbd.link.baseUrl=${MBD_BASE_URL:http://localhost:8080} mbd.client.demandPayment.endpoint=${DEMAND_PAYMENT_ENDPOINT:http://localhost:8086/demand} mbd.client.cart.endpoint=${CART_ENDPOINT:http://localhost:8086/cart} mbd.client.paymentReceipt.endpoint=${PAYMENT_RECEIPT_ENDPOINT:http://localhost:8086/receipt}/payments/%s/receipts/%s mbd.client.demandPayment.subscriptionKey=${DEMAND_PAYMENT_SUBKEY:} mbd.client.cart.subscriptionKey=${CART_SUBKEY:} -mbd.client.paymentReceipt.subscriptionKey=${PAYMENT_RECEIPT_SUBKEY:} \ No newline at end of file +mbd.client.paymentReceipt.subscriptionKey=${PAYMENT_RECEIPT_SUBKEY:} +mbd.mapper.idPsp=${MBD_ID_PSP:ABI50004} +mbd.mapper.idBrokerPsp=${MBD_ID_BROKER_PSP:99999000011} +mbd.mapper.channelId=${MBD_CHANNEL_ID:99999000011_03} \ No newline at end of file