feat/payment-link-flow #13
|
|
@ -1,6 +1,6 @@
|
||||||
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
|
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
|
||||||
import { AppLayout } from './AppLayout'
|
import { AppLayout } from './AppLayout'
|
||||||
import { CheckoutPage } from '../pages/CheckoutPage'
|
// import { CheckoutPage } from '../pages/CheckoutPage'
|
||||||
import { PaymentStatusPage } from '../pages/PaymentStatusPage'
|
import { PaymentStatusPage } from '../pages/PaymentStatusPage'
|
||||||
import { PaymentHistoryPage } from '../pages/PaymentHistoryPage'
|
import { PaymentHistoryPage } from '../pages/PaymentHistoryPage'
|
||||||
import { NotFoundPage } from '../pages/NotFoundPage'
|
import { NotFoundPage } from '../pages/NotFoundPage'
|
||||||
|
|
@ -15,7 +15,7 @@ const router = createBrowserRouter([
|
||||||
errorElement: <div role="alert">Terjadi kesalahan. Coba muat ulang.</div>,
|
errorElement: <div role="alert">Terjadi kesalahan. Coba muat ulang.</div>,
|
||||||
children: [
|
children: [
|
||||||
{ index: true, element: <InitPage /> },
|
{ index: true, element: <InitPage /> },
|
||||||
{ path: 'checkout', element: <CheckoutPage /> },
|
// { path: 'checkout', element: <CheckoutPage /> },
|
||||||
{ path: 'pay/:token', element: <PayPage /> },
|
{ path: 'pay/:token', element: <PayPage /> },
|
||||||
{ path: 'payments/:orderId/status', element: <PaymentStatusPage /> },
|
{ path: 'payments/:orderId/status', element: <PaymentStatusPage /> },
|
||||||
{ path: 'history', element: <PaymentHistoryPage /> },
|
{ path: 'history', element: <PaymentHistoryPage /> },
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export function CStoreLogosRow({ compact = false, size }: { compact?: boolean; s
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<LogoAlfamart compact={compact} size={size} />
|
<LogoAlfamart compact={compact} size={size} />
|
||||||
<LogoIndomaret compact={compact} size={size} />
|
{/* <LogoIndomaret compact={compact} size={size} /> */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ export function usePaymentNavigation() {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
return {
|
return {
|
||||||
toCheckout() {
|
toCheckout() {
|
||||||
navigate('/checkout')
|
window.location.assign('https://erpskrip.id/pembayaran-pelanggan')
|
||||||
},
|
},
|
||||||
toStatus(orderId: string, method?: string) {
|
toStatus(orderId: string, method?: string) {
|
||||||
const qs = method ? `?m=${encodeURIComponent(method)}` : ''
|
const qs = method ? `?m=${encodeURIComponent(method)}` : ''
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ export function NotFoundPage() {
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<h1 className="text-xl font-semibold">Halaman tidak ditemukan</h1>
|
<h1 className="text-xl font-semibold">Halaman tidak ditemukan</h1>
|
||||||
<p className="text-sm text-black/70">Periksa URL atau kembali ke checkout.</p>
|
<p className="text-sm text-black/70">Periksa URL atau kembali ke checkout.</p>
|
||||||
<Link to="/checkout" className="text-brand-600 underline">Kembali ke Checkout</Link>
|
{/* <Link to="/checkout" className="text-brand-600 underline">Kembali ke Checkout</Link> */}
|
||||||
|
<Link to="/" className="text-brand-600 underline">Kembali</Link>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -179,7 +179,8 @@ export function PayPage() {
|
||||||
<div className="space-y-2" aria-live="polite">
|
<div className="space-y-2" aria-live="polite">
|
||||||
<div className="text-xs text-gray-600">Pilih toko untuk membuat kode pembayaran</div>
|
<div className="text-xs text-gray-600">Pilih toko untuk membuat kode pembayaran</div>
|
||||||
<div className={`grid grid-cols-2 gap-2 ${isBusy ? 'pointer-events-none opacity-60' : ''}`}>
|
<div className={`grid grid-cols-2 gap-2 ${isBusy ? 'pointer-events-none opacity-60' : ''}`}>
|
||||||
{(['alfamart', 'indomaret'] as const).map((st) => (
|
{/* {(['alfamart', 'indomaret'] as const).map((st) => ( */}
|
||||||
|
{(['alfamart'] as const).map((st) => (
|
||||||
<button
|
<button
|
||||||
key={st}
|
key={st}
|
||||||
type="button"
|
type="button"
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ export function PaymentStatusPage() {
|
||||||
) : null}
|
) : null}
|
||||||
<div className="mt-4 flex gap-2">
|
<div className="mt-4 flex gap-2">
|
||||||
<Button onClick={() => nav.toHistory()}>Lihat Riwayat</Button>
|
<Button onClick={() => nav.toHistory()}>Lihat Riwayat</Button>
|
||||||
<Button variant="secondary" onClick={() => nav.toCheckout()}>Kembali ke Checkout</Button>
|
<Button variant="secondary" onClick={() => nav.toCheckout()}>Kembali</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{!Env.API_BASE_URL && (
|
{!Env.API_BASE_URL && (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue