diff --git a/src/components/UserSubscription/ProcessedPayment.jsx b/src/components/UserSubscription/ProcessedPayment.jsx index b86a00d5..6b988250 100644 --- a/src/components/UserSubscription/ProcessedPayment.jsx +++ b/src/components/UserSubscription/ProcessedPayment.jsx @@ -84,6 +84,11 @@ const ProcessedPayment = ({ setFailPayment(null); if (typeof resetPaymentStep === "function") resetPaymentStep(); }; + const handlPrevious=()=>{ + setCurrentStep, + setStepStatus((prev) => ({ ...prev, 2: "pending" })); + setCurrentStep(2); + } // useEffect(() => { // if (!client || Object.keys(client).length === 0) { @@ -333,7 +338,14 @@ const ProcessedPayment = ({ )} -
+
+
- - {/* ${ - status === "success" - ? "text-success" - : status === "failed" - ? "text-danger" - : stepNumber === currentStep - ? "text-primary" - : "text-muted" - } */} + {step.name} @@ -64,5 +53,5 @@ const SubscriptionLayout = ({ ); }; - export default SubscriptionLayout; + diff --git a/src/components/UserSubscription/VerifiedPayment.jsx b/src/components/UserSubscription/VerifiedPayment.jsx index 59527d2c..1a8f7d53 100644 --- a/src/components/UserSubscription/VerifiedPayment.jsx +++ b/src/components/UserSubscription/VerifiedPayment.jsx @@ -4,8 +4,12 @@ import Invoice from "./Invoice"; const VerifiedPayment = ({ onNext, responsePayment }) => { const [isGenerateInvoice, setIsGenerateInvoice] = useState(false); - - if (!responsePayment) { +useEffect(() => { + if (responsePayment?.success) { + onNext(); + } +}, [responsePayment]); + if (responsePayment) { return (
@@ -23,10 +27,10 @@ const VerifiedPayment = ({ onNext, responsePayment }) => { ); } - if (responsePayment?.success) { - onNext(); + if (!responsePayment?.success) { + return ( -
+
{isGenerateInvoice && ( {
-

+

Thank you for your payment. Your subscription has been successfully activated.

- {/*
-
-
- Subscription Details -
-
    -
  • - Plan Name: - Premium Plan -
  • -
  • - Amount Paid: - ₹999.00 -
  • -
  • - Payment ID: - {responsePayment?.paymentId} -
  • -
  • - Activation Date: - {new Date().toLocaleDateString()} -
  • -
  • - Expiry Date: - 27 Nov 2025 -
  • -
-
-
*/} +
+ + A Set Password link has been sent to your registered email address . + Please check your inbox . + +
-
+
Go to Dashboard diff --git a/src/pages/Home/MakeSubscription.jsx b/src/pages/Home/MakeSubscription.jsx index 1a610872..6c994606 100644 --- a/src/pages/Home/MakeSubscription.jsx +++ b/src/pages/Home/MakeSubscription.jsx @@ -8,7 +8,7 @@ import SelectPlan from "../../components/UserSubscription/SelectPlan"; import Review from "../../components/UserSubscription/Review"; const MakeSubscription = () => { - const [currentStep, setCurrentStep] = useState(1); + const [currentStep, setCurrentStep] = useState(3); const [responsePayment, setResponsePayment] = useState(null); const [stepStatus, setStepStatus] = useState({ @@ -135,38 +135,7 @@ const MakeSubscription = () => { className="collapse navbar-collapse justify-content-end" id="navbarNav" > - + {/* Auth Buttons */}