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

chore: [IOBP-982] Add outcome 99 screen into payment flow #6424

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,9 @@ wallet:
PLAFOND_LIMIT_ERROR:
title: Hai superato il limite di spesa della tua carta
subtitle: Non è stato addebitato alcun importo. Prima di riprovare, modifica il limite di spesa o usa un altro metodo di pagamento.
BE_NODE_KO:
title: Stiamo riscontrando alcuni problemi sui sistemi di pagamento
subtitle: Verifica l’esito del pagamento nella sezione Pagamenti, altrimenti attendi qualche minuto prima di riprovare.
support:
button: "Contatta l'assistenza"
supportTitle: Contatta l'assistenza
Expand Down
3 changes: 3 additions & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,9 @@ wallet:
PLAFOND_LIMIT_ERROR:
title: Hai superato il limite di spesa della tua carta
subtitle: Non è stato addebitato alcun importo. Prima di riprovare, modifica il limite di spesa o usa un altro metodo di pagamento.
BE_NODE_KO:
title: Stiamo riscontrando alcuni problemi sui sistemi di pagamento
subtitle: Verifica l’esito del pagamento nella sezione Pagamenti, altrimenti attendi qualche minuto prima di riprovare.
support:
button: "Contatta l'assistenza"
supportTitle: Contatta l'assistenza
Expand Down
15 changes: 15 additions & 0 deletions ts/features/payments/checkout/analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type PaymentAnalyticsProps = {
editing: PaymentAnalyticsEditingType;
};

// eslint-disable-next-line complexity
export const getPaymentAnalyticsEventFromFailureOutcome = (
outcome: WalletPaymentOutcomeEnum
) => {
Expand Down Expand Up @@ -68,6 +69,20 @@ export const getPaymentAnalyticsEventFromFailureOutcome = (
return "PAYMENT_WEBVIEW_USER_CANCELLATION";
case WalletPaymentOutcomeEnum.PAYPAL_REMOVED_ERROR:
return "PAYMENT_METHOD_AUTHORIZATION_ERROR";
case WalletPaymentOutcomeEnum.BE_NODE_KO:
return "PAYMENT_SLOWDOWN_ERROR";
case WalletPaymentOutcomeEnum.INSUFFICIENT_AVAILABILITY_ERROR:
return "PAYMENT_INSUFFICIENT_AVAILABILITY_ERROR";
case WalletPaymentOutcomeEnum.CVV_ERROR:
return "PAYMENT_CVV_ERROR";
case WalletPaymentOutcomeEnum.PLAFOND_LIMIT_ERROR:
return "PAYMENT_PLAFOND_LIMIT_ERROR";
case WalletPaymentOutcomeEnum.KO_RETRIABLE:
return "PAYMENT_KO_RETRIABLE";
case WalletPaymentOutcomeEnum.ORDER_NOT_PRESENT:
return "PAYMENT_ORDER_NOT_PRESENT";
case WalletPaymentOutcomeEnum.DUPLICATE_ORDER:
return "PAYMENT_DUPLICATE_ORDER";
default:
return outcome;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,7 @@ const WalletPaymentOutcomeScreen = () => {
"wallet.payment.outcome.PAYMENT_METHODS_NOT_AVAILABLE.subtitle"
),
action: onboardPaymentMethodAction,
secondaryAction: onboardPaymentMethodCloseAction,
isHeaderVisible: true
secondaryAction: onboardPaymentMethodCloseAction
};
case WalletPaymentOutcomeEnum.PAYMENT_REVERSED:
return {
Expand Down Expand Up @@ -429,8 +428,7 @@ const WalletPaymentOutcomeScreen = () => {
subtitle: I18n.t(
"wallet.payment.outcome.IN_APP_BROWSER_CLOSED_BY_USER.subtitle"
),
action: closeFailureAction,
isHeaderVisible: true
action: closeFailureAction
};
case WalletPaymentOutcomeEnum.INSUFFICIENT_AVAILABILITY_ERROR:
return {
Expand Down Expand Up @@ -459,14 +457,22 @@ const WalletPaymentOutcomeScreen = () => {
),
action: closeFailureAction
};
case WalletPaymentOutcomeEnum.BE_NODE_KO:
return {
pictogram: "umbrellaNew",
title: I18n.t("wallet.payment.outcome.BE_NODE_KO.title"),
subtitle: I18n.t("wallet.payment.outcome.BE_NODE_KO.subtitle"),
action: closeFailureAction,
secondaryAction: contactSupportAction
};
}
};

const requiresFeedback = outcome === WalletPaymentOutcomeEnum.SUCCESS;

return (
<>
<OperationResultScreenContent {...getPropsForOutcome()}>
<OperationResultScreenContent isHeaderVisible {...getPropsForOutcome()}>
{requiresFeedback && <WalletPaymentFeebackBanner />}
</OperationResultScreenContent>
{supportModal.bottomSheet}
Expand Down
Loading
Loading