QR |
QRIS / VA Payment Gateway (Midtrans)
Accept QRIS and bank Virtual Accounts at Odoo 14 website checkout — payment status updates automatically
Odoo 14
LGPL-3
Midtrans
|
This module adds QRIS and Virtual Account (BCA, BNI, BRI, Mandiri, Permata) payment methods through the Midtrans payment gateway on Odoo 14 website checkout. The customer pays, Midtrans sends a notification (webhook) to Odoo, the notification signature is verified, and then the transaction status and the Sales Order are updated automatically — without manual input.
Two integration modes fit different stores: Snap redirects the customer to the Midtrans payment page (simplest — every method is shown there), or Core API shows the QR code / VA number directly on your own website.
5 Virtual Account banks (BCA, BNI, BRI, Mandiri, Permata) |
2 integration modes (Snap, Core API) |
3 credentials per acquirer (Merchant ID, Client Key, Server Key) |
Key Features
Everything this module adds on top of the Odoo payment framework.
✓ QRIS For all e-wallets & mobile banking (GoPay, OVO, DANA, ShopeePay, and more). |
✓ Virtual Account BCA, BNI, BRI, Mandiri (eChannel), and Permata. |
✓ Two integration modes Snap — the customer is redirected to the Midtrans payment page; or Core API — the QR code / VA number is shown on your own website. |
✓ Methods can be limited per acquirer All methods, QRIS only, or one specific bank VA — create several acquirers if you want separate choices at checkout. |
✓ Verified webhook Every notification is checked: signature_key = SHA512(order_id + status_code + gross_amount + Server Key) before it is trusted. |
✓ Amount & currency validated The amount and currency are validated against the Odoo transaction; a notification that does not match changes no status at all. |
✓ Automatic status mapping settlement / capture accepted = Done, pending = Pending, deny / cancel / expire = Cancel, failure = Error. |
✓ Order confirmed automatically Through Odoo's own mechanism as soon as the transaction is Done (including payment & invoice creation when enabled). |
✓ Idempotent Duplicate notifications from Midtrans are safe — a finished transaction is never processed twice. |
✓ Test (Sandbox) and Production modes Just switch the acquirer state and the matching key pair. |
✓ Safe logging Activity is recorded in the server log without ever recording the Server Key / credentials. |
✓ Automatic payment journal Odoo creates the payment journal for this acquirer (post-init of the payment framework). |
How It Works
From checkout to a confirmed order — the customer pays, Midtrans notifies, Odoo verifies and updates.
1 Customer checks out The customer checks out on the website, chooses QRIS / Virtual Account (Midtrans), and clicks Pay Now. |
2 Customer pays Snap mode: the customer is redirected to the Midtrans page, chooses QRIS/VA, and pays. Core API mode: the customer sees the QR code / VA number on your website and pays from the bank / e-wallet app. |
3 Midtrans notifies Odoo Midtrans sends a notification to the webhook URL; Odoo verifies the signature and the amount, then updates the transaction status. |
4 Transaction Done A Done transaction confirms the Sales Order automatically; the customer can see the final status on the confirmation page and receives an email from Odoo. |
5 Duplicate-safe Notifications are idempotent: a duplicate notification never processes a finished transaction twice. |
Compatibility
Both dependencies are required: the payment framework for the acquirer, and website_sale for checkout.
| Module | Status |
|---|---|
| Odoo version | 14.0 only |
| Edition | Community and Enterprise (the code depends on no Enterprise-only module) |
| payment | Required — the payment acquirer framework |
| website_sale | Required — website checkout |
QRIS / VA only works with IDR. The notification URL must be reachable publicly over HTTPS so Midtrans can send status notifications.
Screenshots
Real screens from the Odoo 14 test database (test14). No real transaction was made.
1. Payment Acquirer form — QRIS / VA (Midtrans), Credentials tab: Merchant ID, Client Key, Server Key, Integration Mode (Snap), Payment Method.

2. Payment Acquirers list — the QRIS / VA tile (Disabled in the test database) next to the other acquirers.

3. Acquirer form, Configuration tab — Payment Form, Availability, and Payment Followup with the Payment Journal "QRIS / VA (Midtrans)".

