-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [IOBP-564] Update payment's validation failure mapping (#5694)
> [!WARNING] > This PR depends on pagopa/io-dev-api-server#368 ## Short description This PR updates the pagoPA API definitions to update the payment's verification/validation failures mappings ## List of changes proposed in this pull request - Updated pagoPA API definitions - Updated `WalletPaymentFailure` type - Added missing mappings in payment's failure screen ## How to test Checkout [this PR](pagopa/io-dev-api-server#368) on the `io-dev-api-server`. Add the following piece of configuration in the` config.json` file and play around with fault category codes, trying to reproduce the error screens. ```json "features": { "wallet": { "verificationFailure": { "faultCodeCategory": "PAYMENT_UNKNOWN", "faultCodeDetail": "PAA_PAGAMENTO_SCONOSCIUTO" } } } ``` ## Preview https://github.com/pagopa/io-app/assets/6160324/7efaee4f-cb79-46ba-99a6-f62d25fa40fe
- Loading branch information
Showing
7 changed files
with
55 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 14 additions & 6 deletions
20
ts/features/payments/checkout/types/WalletPaymentFailure.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
import * as t from "io-ts"; | ||
import { GatewayFaultPaymentProblemJson } from "../../../../../definitions/pagopa/ecommerce/GatewayFaultPaymentProblemJson"; | ||
import { PartyConfigurationFaultPaymentProblemJson } from "../../../../../definitions/pagopa/ecommerce/PartyConfigurationFaultPaymentProblemJson"; | ||
import { PartyTimeoutFaultPaymentProblemJson } from "../../../../../definitions/pagopa/ecommerce/PartyTimeoutFaultPaymentProblemJson"; | ||
import { PaymentStatusFaultPaymentProblemJson } from "../../../../../definitions/pagopa/ecommerce/PaymentStatusFaultPaymentProblemJson"; | ||
import { ValidationFaultPaymentProblemJson } from "../../../../../definitions/pagopa/ecommerce/ValidationFaultPaymentProblemJson"; | ||
import { ValidationFaultPaymentUnknownProblemJson } from "../../../../../definitions/pagopa/ecommerce/ValidationFaultPaymentUnknownProblemJson"; | ||
import { ValidationFaultPaymentDataErrorProblemJson } from "../../../../../definitions/pagopa/ecommerce/ValidationFaultPaymentDataErrorProblemJson"; | ||
import { PaymentExpiredStatusFaultPaymentProblemJson } from "../../../../../definitions/pagopa/ecommerce/PaymentExpiredStatusFaultPaymentProblemJson"; | ||
import { PaymentOngoingStatusFaultPaymentProblemJson } from "../../../../../definitions/pagopa/ecommerce/PaymentOngoingStatusFaultPaymentProblemJson"; | ||
import { PaymentCanceledStatusFaultPaymentProblemJson } from "../../../../../definitions/pagopa/ecommerce/PaymentCanceledStatusFaultPaymentProblemJson"; | ||
import { ValidationFaultPaymentUnavailableProblemJson } from "../../../../../definitions/pagopa/ecommerce/ValidationFaultPaymentUnavailableProblemJson"; | ||
import { PaymentDuplicatedStatusFaultPaymentProblemJson } from "../../../../../definitions/pagopa/ecommerce/PaymentDuplicatedStatusFaultPaymentProblemJson"; | ||
|
||
export type WalletPaymentFailure = t.TypeOf<typeof WalletPaymentFailure>; | ||
export const WalletPaymentFailure = t.union([ | ||
ValidationFaultPaymentProblemJson, | ||
PaymentStatusFaultPaymentProblemJson, | ||
GatewayFaultPaymentProblemJson, | ||
PartyConfigurationFaultPaymentProblemJson, | ||
PartyTimeoutFaultPaymentProblemJson | ||
ValidationFaultPaymentUnknownProblemJson, | ||
ValidationFaultPaymentDataErrorProblemJson, | ||
PaymentExpiredStatusFaultPaymentProblemJson, | ||
PaymentOngoingStatusFaultPaymentProblemJson, | ||
PaymentCanceledStatusFaultPaymentProblemJson, | ||
ValidationFaultPaymentUnavailableProblemJson, | ||
PaymentDuplicatedStatusFaultPaymentProblemJson | ||
]); |