Skip to content

Commit

Permalink
fix: read correlation id also for transactions without requested auth…
Browse files Browse the repository at this point in the history
…orization (#89)
  • Loading branch information
pietro-tota authored Mar 11, 2024
1 parent d9e7c4d commit 28eb6de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,10 @@ private fun getTransactionAuthRequestedData(
private fun getTransactionActivatedData(
baseTransaction: BaseTransaction
): TransactionActivatedData? =
when (baseTransaction) {
is BaseTransactionExpired ->
getTransactionActivatedData(baseTransaction.transactionAtPreviousState)
is BaseTransactionWithClosureError ->
getTransactionActivatedData(baseTransaction.transactionAtPreviousState)
is BaseTransactionWithRequestedAuthorization -> baseTransaction.transactionActivatedData
else -> null
if (baseTransaction is BaseTransactionWithPaymentToken) {
baseTransaction.transactionActivatedData
} else {
null
}

private fun getTransactionAuthCompletedData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import it.pagopa.generated.ecommerce.helpdesk.model.*
import java.time.ZonedDateTime
import java.util.*
import java.util.stream.Stream
import kotlin.collections.HashSet
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Assertions.assertEquals
Expand Down Expand Up @@ -234,6 +233,7 @@ class EcommerceForTransactionV2DataProviderTest {
.authorizationCode(null)
.paymentMethodName(null)
.brand(null)
.correlationId(UUID.fromString(correlationId))
)
.paymentInfo(
PaymentInfoDto()
Expand Down Expand Up @@ -1147,6 +1147,7 @@ class EcommerceForTransactionV2DataProviderTest {
.authorizationCode(null)
.paymentMethodName(null)
.brand(null)
.correlationId(UUID.fromString(correlationId))
)
.paymentInfo(
PaymentInfoDto()
Expand Down Expand Up @@ -1254,6 +1255,7 @@ class EcommerceForTransactionV2DataProviderTest {
.authorizationCode(null)
.paymentMethodName(null)
.brand(null)
.correlationId(UUID.fromString(correlationId))
)
.paymentInfo(
PaymentInfoDto()
Expand Down

0 comments on commit 28eb6de

Please sign in to comment.