User Guide
- 1. Register and prepare a Midtrans account. Register as a merchant at midtrans.com and complete the business verification. For testing, use the Sandbox environment. To receive real money, activate the Production environment after the account is approved. Enable the payment methods you need in the Midtrans dashboard (Settings > Snap preferences / Payment methods): QRIS and the Virtual Account banks you use. QRIS is active automatically for merchants that can use GoPay.
- 2. Take the Access Keys. In the Midtrans dashboard open Settings > Access keys. Note three values: Merchant ID, Client Key, and Server Key. Attention: Sandbox and Production keys are different. Use the pair that matches the acquirer mode in Odoo.
- 3. Register the Notification URL (required). In the Midtrans dashboard open Settings > Configuration. Fill Payment Notification URL with: https://YOUR-DOMAIN/payment/midtrans_qris_va/notification. Replace YOUR-DOMAIN with your Odoo domain. This URL must be publicly reachable over HTTPS so Midtrans can send status notifications. (Optional) Finish Redirect URL can be filled with: https://YOUR-DOMAIN/payment/midtrans_qris_va/return.
- 4. Configure the acquirer in Odoo. Open Invoicing / Accounting > Configuration > Payment Acquirers (or Website > Configuration > Payment Acquirers). Select QRIS / VA (Midtrans). Fill in Merchant ID, Client Key, and Server Key. Choose the Integration Mode: Snap — the customer is redirected to the Midtrans payment page (simplest, all methods shown there); or Core API — the QRIS code or VA number is shown directly on your website. Choose the Payment Method: all methods, QRIS only, or one specific bank VA. Change the State to Test Mode (Sandbox) or Enabled (Production), then save. The acquirer starts appearing on the website payment page.
- 5. Customer payment flow. The customer checks out on the website and chooses QRIS / Virtual Account (Midtrans), then clicks Pay Now. Snap mode: the customer is redirected to the Midtrans page, chooses QRIS/VA, and pays. Core API mode: the customer sees the QR code / VA number on your website and pays from the bank / e-wallet app. Midtrans sends a notification to the webhook URL; Odoo verifies the signature and the amount, then updates the transaction status. A Done transaction confirms the Sales Order automatically; the customer can see the final status on the confirmation page and receives an email from Odoo.
- 6. Test Mode vs Production. Test Mode: Odoo uses the Midtrans Sandbox endpoints. Use Sandbox keys. Pay with the test instruments from the Midtrans documentation (e.g. VA / QRIS Sandbox simulator). No real money moves. Enabled (Production): replace all three keys with Production keys, make sure the notification URL points to the public HTTPS domain, then run one small real transaction for end-to-end verification. Do not mix Sandbox keys with Production mode or the other way around — Midtrans will reject the transaction.
Business Cases
Real behaviour of the module in the situations it was built for — no invented figures.
| Situation | What happens |
|---|---|
| A customer pays with QRIS | Midtrans sends the settlement notification; Odoo verifies the signature and amount, sets the transaction to Done, and the Sales Order is confirmed automatically — no manual input. |
| A customer pays a BCA Virtual Account | The same flow: the VA notification is verified and the transaction becomes Done, confirming the order. |
| Midtrans sends the same notification twice | Nothing is processed twice. Notifications are idempotent, so a finished transaction is never processed a second time. |
| A notification arrives with the wrong amount | It is rejected: the amount is validated against the Odoo transaction, and a mismatched notification changes no status at all. |
| Testing before going live | Use Test Mode with Sandbox keys and the Midtrans test instruments. No real money moves until you switch to Production keys. |
Installation
- Copy the gateway_qris_va folder into an addons path of your Odoo 14 installation.
- Upload the module zip through the Upload Module menu (or install from Apps → Update Apps List → Install).
- Restart the Odoo server once after uploading, because the module contains Python code.
- After the restart, the QRIS / VA (Midtrans) acquirer record is available under Payment Acquirers, and its payment journal is created automatically on a company that already has a Chart of Accounts.
- Configure the acquirer as described in the User Guide (Merchant ID, Client Key, Server Key, mode, method, state).
Frequently Asked Questions
The acquirer does not appear at checkout.
Make sure the State is not Disabled, the keys are filled in, the acquirer is linked to the correct company, and the website uses the same company.
The status does not change after the customer paid.
Check that the notification URL in the Midtrans dashboard is exactly /payment/midtrans_qris_va/notification and is publicly reachable (not localhost); check the Odoo server log for lines starting with "Midtrans QRIS/VA: notification".
Notifications are rejected / signature invalid.
The Server Key in Odoo is not the same as the Midtrans environment that sent the notification (Sandbox vs Production mixed up), or the key changed after a reset in the dashboard. Match them again.
Amount does not match.
Make sure the order price did not change after the transaction was created; create a new transaction from checkout.
Midtrans rejects the transaction (HTTP 4xx).
The rejection message is shown to the customer and recorded in the transaction's state message. Common causes: wrong keys, the method not enabled in the Midtrans dashboard, or a currency other than IDR (QRIS/VA is for IDR only).
Transaction is Done but the payment (account.payment) is not created yet.
Make sure the acquirer has a Payment Journal (created automatically when the module is installed on a company that already has a Chart of Accounts) and wait for the cron "Payment: Post-process transactions" to retry processing, or open the transaction and check its messages.
Not in this build
- QRIS and Virtual Account only, for IDR only.
- Midtrans only — no other payment gateway is included.
- Sandbox and Production keys are different and must match the acquirer mode; mixing them makes Midtrans reject transactions.
- The notification URL must be publicly reachable over HTTPS; localhost cannot receive Midtrans notifications.
Support
Author: Ahmad Ghozali · License: LGPL-3. Module gateway_qris_va version 14.0.1.0.6.
QR |
QRIS / VA Payment Gateway (Midtrans)
Terima QRIS dan Virtual Account bank di checkout website Odoo 14 — status lunas masuk ke Odoo otomatis
Odoo 14
LGPL-3
Midtrans
|
Modul ini menambahkan metode pembayaran QRIS dan Virtual Account (BCA, BNI, BRI, Mandiri, Permata) melalui payment gateway Midtrans pada checkout website Odoo 14. Pelanggan membayar, Midtrans mengirim notifikasi (webhook) ke Odoo, signature notifikasi diverifikasi, lalu status transaksi dan Sales Order diperbarui otomatis — tanpa input manual.
Dua mode integrasi sesuai kebutuhan toko: Snap mengarahkan pelanggan ke halaman pembayaran Midtrans (paling sederhana — semua metode tampil di sana), atau Core API menampilkan kode QR / nomor VA langsung di website Anda.
5 Bank Virtual Account (BCA, BNI, BRI, Mandiri, Permata) |
2 mode integrasi (Snap, Core API) |
3 kredensial per acquirer (Merchant ID, Client Key, Server Key) |
Fitur Utama
Semua yang ditambahkan modul ini di atas framework payment Odoo.
✓ QRIS Untuk semua e-wallet & mobile banking (GoPay, OVO, DANA, ShopeePay, dsb.). |
✓ Virtual Account BCA, BNI, BRI, Mandiri (eChannel), dan Permata. |
✓ Dua mode integrasi Snap — pelanggan diarahkan ke halaman pembayaran Midtrans; atau Core API — kode QR / nomor VA ditampilkan di website sendiri. |
✓ Metode dapat dibatasi per acquirer Semua metode, QRIS saja, atau satu VA bank tertentu — buat beberapa acquirer bila ingin pilihan terpisah di checkout. |
✓ Webhook terverifikasi Setiap notifikasi dicek: signature_key = SHA512(order_id + status_code + gross_amount + Server Key) sebelum dipercaya. |
✓ Nominal & mata uang divalidasi Nominal dan mata uang divalidasi terhadap transaksi Odoo; notifikasi yang tidak cocok tidak mengubah status apa pun. |
✓ Pemetaan status otomatis settlement / capture diterima = Done, pending = Pending, deny / cancel / expire = Cancel, failure = Error. |
✓ Order terkonfirmasi otomatis Lewat mekanisme bawaan Odoo begitu transaksi Done (termasuk pembuatan pembayaran & invoice bila diaktifkan). |
✓ Idempoten Notifikasi ganda dari Midtrans aman — transaksi yang sudah selesai tidak pernah diproses dua kali. |
✓ Mode Test (Sandbox) dan Production Tinggal ganti status acquirer dan pasangan kunci yang sesuai. |
✓ Log aman Aktivitas tercatat di log server tanpa pernah mencatat Server Key / kredensial. |
✓ Jurnal pembayaran otomatis Odoo membuat jurnal pembayaran untuk acquirer ini (post-init bawaan framework payment). |
Cara Kerja
Dari checkout sampai order terkonfirmasi — pelanggan membayar, Midtrans memberi tahu, Odoo memverifikasi dan memperbarui.
1 Pelanggan checkout Pelanggan checkout di website, memilih QRIS / Virtual Account (Midtrans), lalu klik Pay Now. |
2 Pelanggan membayar Mode Snap: pelanggan diarahkan ke halaman Midtrans, memilih QRIS/VA, dan membayar. Mode Core API: pelanggan melihat kode QR / nomor VA di website Anda dan membayar lewat aplikasi bank/e-wallet. |
3 Midtrans memberi tahu Odoo Midtrans mengirim notifikasi ke URL webhook; Odoo memverifikasi signature dan nominal, lalu memperbarui status transaksi. |
4 Transaksi Done Transaksi Done membuat Sales Order terkonfirmasi otomatis; pelanggan dapat melihat status akhir di halaman konfirmasi dan menerima email dari Odoo. |
5 Aman dari duplikat Notifikasi bersifat idempoten: notifikasi ganda tidak pernah memproses transaksi yang sudah selesai dua kali. |
Kompatibilitas
Kedua depends wajib: framework payment untuk acquirer, dan website_sale untuk checkout.
| Modul | Status |
|---|---|
| Versi Odoo | Hanya 14.0 |
| Edisi | Community dan Enterprise (kode tidak bergantung pada modul khusus Enterprise) |
| payment | Wajib — framework payment acquirer |
| website_sale | Wajib — checkout website |
QRIS / VA hanya berlaku untuk mata uang IDR. URL notifikasi harus dapat dijangkau publik melalui HTTPS agar Midtrans bisa mengirim notifikasi status.
Tangkapan Layar
Layar asli dari database uji Odoo 14 (test14). Tidak ada transaksi nyata yang dilakukan.
1. Form Payment Acquirer — QRIS / VA (Midtrans), tab Credentials: Merchant ID, Client Key, Server Key, Mode Integrasi (Snap), Metode Pembayaran.

