diff --git a/ts/navigation/ProfileNavigator.tsx b/ts/navigation/ProfileNavigator.tsx
index e5cebd016c1..3b0a11fd2f3 100644
--- a/ts/navigation/ProfileNavigator.tsx
+++ b/ts/navigation/ProfileNavigator.tsx
@@ -33,6 +33,7 @@ import MarkdownPlayground from "../screens/profile/playgrounds/MarkdownPlaygroun
import WalletPlayground from "../screens/profile/playgrounds/WalletPlayground";
import { useIOSelector } from "../store/hooks";
import { isGestureEnabled } from "../utils/navigation";
+import { WalletPaymentPlayground } from "../screens/profile/playgrounds/WalletPaymentPlayground";
import { ProfileParamsList } from "./params/ProfileParamsList";
import ROUTES from "./routes";
@@ -194,6 +195,10 @@ const ProfileStackNavigator = () => {
name={ROUTES.WALLET_PLAYGROUND}
component={WalletPlayground}
/>
+
{
+ const dispatch = useIODispatch();
+ const navigation = useNavigation>();
+
+ const [rptId, setRptId] = React.useState();
+ const [paymentNoticeNumber, setPaymentNoticeNumber] =
+ React.useState("");
+ const [organizationFiscalCode, setOrganizationFiscalCode] =
+ React.useState("");
+
+ React.useEffect(() => {
+ pipe(
+ rptId,
+ PagoPaRptIdFromString.decode,
+ E.map(rptId => {
+ setPaymentNoticeNumber(
+ PaymentNoticeNumberFromString.encode(rptId.paymentNoticeNumber)
+ );
+ setOrganizationFiscalCode(rptId.organizationFiscalCode);
+ })
+ );
+ }, [rptId]);
+
+ React.useEffect(() => {
+ pipe(
+ sequenceS(E.Monad)({
+ paymentNoticeNumber: E.right(paymentNoticeNumber),
+ organizationFiscalCode: E.right(organizationFiscalCode)
+ }),
+ E.chain(PagoPaRptId.decode),
+ E.map(setRptId),
+ E.getOrElse(() => setRptId(undefined))
+ );
+ }, [paymentNoticeNumber, organizationFiscalCode]);
+
+ const navigateToWalletPayment = () => {
+ pipe(
+ rptId,
+ O.fromNullable,
+ O.map(PagoPaRptIdFromString.encode),
+ O.map(rptId => {
+ dispatch(walletPaymentInitState());
+ navigation.navigate(WalletPaymentRoutes.WALLET_PAYMENT_MAIN, {
+ screen: WalletPaymentRoutes.WALLET_PAYMENT_DETAIL,
+ params: {
+ rptId: rptId as RptId
+ }
+ });
+ })
+ );
+ };
+
+ const generateValidRandomRptId = () => {
+ pipe(
+ "00000123456002160020399398578",
+ PagoPaRptIdFromString.decode,
+ E.map(setRptId)
+ );
+ };
+
+ useHeaderSecondLevel({ title: "Payment playground" });
+
+ return (
+
+
+
+
+
+
+ );
+};
+
+export { WalletPaymentPlayground };
diff --git a/ts/screens/profile/playgrounds/WalletPlayground.tsx b/ts/screens/profile/playgrounds/WalletPlayground.tsx
index dfca8e02db5..5fe9462e3df 100644
--- a/ts/screens/profile/playgrounds/WalletPlayground.tsx
+++ b/ts/screens/profile/playgrounds/WalletPlayground.tsx
@@ -3,22 +3,18 @@ import { Divider, ListItemNav, VSpacer } from "@pagopa/io-app-design-system";
import { useNavigation } from "@react-navigation/native";
import React from "react";
import { ScrollView } from "react-native";
-import { RptId } from "../../../../definitions/pagopa/ecommerce/RptId";
import { Body } from "../../../components/core/typography/Body";
import { H2 } from "../../../components/core/typography/H2";
import { IOStyles } from "../../../components/core/variables/IOStyles";
import BaseScreenComponent from "../../../components/screens/BaseScreenComponent";
import { WalletOnboardingRoutes } from "../../../features/walletV3/onboarding/navigation/navigator";
-import { WalletPaymentRoutes } from "../../../features/walletV3/payment/navigation/routes";
-import { walletPaymentInitState } from "../../../features/walletV3/payment/store/actions/orchestration";
import {
AppParamsList,
IOStackNavigationProp
} from "../../../navigation/params/AppParamsList";
-import { useIODispatch } from "../../../store/hooks";
+import ROUTES from "../../../navigation/routes";
const WalletPlayground = () => {
- const dispatch = useIODispatch();
const navigation = useNavigation>();
const navigateToWalletOnboarding = () => {
@@ -27,13 +23,9 @@ const WalletPlayground = () => {
});
};
- const navigateToWalletPayment = () => {
- dispatch(walletPaymentInitState());
- navigation.navigate(WalletPaymentRoutes.WALLET_PAYMENT_MAIN, {
- screen: WalletPaymentRoutes.WALLET_PAYMENT_DETAIL,
- params: {
- rptId: "00000123456002160020399398578" as RptId
- }
+ const navigateToWalletPaymentPlayground = () => {
+ navigation.navigate(ROUTES.PROFILE_NAVIGATOR, {
+ screen: ROUTES.WALLET_PAYMENT_PLAYGROUND
});
};
@@ -56,7 +48,7 @@ const WalletPlayground = () => {
value="Payment"
accessibilityLabel={"Onboarding Playground"}
description="Start the payment flow to pay with a method of payment"
- onPress={navigateToWalletPayment}
+ onPress={navigateToWalletPaymentPlayground}
/>