Skip to content

Commit

Permalink
fix: [IOBP-684] Navigation to the payments home when payment success (#…
Browse files Browse the repository at this point in the history
…5835)

## Short description
This PR fixes the navigation behavior when a payment is successfully
executed by showing the payments homepage. (With the implementation of
biz events you will have to show the transaction details)

## List of changes proposed in this pull request
- Added the `onSuccess` property with the "showTransaction` set that
actually it will redirect to the payments homepage

## How to test
Complete a new payment with the new flow and when it is success, you
should be able to go back to the payments homepage and not to the
barcode screen.

## Preview


https://github.com/pagopa/io-app/assets/34343582/6aeace0f-e279-46af-80ba-247f546a363c
  • Loading branch information
Hantex9 authored Jun 10, 2024
1 parent d1d8487 commit 6f3c320
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const PaymentsBarcodeChoiceScreen = () => {
analytics.trackBarcodeMultipleCodesSelection();

if (isNewWalletSectionEnabled) {
startPaymentFlowWithRptId(barcode.rptId);
startPaymentFlowWithRptId(barcode.rptId, {
onSuccess: "showTransaction"
});
} else {
dispatch(paymentInitializeState());
navigation.navigate(ROUTES.WALLET_NAVIGATOR, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ const PaymentsBarcodeScanScreen = () => {

if (barcode.type === "PAGOPA") {
if (isNewWalletSectionEnabled) {
startPaymentFlowWithRptId(barcode.rptId);
startPaymentFlowWithRptId(barcode.rptId, {
onSuccess: "showTransaction"
});
} else {
dispatch(paymentInitializeState());
switch (barcode.format) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const WalletPaymentInputFiscalCodeScreen = () => {
navigation.pop();
// Navigate to the payment details screen (payment verification)
if (isNewWalletSectionEnabled) {
startPaymentFlowWithRptId(rptId);
startPaymentFlowWithRptId(rptId, { onSuccess: "showTransaction" });
} else {
dispatch(paymentInitializeState());
navigation.navigate(ROUTES.WALLET_NAVIGATOR, {
Expand Down

0 comments on commit 6f3c320

Please sign in to comment.