2. Daftar Payment Acquirers — tile QRIS / VA (Disabled di database uji) di samping acquirer lain.

3. Form acquirer, tab Configuration — Payment Form, Availability, dan Payment Followup dengan Payment Journal "QRIS / VA (Midtrans)".

Panduan Pengguna
- 1. Daftar dan siapkan akun Midtrans. Daftar merchant di midtrans.com dan selesaikan verifikasi bisnis. Untuk pengujian, gunakan environment Sandbox. Untuk menerima uang sungguhan, aktifkan environment Production sesudah akun disetujui. Aktifkan metode pembayaran yang diinginkan di dashboard Midtrans (Settings > Snap preferences / Payment methods): QRIS dan Virtual Account bank yang dipakai. QRIS aktif otomatis untuk merchant yang dapat memakai GoPay.
- 2. Ambil Access Keys. Di dashboard Midtrans buka Settings > Access keys. Catat tiga nilai: Merchant ID, Client Key, dan Server Key. Perhatian: kunci Sandbox dan Production berbeda. Pakai pasangan yang sama dengan mode acquirer di Odoo.
- 3. Daftarkan URL Notifikasi (wajib). Di dashboard Midtrans buka Settings > Configuration. Isi Payment Notification URL dengan: https://DOMAIN-ANDA/payment/midtrans_qris_va/notification. Ganti DOMAIN-ANDA dengan domain Odoo Anda. URL ini harus dapat dijangkau publik melalui HTTPS agar Midtrans bisa mengirim notifikasi status. (Opsional) Finish Redirect URL boleh diisi: https://DOMAIN-ANDA/payment/midtrans_qris_va/return.
- 4. Konfigurasi acquirer di Odoo. Buka Invoicing / Accounting > Configuration > Payment Acquirers (atau Website > Configuration > Payment Acquirers). Pilih QRIS / VA (Midtrans). Isi Merchant ID, Client Key, dan Server Key. Pilih Mode Integrasi: Snap — pelanggan diarahkan ke halaman pembayaran Midtrans (paling sederhana, semua metode tampil di sana); atau Core API — kode QR QRIS atau nomor VA ditampilkan langsung di website Anda. Pilih Metode Pembayaran: semua metode, QRIS saja, atau VA bank tertentu. Ubah State menjadi Test Mode (Sandbox) atau Enabled (Production), lalu simpan. Acquirer mulai tampil di halaman pembayaran website.
- 5. Alur pembayaran pelanggan. Pelanggan checkout di website dan memilih QRIS / Virtual Account (Midtrans), lalu klik Pay Now. Mode Snap: pelanggan diarahkan ke halaman Midtrans, memilih QRIS/VA, dan membayar. Mode Core API: pelanggan melihat kode QR / nomor VA di website Anda dan membayar lewat aplikasi bank/e-wallet. Midtrans mengirim notifikasi ke URL webhook; Odoo memverifikasi signature dan nominal, lalu memperbarui status transaksi. Transaksi Done membuat Sales Order terkonfirmasi otomatis; pelanggan dapat melihat status akhir di halaman konfirmasi dan menerima email dari Odoo.
- 6. Mode Test vs Production. Test Mode: Odoo memakai endpoint Sandbox Midtrans. Gunakan kunci Sandbox. Bayar memakai instrumen uji dari dokumentasi Midtrans (mis. simulator VA / QRIS Sandbox). Tidak ada uang sungguhan yang bergerak. Enabled (Production): ganti ketiga kunci dengan kunci Production, pastikan URL notifikasi menunjuk domain publik HTTPS, lalu lakukan satu transaksi kecil sungguhan untuk verifikasi ujung-ke-ujung. Jangan mencampur kunci Sandbox dengan mode Production atau sebaliknya — Midtrans akan menolak transaksi.
Contoh Kasus
Perilaku nyata modul ini pada situasi yang memang dibuat untuknya — tanpa angka karangan.
| Situasi | Yang terjadi |
|---|---|
| Pelanggan membayar dengan QRIS | Midtrans mengirim notifikasi settlement; Odoo memverifikasi signature dan nominal, mengubah transaksi menjadi Done, dan Sales Order terkonfirmasi otomatis — tanpa input manual. |
| Pelanggan membayar VA BCA | Alur yang sama: notifikasi VA diverifikasi dan transaksi menjadi Done, lalu order terkonfirmasi. |
| Midtrans mengirim notifikasi yang sama dua kali | Tidak ada yang diproses dua kali. Notifikasi bersifat idempoten, sehingga transaksi yang sudah selesai tidak pernah diproses kedua kali. |
| Notifikasi datang dengan nominal yang salah | Notifikasi ditolak: nominal divalidasi terhadap transaksi Odoo, dan notifikasi yang tidak cocok tidak mengubah status apa pun. |
| Pengujian sebelum go-live | Gunakan Test Mode dengan kunci Sandbox dan instrumen uji Midtrans. Tidak ada uang sungguhan yang bergerak sampai Anda beralih ke kunci Production. |
Instalasi
- Salin folder gateway_qris_va ke dalam addons path instalasi Odoo 14 Anda.
- Unggah zip modul lewat menu Upload Module (atau install dari Apps → Update Apps List → Install).
- Restart server Odoo sekali sesudah mengunggah, karena modul ini berisi kode Python.
- Sesudah restart, record acquirer QRIS / VA (Midtrans) tersedia di Payment Acquirers, dan jurnal pembayarannya dibuat otomatis pada perusahaan yang sudah memiliki Chart of Accounts.
- Konfigurasikan acquirer seperti dijelaskan di Panduan Pengguna (Merchant ID, Client Key, Server Key, mode, metode, state).
Pertanyaan yang Sering Diajukan
Acquirer tidak tampil di checkout.
Pastikan State bukan Disabled, kunci sudah terisi, acquirer terhubung ke company yang benar, dan website memakai company yang sama.
Status tidak berubah sesudah pelanggan bayar.
Periksa URL notifikasi di dashboard Midtrans persis /payment/midtrans_qris_va/notification dan dapat diakses publik (bukan localhost); cek log server Odoo untuk baris yang diawali "Midtrans QRIS/VA: notifikasi".
Notifikasi ditolak / signature tidak valid.
Server Key di Odoo tidak sama dengan environment Midtrans yang mengirim notifikasi (Sandbox vs Production tertukar), atau kunci berubah sesudah di-reset di dashboard. Samakan kembali.
Nominal tidak cocok.
Pastikan tidak ada perubahan harga order sesudah transaksi dibuat; buat transaksi baru dari checkout.
Midtrans menolak transaksi (HTTP 4xx).
Pesan penolakan tampil ke pelanggan dan tercatat di state message transaksi. Sebab umum: kunci salah, metode belum diaktifkan di dashboard Midtrans, atau mata uang bukan IDR (QRIS/VA hanya untuk IDR).
Transaksi Done tetapi pembayaran (account.payment) belum terbentuk.
Pastikan acquirer memiliki Payment Journal (dibuat otomatis saat modul terpasang pada company yang sudah memiliki Chart of Accounts) dan tunggu cron "Payment: Post-process transactions" mengulang pemrosesan, atau buka transaksi dan periksa pesannya.
Tidak Ada di Build Ini
- Hanya QRIS dan Virtual Account, untuk IDR saja.
- Hanya Midtrans — tidak ada payment gateway lain yang disertakan.
- Kunci Sandbox dan Production berbeda dan harus sesuai dengan mode acquirer; mencampurnya membuat Midtrans menolak transaksi.
- URL notifikasi harus dapat dijangkau publik melalui HTTPS; localhost tidak dapat menerima notifikasi Midtrans.
Dukungan
Author: Ahmad Ghozali · Lisensi: LGPL-3. Modul gateway_qris_va versi 14.0.1.0.6.
Please log in to comment on this module