-
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-644] Add other onboardable method filters (#5785)
## Short description This PR adds a filter on onboardable methods in the add new method section and a filter on methods with guest payment ## List of changes proposed in this pull request - Upgraded the API definitions of e-commerce & walletv3; - Created a utility function to filter the onboardable methods and guest payment methods; ## How to test - Check out this PR: pagopa/io-dev-api-server#379 - Try the new payment checkout flow and onboarding flow with the feature flag enabled - You should be able to complete all the required steps with any error;
- Loading branch information
Showing
7 changed files
with
35 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
import { PaymentMethodManagementTypeEnum } from "../../../../../definitions/pagopa/ecommerce/PaymentMethodManagementType"; | ||
import { PaymentMethodResponse } from "../../../../../definitions/pagopa/ecommerce/PaymentMethodResponse"; | ||
|
||
export const WALLET_PAYMENT_FEEDBACK_URL = | ||
"https://io.italia.it/diccilatua/ces-pagamento"; | ||
|
||
export const isValidPaymentMethod = (method: PaymentMethodResponse) => | ||
method.methodManagement === PaymentMethodManagementTypeEnum.ONBOARDABLE || | ||
method.methodManagement === PaymentMethodManagementTypeEnum.NOT_ONBOARDABLE || | ||
method.methodManagement === | ||
PaymentMethodManagementTypeEnum.ONBOARDABLE_WITH_PAYMENT; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
import { PaymentMethodManagementTypeEnum } from "../../../../../definitions/pagopa/walletv3/PaymentMethodManagementType"; | ||
import { PaymentMethodResponse } from "../../../../../definitions/pagopa/walletv3/PaymentMethodResponse"; | ||
import { PaymentMethodStatusEnum } from "../../../../../definitions/pagopa/walletv3/PaymentMethodStatus"; | ||
|
||
export const ONBOARDING_FAQ_ENABLE_3DS = "https://io.italia.it/faq/#n3_3"; | ||
export const ONBOARDING_CALLBACK_URL_SCHEMA = "iowallet"; | ||
export const ONBOARDING_OUTCOME_PATH = "/wallets/outcomes"; | ||
|
||
export const isMethodOnboardable = ({ | ||
methodManagement, | ||
status | ||
}: PaymentMethodResponse) => | ||
[ | ||
PaymentMethodManagementTypeEnum.ONBOARDABLE, | ||
PaymentMethodManagementTypeEnum.ONBOARDABLE_ONLY, | ||
PaymentMethodManagementTypeEnum.ONBOARDABLE_WITH_PAYMENT | ||
].includes(methodManagement) && status === PaymentMethodStatusEnum.ENABLED; |
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