🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials November 4, 2026

How to Take Midtrans Payments with Gravity Forms (GoPay, QRIS, Virtual Accounts)

GravityExtra
How to Take Midtrans Payments with Gravity Forms (GoPay, QRIS, Virtual Accounts)

Indonesian customers pay in many ways: with GoPay or ShopeePay on their phone, by scanning a QRIS code, with a bank virtual account, at an Indomaret or Alfamart counter, or with a card. Midtrans brings these methods together on one hosted payment page. If your workshops, bookings, registrations or donations already run on Gravity Forms, you can send each submission straight to that page and get a paid, checked entry back. This guide walks through the setup with the Gravity Forms Midtrans Premium Add-on, from the Sandbox to your first real rupiah.

Before you begin

Midtrans is a payment gateway for businesses in Indonesia, and it charges in Indonesian rupiah (IDR). Set the Gravity Forms currency to Indonesian Rupiah; the add-on adds it to the currency list when it is missing (Rp 150.000: no decimals, a dot for thousands). Which methods your customers see depends on what is active on your Midtrans account, for example cards, GoPay, ShopeePay, QRIS, bank virtual accounts, Indomaret and Alfamart, Kredivo or Akulaku.

Why connect Gravity Forms to Midtrans

  • One form, one payment: the customer fills in your form and pays right after, without a shop or a cart.
  • The charge is the total Gravity Forms calculates on your server, so a price changed in the browser is never what gets charged.
  • Your customers choose the method they trust on the Midtrans page, and you do not have to build anything for each method.
  • The entry tells you whether the customer paid, how, and with which Midtrans order, and you refund from the same screen.
  • Booking e-mails can wait until the money is really there.

What you need

  • A Midtrans merchant account. The Sandbox is ready right after sign-up; Production starts when Midtrans has approved your business.
  • Gravity Forms 2.9 or newer, with the currency set to Indonesian Rupiah.
  • A public site on HTTPS, so Midtrans can send payment notifications.
  • The add-on: one site $49 a year, five sites $69 a year, unlimited sites $199 a year.

Step 1: Copy your server key

Log in to the Midtrans dashboard, make sure the environment switch shows Sandbox, and open Settings → Access Keys. You see a merchant ID, a client key and a server key. The add-on only needs the server key: it starts with SB-Mid-server- in the Sandbox and with Mid-server- in Production. Keep it private; it stays on your server and is stored encrypted by the add-on.

Midtrans value Needed?
Server key Yes, one per environment: creates payments, reads their status and refunds
Client key No: it is for Midtrans’ JavaScript, which the add-on does not load
Merchant ID No

Step 2: Install the add-on and connect

Install and activate the add-on, open Forms → Settings → Midtrans and activate your licence. Leave the environment on Sandbox, paste the server key and save. The account line turns green with a masked key.

Midtrans settings: Sandbox or Production, the server key of each environment, optional payment methods and payment window, the IDR currency line, the account-ready line and the notification address
Settings: choose Sandbox or Production and paste the server key from Settings, Access Keys. The key is stored encrypted; the notification address is sent with every payment.

Two optional settings help you shape the payment page. Payment methods limits it to the codes you list, for example gopay, shopeepay, other_qris for a quick mobile checkout, or bank_transfer for larger amounts. The payment window sets how many hours a virtual account or store payment stays open. Leave both empty to use everything on your account with the Midtrans defaults.

Step 3: Notifications without extra setup

Midtrans tells your site about every payment with an HTTP notification. The add-on sends its own notification address with each payment, so you do not need to touch the dashboard, and it still works if your Payment Notification URL belongs to another system. The settings page shows that address and the last notification the add-on accepted, which is a quick way to confirm everything arrives.

Step 4: Build the form

Add a name, an e-mail, a mobile number and your product fields with a total. Quantities, options and calculations work as usual. Rupiah has no decimals, so the add-on charges whole rupiah only. When the form products add up exactly to the total, Midtrans shows them as separate items; otherwise the payment carries one item named after your payment description.

A batik workshop booking form with name, e-mail, mobile number, workshop places and lunch sets with quantities, the total in rupiah and the Continue to payment button
The form your customer fills in. Card and e-wallet details are entered on the Midtrans page, not here.

Step 5: Add the Midtrans feed

In the form settings, open Midtrans and add a feed. Choose Products and Services with the form total and map the name, e-mail and phone so they appear on the payment page and on Midtrans’ instructions to the customer. Write a payment description such as Workshop booking #{entry_id}.

