-
Halaman tidak ditemukan
-
Periksa URL atau kembali ke checkout.
- {/*
Kembali ke Checkout */}
-
Kembali
+
+
+
+
+
+
404
+
Halaman Tidak Ditemukan
+
+
+
+
+ Maaf, halaman yang Anda cari tidak dapat ditemukan. Silakan periksa kembali URL yang Anda masukkan atau kembali ke halaman utama.
+
+
+
+
+
+
Kembali ke Halaman Utama
+
+
+
+
+
Ke Halaman Checkout
+
+
+
+
+
+
+
+ Butuh bantuan? Hubungi customer service kami
+
+
+
)
}
\ No newline at end of file
diff --git a/src/pages/PayPage.tsx b/src/pages/PayPage.tsx
index d7a601e..48a9aff 100644
--- a/src/pages/PayPage.tsx
+++ b/src/pages/PayPage.tsx
@@ -21,9 +21,10 @@ interface AutoSnapPaymentProps {
customer?: { name?: string; phone?: string; email?: string }
onSuccess?: (result: any) => void
onError?: (error: any) => void
+ onModalClosed?: () => void
}
-function AutoSnapPayment({ orderId, amount, customer, onSuccess, onError }: AutoSnapPaymentProps) {
+function AutoSnapPayment({ orderId, amount, customer, onSuccess, onError, onModalClosed }: AutoSnapPaymentProps) {
const [loading, setLoading] = React.useState(false)
const [error, setError] = React.useState('')
const [paymentTriggered, setPaymentTriggered] = React.useState(false)
@@ -108,6 +109,7 @@ function AutoSnapPayment({ orderId, amount, customer, onSuccess, onError }: Auto
onClose: () => {
Logger.paymentInfo('paypage.auto.snap.popup.closed', { orderId })
setLoading(false)
+ onModalClosed?.() // Trigger callback when modal closed
}
})
@@ -149,7 +151,7 @@ function AutoSnapPayment({ orderId, amount, customer, onSuccess, onError }: Auto
console.log('[PayPage] Setting timeout')
const timer = setTimeout(triggerPayment, 500)
return () => clearTimeout(timer)
- }, [orderId, amount, customer, paymentTriggered, onSuccess, onError])
+ }, [orderId, amount, customer, paymentTriggered, onSuccess, onError, onModalClosed])
// Don't render anything until we have valid data
if (!orderId || !amount) {
@@ -203,6 +205,7 @@ export function PayPage() {
const [locked, setLocked] = useState
(false)
const [customer, setCustomer] = useState<{ name?: string; phone?: string; email?: string } | undefined>(undefined)
const [error, setError] = useState<{ code?: string; message?: string } | null>(null)
+ const [snapModalClosed, setSnapModalClosed] = useState(false)
usePaymentConfig()
const currentStep = 2
@@ -297,8 +300,29 @@ export function PayPage() {
}}
onError={(error) => {
console.error('[PayPage] Payment error:', error)
+ setSnapModalClosed(true)
+ }}
+ onModalClosed={() => {
+ console.log('[PayPage] Snap modal closed')
+ setSnapModalClosed(true)
}}
/>
+
+ {/* Tombol reload jika Snap modal ditutup tanpa pembayaran */}
+ {snapModalClosed && (
+
+
+ Ingin memilih metode pembayaran lain?
+
+
+
+ )}
)}