-
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-971] Outcome screen for error 404 from server for pspList (
#6393) ## Short description The key changes involve adding support for a new payment error type, `PAYMENT_METHOD_NOT_AVAILABLE_ERROR` to display an outcome when the api call for the list of psp is 404 ## List of changes proposed in this pull request - Updated `getPaymentAnalyticsEventFromRequestFailure` to handle `PAYMENT_METHOD_NOT_AVAILABLE_ERROR` - Added `PaymentMethodNotAvailableProblemJson` type and integrated it into the `WalletPaymentFailure` union type - Updated `paymentsCalculatePaymentFeesAction` to include a cancel action and handle `notFound` errors - Modified the reducer to handle the cancel action and map `notFound` errors to `PAYMENT_METHOD_NOT_AVAILABLE_ERROR` - Send analytics to mixpanel ## How to test With the dev server mock a 404 response for the `calculateFees` function - Start a payment - Select a payment method and continue - Check if outcome result is correct. Tap on the button and check if it goes back to payment method selection ## Preview https://github.com/user-attachments/assets/eabcdabc-8345-4b86-8602-21c21036e2a8
- Loading branch information
1 parent
48d8d35
commit 0709a97
Showing
12 changed files
with
201 additions
and
33 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
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
33 changes: 33 additions & 0 deletions
33
ts/features/payments/checkout/types/PspPaymentMethodNotAvailableProblemJson.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as t from "io-ts"; | ||
import { enumType } from "@pagopa/ts-commons/lib/types"; | ||
|
||
export enum FaultCodeCategoryEnum { | ||
"PSP_PAYMENT_METHOD_NOT_AVAILABLE_ERROR" = "PSP_PAYMENT_METHOD_NOT_AVAILABLE_ERROR" | ||
} | ||
|
||
// required attributes | ||
const PspPaymentMethodNotAvailableProblemJsonR = t.type({ | ||
faultCodeCategory: enumType<FaultCodeCategoryEnum>( | ||
FaultCodeCategoryEnum, | ||
"faultCodeCategory" | ||
), | ||
|
||
faultCodeDetail: t.string | ||
}); | ||
|
||
// optional attributes | ||
const PspPaymentMethodNotAvailableProblemJsonO = t.partial({ | ||
title: t.string | ||
}); | ||
|
||
export const PspPaymentMethodNotAvailableProblemJson = t.intersection( | ||
[ | ||
PspPaymentMethodNotAvailableProblemJsonR, | ||
PspPaymentMethodNotAvailableProblemJsonO | ||
], | ||
"PspPaymentMethodNotAvailableProblemJson" | ||
); | ||
|
||
export type PspPaymentMethodNotAvailableProblemJson = t.TypeOf< | ||
typeof PspPaymentMethodNotAvailableProblemJson | ||
>; |
Oops, something went wrong.