Online Payments and Automatic Refunds
Midtrans integration for QRIS, GoPay, and virtual accounts, with promo codes, manual transfers, and automatic access removal on refunds.
- Status
- Live
- Layers
- IntegrationBackendFrontend
- Used by
- Customers buying subscriptions or products, and the admin who handles payments and refunds.

The problem
Manual payment confirmation is slow and error-prone: access starts late, or stays active after the money has been refunded.
The solution
Midtrans payment notifications are signature-checked, recorded once, and unlock access immediately. A full refund on a subscription or digital product trims access automatically, and manual transfers use a unique amount code so they're easy to match.
How it works
What happens, step by step, from the user's point of view.
- 01
The customer picks a plan
The customer chooses a subscription or product and can enter a promo code. The price on screen is the price charged.
- 02
Choose how to pay
Payment by QRIS, GoPay, virtual account, or manual transfer. Manual transfers use an amount with a unique three-digit code.
- 03
Payment is confirmed
Midtrans sends a notification whose signature is checked, and repeats are ignored. For manual transfers, the admin matches the coded amount.
- 04
Access opens right away
Once paid, access switches on and the new period is added after any remaining time. Free orders from a promo activate at once.
- 05
Refunds trim access automatically
When a subscription or digital product is fully refunded, the access from that order is removed. The customer's learning progress is kept.
System design
Who uses it, what they see, what works behind the scenes, and where the data lives. Read it from left to right.
1People
- CustomerPicks a plan and pays from a phone or laptop.
- AdminVerifies manual transfers and processes refunds.
2What they see
- Checkout pageShows the price, promo code box, and payment options.
- Purchase historyOrder status and payment instructions that can be reopened anytime.
3Behind the scenes
- Payment serverCreates orders, receives notifications, then grants or trims access.
4Outside services and data
- MidtransProcesses QRIS, GoPay, and virtual accounts, then sends a notification.
- DatabaseStores orders, payments, access rights, and the audit log.
Key features
- QRIS, GoPay, and virtual accounts
- Access unlocks once paid
- Promo codes and free orders
- Refunds remove access automatically
- Manual transfers with unique codes
Built with
- FastAPI
- PostgreSQL
- Midtrans
- Next.js
What the business gets
- Customer access starts without an admin checking payment slips.
- A full refund automatically ends the access that money paid for.
- A payment notification that arrives twice never grants access twice.
- Manual transfers are easier to match thanks to the coded amount.
Terms on this page
- Payment gateway
- A go-between service, such as Midtrans, that collects payments from banks and e-wallets on your shop's behalf.
- Webhook
- An automatic message Midtrans sends to your system as soon as a payment's status changes.
- Tanda tangan (signature)
- A security code on each notification proving it really came from Midtrans and isn't forged.
Can it work for your business?
For online shops, courses, or subscription services in Indonesia: local payments, promos, and refunds tie straight into your customers' access.
Ask about this project