Documentation Index
Fetch the complete documentation index at: https://belajarkoding.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Fitur ini menghubungkan pricing di UI dengan transaksi nyata di backend. Area ini mencakup checkout, order page, pengelolaan subscription, dan webhook payment provider.
Apa yang termasuk di fitur ini
/checkout/order/[id]/dashboard/billingPOST /api/paymentsPOST /api/subscriptionPOST /api/webhooks/midtransPOST /api/webhooks/doku
Route dan endpoint terkait
| Route atau endpoint | Jenis | Fungsi |
|---|---|---|
/checkout | Halaman publik | Memulai checkout dari pricing atau CTA upgrade |
/order/[id] | Halaman publik | Melihat status order dan hasil transaksi |
/dashboard/billing | Halaman dashboard | Mengelola paket, upgrade, cancel, atau resume |
POST /api/payments | API mutation | Membuat sesi pembayaran atau pending payment |
POST /api/subscription | API mutation | Cancel atau resume subscription |
GET /payment/callback | Route callback | Mengarahkan balik ke order atau billing sesudah callback payment |
POST /api/webhooks/midtrans | Webhook | Memverifikasi dan memproses event Midtrans |
POST /api/webhooks/doku | Webhook | Memverifikasi dan memproses event Doku |
Dependensi utama
| Item | Wajib? | Catatan |
|---|---|---|
NEXT_PUBLIC_ENABLE_PAYMENTS=true | Ya | Mengaktifkan jalur billing |
| Auth aktif | Ya | User perlu login untuk billing flow |
PAYMENT_PROVIDER | Ya | midtrans atau doku |
| Credential provider | Ya | Sesuai provider yang dipilih |
SUPABASE_SERVICE_ROLE_KEY | Ya untuk banyak write | Dipakai untuk payment write, audit, dan subscription update |
File dan config yang paling sering disentuh
| Area | File utama |
|---|---|
| Katalog plan | config/subscriptions.ts |
| Copy pricing | components/sections/* |
| Payment route | app/api/payments/route.ts atau area setara |
| Subscription action | app/api/subscription/route.ts atau area setara |
| Webhook | app/api/webhooks/* |
Yang biasanya dikustomisasi
- nama dan benefit plan,
- harga paket,
- CTA upgrade,
- copy checkout,
- alur sukses atau gagal payment,
- jalur cancel dan resume subscription,
- messaging order page.
Kapan fitur ini dimatikan
Payments biasanya dimatikan kalau:- produk tidak dijual dengan billing publik,
- produk hanya berupa portal member internal,
- launch masih fokus ke waitlist atau validasi awal.
- pricing checkout,
- CTA upgrade,
- copy yang menjanjikan plan atau subscription,
- entry dashboard billing yang tidak relevan.
Checklist verifikasi
- Satu payment sandbox berhasil dibuat.
- Order page menampilkan status yang benar.
- Webhook sampai ke route yang benar.
- Subscription aktif atau berubah status dengan benar.
- Cancel dan resume berjalan untuk akun test.
- Admin bisa melihat payment dan event yang relevan.