another one

This commit is contained in:
2025-02-22 20:12:27 +03:00
parent 1e803b4beb
commit b6fa50a59e
201 changed files with 5165 additions and 8036 deletions

View File

@@ -9,6 +9,7 @@ import { Button } from "@/components/ui/button"
import { Label } from "@/components/ui/label"
import { Textarea } from "@/components/ui/textarea"
import { CheckCircle2, ExternalLink } from "lucide-react"
import Cookies from "js-cookie"
// Mock function for generating YooMoney payment link
const generateYooMoneyPaymentLink = async (amount: number): Promise<string> => {
@@ -26,6 +27,10 @@ const verifyYooMoneyPayment = async (): Promise<boolean> => {
return true
}
const setTotalPriceCookie = (totalPrice: number) => {
Cookies.set("totalPrice", totalPrice.toString(), { expires: 1 }) // Expires in 1 day
}
export function CheckoutForm() {
const [address, setAddress] = useState("")
const [isProcessing, setIsProcessing] = useState(false)
@@ -48,6 +53,7 @@ export function CheckoutForm() {
const handleInitiatePayment = async () => {
setIsProcessing(true)
try {
setTotalPriceCookie(totalPrice)
const link = await generateYooMoneyPaymentLink(totalPrice)
setPaymentLink(link)
setStep(2)