FIX: Fixed Stripe

This commit is contained in:
JustIceO7
2025-02-15 22:06:06 +00:00
parent fcb07263e3
commit 97067e1f87
3 changed files with 22 additions and 17 deletions

View File

@@ -37,6 +37,8 @@ services:
- app_network - app_network
environment: environment:
- VITE_API_URL=/api - VITE_API_URL=/api
env_file:
- .env
depends_on: depends_on:
- web_server - web_server

View File

@@ -9,6 +9,7 @@ import { useFollow } from "../hooks/useFollow";
import VideoPlayer from "../components/Video/VideoPlayer"; import VideoPlayer from "../components/Video/VideoPlayer";
import { SocketProvider } from "../context/SocketContext"; import { SocketProvider } from "../context/SocketContext";
import AuthModal from "../components/Auth/AuthModal"; import AuthModal from "../components/Auth/AuthModal";
import CheckoutForm, {Return} from "../components/Checkout/CheckoutForm";
interface VideoPageProps { interface VideoPageProps {
streamerId: number; streamerId: number;
@@ -30,22 +31,22 @@ const VideoPage: React.FC<VideoPageProps> = ({ streamerId }) => {
const { isFollowing, checkFollowStatus, followUser, unfollowUser } = const { isFollowing, checkFollowStatus, followUser, unfollowUser } =
useFollow(); useFollow();
const { showAuthModal, setShowAuthModal } = useAuthModal(); const { showAuthModal, setShowAuthModal } = useAuthModal();
// const [showCheckout, setShowCheckout] = useState(false); const [showCheckout, setShowCheckout] = useState(false);
// const showReturn = window.location.search.includes("session_id"); const showReturn = window.location.search.includes("session_id");
const navigate = useNavigate(); const navigate = useNavigate();
// useEffect(() => { useEffect(() => {
// // Prevent scrolling when checkout is open // Prevent scrolling when checkout is open
// if (showCheckout) { if (showCheckout) {
// document.body.style.overflow = "hidden"; document.body.style.overflow = "hidden";
// } else { } else {
// document.body.style.overflow = "unset"; document.body.style.overflow = "unset";
// } }
// // Cleanup function to ensure overflow is restored when component unmounts // Cleanup function to ensure overflow is restored when component unmounts
// return () => { return () => {
// document.body.style.overflow = "unset"; document.body.style.overflow = "unset";
// }; };
// }, [showCheckout]); }, [showCheckout]);
useEffect(() => { useEffect(() => {
// Fetch stream data for this streamer // Fetch stream data for this streamer
@@ -202,6 +203,8 @@ const VideoPage: React.FC<VideoPageProps> = ({ streamerId }) => {
onClick={() => { onClick={() => {
if (!isLoggedIn) { if (!isLoggedIn) {
setShowAuthModal(true); setShowAuthModal(true);
} else {
setShowCheckout(true);
} }
}} }}
> >
@@ -210,8 +213,8 @@ const VideoPage: React.FC<VideoPageProps> = ({ streamerId }) => {
</div> </div>
</div> </div>
{/* {showCheckout && <CheckoutForm onClose={() => setShowCheckout(false)} />} */} {showCheckout && <CheckoutForm onClose={() => setShowCheckout(false)} />}
{/* {showReturn && <Return />} */} {showReturn && <Return />}
{showAuthModal && <AuthModal onClose={() => setShowAuthModal(false)} />} {showAuthModal && <AuthModal onClose={() => setShowAuthModal(false)} />}
</div> </div>
</div> </div>

View File

@@ -21,7 +21,7 @@ def create_checkout_session():
'quantity': 1, 'quantity': 1,
}, },
], ],
mode='payment', mode='subscription',
redirect_on_completion = 'never' redirect_on_completion = 'never'
) )
except Exception as e: except Exception as e: