Murai Demo
Next.js + Midtrans Snap example
Next.js + Midtrans Snap example
Current Balance
IDR 70,000
1 token = IDR 1 in this demo. Top-ups and spending use the same unit.
Creates a Midtrans Snap checkout session, then redirects to the payment page.
Credits that expire in 30 seconds. Demonstrates FIFO bucket expiry.
Deducts from balance atomically. Idempotency key prevents double-charges.
Expire all credits past their expiry date. Creates debit entries to zero out expired buckets.
Spend
3/2/2026, 10:09:34 AM
IDR 10,000
Top-up
3/2/2026, 10:08:48 AM
+IDR 10,000
Spend
3/2/2026, 9:31:51 AM
IDR 25,000
Spend
3/2/2026, 9:31:50 AM
IDR 10,000
Top-up
3/2/2026, 9:15:17 AM
+IDR 25,000