From 63329f56d6f515144d38393635e05cc4a0af005a Mon Sep 17 00:00:00 2001
From: Daniil Chemerkin
Date: Thu, 13 Feb 2025 15:15:04 +0000
Subject: [PATCH] develop
---
.../CompatibilityV2/pages/Payment/index.tsx | 115 ++++++-----
.../pages/Payment/styles.module.scss | 4 +-
.../pages/SecretDiscount/index.tsx | 48 +++--
.../PalmistryV1/pages/Payment/index.tsx | 116 ++++++-----
.../pages/Payment/styles.module.scss | 6 +-
.../pages/SecretDiscount/index.tsx | 49 +++--
.../Payment/nmi/PaymentPage/index.tsx | 189 ++++++++++++++++++
.../nmi/PaymentPage/styles.module.scss | 97 +++++++++
.../Compatibility/v2/index.tsx | 81 +++++++-
src/routerComponents/Palmistry/v1/index.tsx | 81 +++++++-
src/routes.ts | 4 +
11 files changed, 616 insertions(+), 174 deletions(-)
create mode 100644 src/components/Payment/nmi/PaymentPage/index.tsx
create mode 100644 src/components/Payment/nmi/PaymentPage/styles.module.scss
diff --git a/src/components/CompatibilityV2/pages/Payment/index.tsx b/src/components/CompatibilityV2/pages/Payment/index.tsx
index dd13431..bcfd280 100644
--- a/src/components/CompatibilityV2/pages/Payment/index.tsx
+++ b/src/components/CompatibilityV2/pages/Payment/index.tsx
@@ -11,14 +11,10 @@ import Stars from "../../components/Stars";
import { usePaywall } from "@/hooks/paywall/usePaywall";
import { EPlacementKeys } from "@/api/resources/Paywall";
import { useNavigate } from "react-router-dom";
-import { useEffect, useState } from "react";
+import { useEffect } from "react";
import routes from "@/routes";
-import PaymentModal from "@/components/Payment/PaymentModal";
-import PaymentForm from "@/components/Payment/nmi/PaymentForm";
-import Toast from "@/components/pages/ABDesign/v1/components/Toast";
-import metricService, { EGoals, EMetrics } from "@/services/metric/metricService";
-const placementKey = EPlacementKeys['aura.placement.compatibility.v2'];
+// const placementKey = EPlacementKeys['aura.placement.compatibility.v2'];
function Payment() {
const navigate = useNavigate();
@@ -34,63 +30,64 @@ function Payment() {
// const isShowPaymentModal = useSelector(
// selectors.selectCompatibilityV2IsShowPaymentModalV1
// );
- const [isPaymentSuccess, setIsPaymentSuccess] = useState(false);
- const [isPaymentError, setIsPaymentError] = useState(false);
- const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
+ // const [isPaymentSuccess, setIsPaymentSuccess] = useState(false);
+ // const [isPaymentError, setIsPaymentError] = useState(false);
+ // const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
- const onPaymentError = (error?: string) => {
- setIsPaymentError(true);
- if (error === "Product not found") {
- return navigate(routes.client.compatibilityV2TrialChoice());
- }
- metricService.reachGoal(EGoals.PAYMENT_ERROR, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
- }
+ // const onPaymentError = (error?: string) => {
+ // setIsPaymentError(true);
+ // if (error === "Product not found") {
+ // return navigate(routes.client.compatibilityV2TrialChoice());
+ // }
+ // metricService.reachGoal(EGoals.PAYMENT_ERROR, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
+ // }
- const onPaymentSuccess = () => {
- setIsPaymentSuccess(true);
- // metricService.reachGoal(EGoals.PAYMENT_SUCCESS);
- // if (activeProductFromStore) {
- // metricService.reachGoal(EGoals.PURCHASE, [EMetrics.FACEBOOK], {
- // currency: "USD",
- // value: ((activeProductFromStore.trialPrice || 100) / 100).toFixed(2),
- // });
- // }
+ // const onPaymentSuccess = () => {
+ // setIsPaymentSuccess(true);
+ // // metricService.reachGoal(EGoals.PAYMENT_SUCCESS);
+ // // if (activeProductFromStore) {
+ // // metricService.reachGoal(EGoals.PURCHASE, [EMetrics.FACEBOOK], {
+ // // currency: "USD",
+ // // value: ((activeProductFromStore.trialPrice || 100) / 100).toFixed(2),
+ // // });
+ // // }
- metricService.reachGoal(EGoals.PAYMENT_SUCCESS, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
- metricService.reachGoal(EGoals.PURCHASE, [EMetrics.FACEBOOK], {
- currency: "USD",
- value: ((activeProductFromStore?.trialPrice || 100) / 100).toFixed(2),
- });
- setTimeout(() => {
- navigate(routes.client.compatibilityV2SkipTrial());
- }, 1500);
- }
+ // metricService.reachGoal(EGoals.PAYMENT_SUCCESS, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
+ // metricService.reachGoal(EGoals.PURCHASE, [EMetrics.FACEBOOK], {
+ // currency: "USD",
+ // value: ((activeProductFromStore?.trialPrice || 100) / 100).toFixed(2),
+ // });
+ // setTimeout(() => {
+ // navigate(routes.client.compatibilityV2SkipTrial());
+ // }, 1500);
+ // }
- const onModalClosed = () => {
- setIsPaymentModalOpen(false);
- navigate(routes.client.compatibilityV2SaveOff());
- }
+ // const onModalClosed = () => {
+ // setIsPaymentModalOpen(false);
+ // navigate(routes.client.compatibilityV2SaveOff());
+ // }
- const showModal = () => {
+ const handlePayment = () => {
// dispatch(actions.compatibilityV2.setIsShowPaymentModalV1(true));
- metricService.reachGoal(EGoals.PAYMENT_METHODS_OPENED, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
- metricService.reachGoal(EGoals.AURA_PAYMENT_METHODS_OPENED, [EMetrics.KLAVIYO]);
- setIsPaymentModalOpen(true);
+ // metricService.reachGoal(EGoals.PAYMENT_METHODS_OPENED, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
+ // metricService.reachGoal(EGoals.AURA_PAYMENT_METHODS_OPENED, [EMetrics.KLAVIYO]);
+ // setIsPaymentModalOpen(true);
+ navigate(routes.client.compatibilityV2PaymentModal());
};
- useEffect(() => {
- window.onpopstate = function (_event) {
- if (document.location.toString() === `${window.location.origin}${routes.client.compatibilityV2TrialPayment()}`) {
- return navigate(routes.client.compatibilityV2SaveOff());
- }
- };
- return () => {
- setTimeout(() => {
- window.onpopstate = null;
- }, 0);
- };
+ // useEffect(() => {
+ // window.onpopstate = function (_event) {
+ // if (document.location.toString() === `${window.location.origin}${routes.client.compatibilityV2TrialPayment()}`) {
+ // return navigate(routes.client.compatibilityV2SaveOff());
+ // }
+ // };
+ // return () => {
+ // setTimeout(() => {
+ // window.onpopstate = null;
+ // }, 0);
+ // };
- }, [])
+ // }, [])
useEffect(() => {
if (!products.length) return;
@@ -102,13 +99,13 @@ function Payment() {
return (
<>
-
-
+ */}
{translate("/payment.app_number_one", {
@@ -153,11 +150,11 @@ function Payment() {
{/* {!isShowPaymentModal && ( */}
-
- )}
+ )} */}
>
);
diff --git a/src/components/CompatibilityV2/pages/Payment/styles.module.scss b/src/components/CompatibilityV2/pages/Payment/styles.module.scss
index d5a3e20..deb04c4 100644
--- a/src/components/CompatibilityV2/pages/Payment/styles.module.scss
+++ b/src/components/CompatibilityV2/pages/Payment/styles.module.scss
@@ -5,10 +5,11 @@
}
.button {
- position: fixed;
+ position: sticky;
bottom: calc(0dvh + 26px);
max-width: 343px;
font-size: 24px;
+ margin-top: 16px;
}
.payment-modal-hide {
@@ -23,6 +24,7 @@
0% {
transform: translateY(150%);
}
+
100% {
transform: translateY(0);
}
diff --git a/src/components/CompatibilityV2/pages/SecretDiscount/index.tsx b/src/components/CompatibilityV2/pages/SecretDiscount/index.tsx
index 2b2ca2a..841cd0a 100644
--- a/src/components/CompatibilityV2/pages/SecretDiscount/index.tsx
+++ b/src/components/CompatibilityV2/pages/SecretDiscount/index.tsx
@@ -7,7 +7,7 @@ import Button from "../../components/Button";
import { usePaywall } from "@/hooks/paywall/usePaywall";
import { EPlacementKeys } from "@/api/resources/Paywall";
import { addCurrency, ELocalesPlacement } from "@/locales";
-import { useEffect, useState } from "react";
+import { useEffect } from "react";
import { useNavigate } from "react-router-dom";
import routes from "@/routes";
import { useDispatch } from "react-redux";
@@ -16,9 +16,6 @@ import { useTranslations } from "@/hooks/translations";
import { useDynamicSize } from "@/hooks/useDynamicSize";
import Header from "../../components/Header";
-import PaymentModal from "@/components/Payment/PaymentModal";
-import PaymentForm from "@/components/Payment/nmi/PaymentForm";
-import metricService, { EGoals, EMetrics } from "@/services/metric/metricService";
const placementKey = EPlacementKeys["aura.placement.compatibility.v2.secret.discount"]
@@ -48,7 +45,7 @@ function SecretDiscount() {
}))
}, [activeProduct])
- const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
+ // const [isPaymentModalOpen, setIsPaymentModalOpen] = useState(false);
// const {
// error,
@@ -60,29 +57,30 @@ function SecretDiscount() {
// paymentFormType: "lightbox"
// });
- const onPaymentSuccess = () => {
- metricService.reachGoal(EGoals.PAYMENT_SUCCESS, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
- metricService.reachGoal(EGoals.PURCHASE, [EMetrics.FACEBOOK], {
- currency: "USD",
- value: ((activeProduct?.trialPrice || 100) / 100).toFixed(2),
- });
- return navigate(routes.client.paymentSuccess())
- }
+ // const onPaymentSuccess = () => {
+ // metricService.reachGoal(EGoals.PAYMENT_SUCCESS, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
+ // metricService.reachGoal(EGoals.PURCHASE, [EMetrics.FACEBOOK], {
+ // currency: "USD",
+ // value: ((activeProduct?.trialPrice || 100) / 100).toFixed(2),
+ // });
+ // return navigate(routes.client.paymentSuccess())
+ // }
- const onModalClosed = () => {
- setIsPaymentModalOpen(false);
- }
+ // const onModalClosed = () => {
+ // setIsPaymentModalOpen(false);
+ // }
- const onPaymentError = () => {
- metricService.reachGoal(EGoals.PAYMENT_ERROR, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
- return navigate(routes.client.paymentFail())
- }
+ // const onPaymentError = () => {
+ // metricService.reachGoal(EGoals.PAYMENT_ERROR, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
+ // return navigate(routes.client.paymentFail())
+ // }
const openPaymentModal = () => {
- metricService.reachGoal(EGoals.PAYMENT_METHODS_OPENED, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
- metricService.reachGoal(EGoals.AURA_PAYMENT_METHODS_OPENED, [EMetrics.KLAVIYO]);
- setIsPaymentModalOpen(true);
+ // metricService.reachGoal(EGoals.PAYMENT_METHODS_OPENED, [EMetrics.YANDEX, EMetrics.KLAVIYO]);
+ // metricService.reachGoal(EGoals.AURA_PAYMENT_METHODS_OPENED, [EMetrics.KLAVIYO]);
+ // setIsPaymentModalOpen(true);
// showCreditCardForm();
+ navigate(routes.client.compatibilityV2SecretDiscountPaymentModal());
};
// useEffect(() => {
@@ -101,13 +99,13 @@ function SecretDiscount() {