The Midtrans feed: products and services with the form total, first name, last name, e-mail and phone mapped, the payment description and the notification option
The feed: map the customer details shown on the Midtrans page and set the payment description.

Step 6: Test in the Sandbox

  1. Open the form, fill it in and press the submit button.
  2. You land on the Midtrans payment page in Sandbox mode. Pay with a test card, or choose a bank virtual account and complete it with the Midtrans payment simulator.
  3. You come back to your confirmation, and the entry shows Paid with the transaction and the method.
  4. Try a denied card as well: your page says nothing was charged, the entry is Failed, and Try the payment again opens a fresh payment.

How each payment is verified

A notification is accepted only if its signature_key, the SHA-512 hash of the order ID, status code, gross amount and your server key, matches. After that the add-on does not take the notification at its word: it asks Midtrans for the transaction status and compares the order ID, the amount in rupiah, the currency and the status with the entry. Only a settled payment, or a card capture that fraud detection accepted, marks the entry paid, and a repeated notification never pays twice.

What the customer sees

  1. Your form, with the total in rupiah updating as they choose places or extras.
  2. The Midtrans page with the amount and the methods you allow, for example GoPay, QRIS or a BCA virtual account.
  3. Your own confirmation after paying. If the payment is still being confirmed, the page says so and checks again by itself.
  4. If the payment fails or the time runs out, a clear message that nothing was charged and a link to try again.

Bank transfers and store payments

With a virtual account or an Indomaret or Alfamart payment, the customer gets a number to pay later. Midtrans reports the payment as pending, the entry becomes Pending with a note, and the customer is told the payment is waiting. When they pay, Midtrans sends a new notification and the entry becomes Paid, with your held notifications sent at that moment. If the payment window closes first, the entry becomes Failed and the customer can start again.

Fraud review on card payments

Midtrans checks card payments for fraud. Sometimes a payment is put on hold for review with the status “challenge”. The add-on keeps that entry Pending and leaves a note; when you accept or deny the payment in the Midtrans dashboard, the next notification updates the entry.

Refunds from the entry

Open a paid entry and use the refund form in the Midtrans box. The add-on checks that the payment is settled, sends the refund with a refund key (a repeat is the same refund, never a second one) and books it as soon as Midtrans lists it. Refunds made in the Midtrans dashboard are booked too, after the add-on has read the status.

An entry paid through Midtrans and partly refunded: the Midtrans box with the status, order ID, transaction, method, Midtrans status, amount, refunded amount and the refund form
The entry after payment: status, Midtrans order and method, and refunds from the entry screen.
Payment method Refund from the entry
Card, GoPay, QRIS, DANA, Kredivo, Akulaku Full or partial, in several steps up to the amount paid
ShopeePay, OVO Full refund only (Midtrans does not refund part of these)
Bank virtual accounts, Mandiri Bill Payment, Indomaret, Alfamart Not online: refund the customer another way, for example by bank transfer

What about subscriptions?

Recurring charges with Midtrans need a saved card from Midtrans’ card script on your own page, or a linked GoPay account. A redirect to the hosted payment page does not create either, so the add-on does not offer a subscription option: each form submission is one payment. For monthly fees, a reminder e-mail with a link to the form works well.

Good uses

Business Form
Workshops and courses Places, materials and lunch sets
Tours and homestays Bookings with dates, guests and extras
Clinics and services Deposits and appointment fees
Events and communities Tickets, registrations and merchandise
Foundations and mosques Donations and zakat with a free amount

Going live

  1. Wait until Midtrans has approved your account for Production.
  2. In the dashboard, switch to Production, open Settings, Access Keys and copy the Production server key.
  3. Paste it into the Production field of the add-on, choose Production and save.
  4. Make one small real payment and refund it from the entry.

A quick checklist

Check Where
Account line green in the right environment Forms, Settings, Midtrans
Forms use Indonesian Rupiah Forms, Settings, Currency
Site public and on HTTPS, Midtrans not blocked by a firewall Your hosting
Last accepted notification shown after a test payment Forms, Settings, Midtrans
Card, virtual account, a denied card and a refund tested Sandbox

Wrapping up

With the add-on in place, your Gravity Forms send customers to the Midtrans page with the payment methods Indonesians use every day, every notification is signature-checked, every result is read back from Midtrans and checked on your server before an entry changes, and refunds run from the entry screen. Read the full setup guide for every setting, or get the Gravity Forms Midtrans Premium Add-on for one site $49 a year, five sites $69 a year, unlimited sites $199 a year.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr