another one
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user