Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHK-1202 ecommerce commons #37

Closed
wants to merge 10 commits into from
26 changes: 26 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
**/it/pagopa/ecommerce/payment/requests/warmup/**/*
</sonar.coverage.exclusions>
<spotless.version>2.28.0</spotless.version>
<pagopa-ecommerce-commons.version>0.7.3</pagopa-ecommerce-commons.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -96,6 +97,11 @@
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>it.pagopa</groupId>
<artifactId>pagopa-ecommerce-commons</artifactId>
<version>${pagopa-ecommerce-commons.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down Expand Up @@ -377,6 +383,26 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>2.0.0-M3</version>
<configuration>
<skipCheckoutIfExists>true</skipCheckoutIfExists>
<connectionUrl>scm:git:https://github.com/pagopa/pagopa-ecommerce-commons.git</connectionUrl>
<scmVersionType>tag</scmVersionType>
<scmVersion>${pagopa-ecommerce-commons.version}</scmVersion>
<goals>install</goals>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>bootstrap</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package it.pagopa.ecommerce.payment.requests.repositories

import it.pagopa.ecommerce.payment.requests.domain.RptId
import it.pagopa.ecommerce.commons.domain.v1.RptId
import org.springframework.data.annotation.PersistenceCreator

data class PaymentInfo
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package it.pagopa.ecommerce.payment.requests.services

import it.pagopa.ecommerce.commons.domain.v1.RptId
import it.pagopa.ecommerce.generated.nodoperpm.v1.dto.CheckPositionDto
import it.pagopa.ecommerce.generated.nodoperpm.v1.dto.CheckPositionResponseDto
import it.pagopa.ecommerce.generated.nodoperpm.v1.dto.ListelementRequestDto
import it.pagopa.ecommerce.generated.payment.requests.server.model.CartRequestDto
import it.pagopa.ecommerce.generated.payment.requests.server.model.CartRequestReturnUrlsDto
import it.pagopa.ecommerce.generated.payment.requests.server.model.PaymentNoticeDto
import it.pagopa.ecommerce.payment.requests.client.NodoPerPmClient
import it.pagopa.ecommerce.payment.requests.domain.RptId
import it.pagopa.ecommerce.payment.requests.exceptions.CartNotFoundException
import it.pagopa.ecommerce.payment.requests.exceptions.RestApiException
import it.pagopa.ecommerce.payment.requests.repositories.CartInfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package it.pagopa.ecommerce.payment.requests.services

import it.pagopa.ecommerce.commons.domain.v1.RptId
import it.pagopa.ecommerce.commons.repositories.PaymentRequestInfo
import it.pagopa.ecommerce.commons.repositories.PaymentRequestsInfoRepository
import it.pagopa.ecommerce.generated.payment.requests.server.model.PaymentRequestsGetResponseDto
import it.pagopa.ecommerce.generated.transactions.model.CtQrCode
import it.pagopa.ecommerce.generated.transactions.model.StOutcome
import it.pagopa.ecommerce.generated.transactions.model.VerifyPaymentNoticeRes
import it.pagopa.ecommerce.payment.requests.client.NodeForPspClient
import it.pagopa.ecommerce.payment.requests.configurations.nodo.NodoConfig
import it.pagopa.ecommerce.payment.requests.domain.RptId
import it.pagopa.ecommerce.payment.requests.exceptions.InvalidRptException
import it.pagopa.ecommerce.payment.requests.exceptions.NodoErrorException
import it.pagopa.ecommerce.payment.requests.repositories.PaymentRequestInfo
import it.pagopa.ecommerce.payment.requests.repositories.PaymentRequestInfoRepository
import it.pagopa.ecommerce.payment.requests.utils.NodoOperations
import java.util.*
import javax.xml.datatype.XMLGregorianCalendar
Expand All @@ -23,7 +23,7 @@ import reactor.core.publisher.Mono

@Service
class PaymentRequestsService(
@Autowired private val paymentRequestInfoRepository: PaymentRequestInfoRepository,
@Autowired private val paymentRequestInfoRepository: PaymentRequestsInfoRepository,
@Autowired private val nodeForPspClient: NodeForPspClient,
@Autowired
private val objectFactoryNodeForPsp:
Expand Down Expand Up @@ -62,7 +62,7 @@ class PaymentRequestsService(
paName = paymentInfo.paName,
dueDate = paymentInfo.dueDate,
description = paymentInfo.description,
amount = paymentInfo.amount,
amount = paymentInfo.amount!!,
paymentContextCode = paymentContextCode)
}
.doOnNext { logger.info("PaymentRequestInfo retrieved for {}", rptId) }
Expand Down Expand Up @@ -105,19 +105,16 @@ class PaymentRequestsService(
} else {
Mono.just(
PaymentRequestInfo(
id = rptId,
paFiscalCode = verifyPaymentNoticeResponse.fiscalCodePA,
paName = verifyPaymentNoticeResponse.companyName,
description = verifyPaymentNoticeResponse.paymentDescription,
amount =
nodoOperations.getEuroCentsFromNodoAmount(
verifyPaymentNoticeResponse.paymentList.paymentOptionDescription[0].amount),
dueDate =
getDueDateString(
verifyPaymentNoticeResponse.paymentList.paymentOptionDescription[0].dueDate),
paymentToken = null,
idempotencyKey = null,
isCart = false))
rptId,
verifyPaymentNoticeResponse.fiscalCodePA,
verifyPaymentNoticeResponse.companyName,
verifyPaymentNoticeResponse.paymentDescription,
nodoOperations.getEuroCentsFromNodoAmount(
verifyPaymentNoticeResponse.paymentList.paymentOptionDescription[0].amount),
getDueDateString(
verifyPaymentNoticeResponse.paymentList.paymentOptionDescription[0].dueDate),
null,
null))
}
}
return@flatMap paymentRequestInfo
Expand Down
Loading