Request Physical Debit Card Linking

This action is part of the baas debit card's actions. It allows the user to enter a shipping Address or use the current address to request a physical debit card if the card stills virtual. This action needs to call the ConfirmOnboardingInfoScreen from PiiOnboarding Module.

Code
  • Changes in LinkerStudio/modules/PiiOnboarding/hooks/shippingAddress/useShippingAddress.ts

Import after the last import:

import {CustomerSelectors} from 'LinkerStudio/modules/baas/common/redux/customer/customerSlice';
import {navigate} from 'src/navigation/RootNavigation';

After the comment /* use useAppSelector for Customer profile data and assign it to this variable */ add the following:

const customer = useAppSelector(CustomerSelectors.getCustomer);

Replace the first useEffect function by the following:

useEffect(() => {
    //Add here the rest of pre-populated values
    if (isRouteShippingAddress) {
      dispatch(reset());
      dispatch(
        setAddress({
          ...customer.address,
          street2: customer.address.street2 ?? '',
        }),
      );
    }
  }, [customer, dispatch, isRouteShippingAddress]);

Replace this

 console.log(
      'Add redux action to handle send shipping address info: ',
      piiAddress.street1,
);

by this:

navigate('PhysicalCardRequestProcess', {shippingAddress: piiAddress});
  • Changes in LinkerStudio/modules/baas/common/utils/baas/BaasHelpers.ts

Import after the last import:

import {reset as resetPii} from 'LinkerStudio/modules/PiiOnboarding/redux/pii';

Add in the function baasResetState before the closing }

dispatch(resetPii());
  • Changes in LinkerStudio/modules/baas/common/navigation/MainStackNavigator.tsx

import {ONBOARDING_SCREENS} from 'LinkerStudio/modules/PiiOnboarding/constants';

Add below the last </Stack.Group>

 <Stack.Group>
  {ONBOARDING_SCREENS.map(screen => {
    return (
     <Stack.Screen
       key={screen.name}
       name={screen.name}
       component={screen.component}
     />
     );
 })}
</Stack.Group>
  • Changes in LinkerStudio/modules/baas/common/navigation/types.ts

Import after the last import

import {OnboardingStackParams} from 'LinkerStudio/modules/PiiOnboarding/navigation/types';

Add in MainStackParams type

& OnboardingStackParams;
  • Changes in LinkerStudio/modules/baas/common/utils/baas/cards/CardsHelpers.ts

navigation.navigate('ConfirmOnboardingInfoScreen', {
          routeType: 'shippingAddress',routeType: 'shippingAddress',
          headerTitle: strings.dashboardItems.headerTitle,
          title: strings.dashboardItems.physicalCardRequestTitle,
          subTitle: strings.dashboardItems.physicalCardRequestSubTitle,
          section: strings.dashboardItems.section,
});

Last updated