🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms MoMo Premium Add-on Setup Guide

Updated 9 min read Gravity Forms Integrations A–Z
On this page
  1. Installation
  2. Currency and amounts
  3. Settings
  4. Payment notifications
  5. The feed
  6. What the customer sees
  7. Payment statuses
  8. The entry screen
  9. Refunds
  10. Testing with the MoMo test environment
  11. Going live
  12. For developers
  13. How it differs
  14. Troubleshooting
  15. Uninstall

The Gravity Forms MoMo Premium Add-on connects Gravity Forms to your own MoMo business account in Vietnam. When a form with a MoMo feed is submitted, the add-on creates a MoMo payment for the exact total Gravity Forms calculated, in Vietnamese dong, and sends the customer to the MoMo payment page. On a computer the customer scans the QR code with the MoMo app; on a phone the MoMo app opens directly. Payment details stay in the MoMo app, never on your website.

When MoMo reports the payment, the add-on checks the signature of the notification with your secret key, reads the payment back from MoMo and only then marks the entry Paid, with the MoMo transaction ID as the transaction ID. This guide covers installation, the currency, every setting, payment notifications, the feed, what the customer sees, the payment statuses, refunds, testing with the MoMo test environment and going live.

Before you start

You need Gravity Forms 2.9 or newer, a MoMo business account with its integration keys (partner code, access key and secret key; the test keys come first), the MoMo test app on a phone for test payments, and for live payments a site that MoMo can reach over https, so it can send its payment notifications.

Installation

  1. Download the add-on zip from your GravityExtra account and upload it in Plugins → Add New → Upload Plugin, then activate it.
  2. Open Forms → Settings → MoMo and activate your licence key. The MoMo settings appear once the licence is active.
  3. In Forms → Settings, set the Gravity Forms currency to Vietnamese Dong (VND). The add-on adds it to the list.

Currency and amounts

Gravity Forms does not include the Vietnamese dong out of the box. The add-on adds it to the Gravity Forms currency list as soon as it is active, written the way your customers expect: 1,250,000 ₫, with comma thousands and no decimals. It never changes a dong definition that another plugin already made.

Item Value
Currency Vietnamese dong (VND) only, the currency MoMo takes
Decimals None: every amount is a whole number of dong
Shown in forms as 1,250,000 ₫ (comma thousands, the dong sign after the number)
Smallest payment 1,000 VND
Largest payment 50,000,000 VND (a filter can lower it)
Smallest refund 1,000 VND

The amount is worked out on your server from the entry, never from the browser. A total that is not a whole number of dong, below 1,000 VND or above 50,000,000 VND is refused before anything is sent, so the customer is never charged a rounded amount. Comma thousands are deliberate: Gravity Forms reads a plain number such as 150000 as written, while a dot-thousands format could turn a typed “150.000” into 150 dong.

Settings

MoMo settings: Test or Live mode, the partner code and the masked access key and secret key of each mode, the currency line for Vietnamese dong, the connection line and the payment notification address
Settings: paste the partner code, access key and secret key of each mode; the notification address is sent with every payment.
Setting What it does
Mode Test (the default) sends payments to the MoMo test environment (test-payment.momo.vn): they are paid with the MoMo test app and a test account, so no money moves. Live uses the MoMo production environment. Each entry remembers the mode it was paid in.
Test / Live partner code The Partner Code of your store in the MoMo Business portal. It is not secret, so it is shown as typed.
Test / Live access key The Access Key of your store. It is part of every signature. Stored encrypted, shown masked (first and last four characters).
Test / Live secret key The Secret Key of your store. Every request to MoMo is signed with it and every payment notification from MoMo is checked with it. When you save, the three keys are checked with MoMo without creating anything. Stored encrypted, shown masked.
Currency A check line: the Gravity Forms currency must be Vietnamese Dong (VND).
Connection Shows whether MoMo accepts the keys of the current mode, with the partner code and the masked keys.
Payment notifications The notification address the add-on sends with every payment, warnings when the site is not on https or uses plain permalinks, and when the last notification with a valid signature arrived.

Payment notifications

MoMo tells your site about a payment by posting the result to a notification address (IPN). The add-on sends its own address with every payment, so there is nothing to set up in the MoMo portal. The address ends in /wp-json/gravityextra-momo/v1/ipn.

Each notification is checked before anything happens: its signature must match your secret key, the partner code must be yours, and the order must be one this site created in the same mode. Then the add-on reads the payment back from MoMo and answers MoMo with an empty “204” response, as MoMo asks. A notification that arrives twice is acknowledged without changing the entry again.

Use https and pretty permalinks

MoMo asks for a notification address without query parameters on a server it can reach. If your site still uses plain permalinks, the settings page shows a warning; choose any other permalink setting under Settings → Permalinks. Payments are confirmed anyway when the customer returns and by the status check every five minutes.

The feed

The MoMo feed: products and services with the form total, the customer name, email and phone mapping, the order information with merge tags and notifications after payment
The feed: map the customer name, email and phone, and write the order information the customer sees in the MoMo app.
  • Transaction type: Products and Services, or Donations. The payment amount is the form total or one product field.
  • Customer name, email and phone: optional; MoMo can use them to notify the customer. Vietnamese mobile numbers are sent in the 0xxxxxxxxx form; numbers that do not fit are left out.
  • Order information: the text the customer sees on the MoMo payment page and in the app, and you see in the MoMo Business portal (merge tags work, up to 255 characters).
  • Notifications: hold the form notifications until the customer has paid (on by default).

What the customer sees

A pottery class booking form with quantities, the customer name, email and phone, and the total in Vietnamese dong, 1,250,000 ₫, with the Continue to payment button
The form: Gravity Forms works out the total in Vietnamese dong; the customer pays it on the MoMo payment page.

The customer fills in the form and sees the total in dong, for example 1,250,000 ₫. After pressing the submit button they go to the MoMo payment page. On a computer they scan the QR code with the MoMo app and confirm; on a phone the MoMo app opens. They come back to your form page, where the add-on reads the payment from MoMo and shows your confirmation. If they decline the payment in the app or the page expires, they see that nothing was charged and can submit the form again. Messages from MoMo are in Vietnamese when your site language is Vietnamese.

Payment statuses

Entry status When
Processing The customer was sent to the MoMo payment page and the payment is not confirmed yet (MoMo reports it as waiting for the customer or still processing).
Paid MoMo reports the payment as successful (result code 0) for the entry’s order ID and exact amount. The MoMo transaction ID is stored as the transaction ID.
Cancelled The customer declined the payment in the MoMo app, the payment page expired, or no payment arrived within three days. If MoMo later reports the order as paid, the entry still becomes Paid.
Failed MoMo reports a final failure such as insufficient balance, or the payment could not be started (for example keys MoMo refused). The customer was not charged.
Refunded Refunds completed at MoMo add up to the whole amount. Partial refunds are recorded as notes and transactions while the entry stays Paid.

The entry screen

An entry paid through MoMo: the MoMo box with the status, amount, MoMo transaction ID, payment type, order ID and result code, the Refresh status button and the refund form, and the entry notes
The entry: status, MoMo transaction ID and payment type, read back from MoMo, with refunds one click away.

The MoMo box on the entry shows the status, the amount, the MoMo transaction ID and payment type, the order ID and the last result code MoMo reported. Refresh status reads the payment and its refunds from MoMo again. Test payments carry a “Test — test payment” badge. Users need the Gravity Forms capability to edit entries (administrators always can) to see the buttons.

Refunds

  • Type the amount in whole dong in the refund field of a paid entry and press Refund with MoMo. The full remaining amount is filled in for you.
  • The add-on reads the payment back first, then asks MoMo for the refund of the exact amount with a new refund order ID, and records it as soon as MoMo reports it successful.
  • Several partial refunds are possible, each at least 1,000 VND, up to the paid amount. When the whole amount is refunded, the entry becomes Refunded.
  • If MoMo is still processing a refund, the entry shows “Refund requested” and the status check records it later. A refund MoMo does not make frees the amount again.
  • Refunds you make in the MoMo Business portal are recorded on the entry too, once.
  • Each refund form can be used once, so pressing the button twice never refunds twice.

Testing with the MoMo test environment

  1. Install the MoMo test app on a phone and sign in with a MoMo test account.
  2. Keep the add-on in Test mode, paste your test partner code, access key and secret key and save. The connection line turns green.
  3. Submit your form. On the MoMo payment page, scan the QR code with the MoMo test app and confirm.
  4. Check the entry: Paid, with the MoMo transaction ID and a “Test — test payment” note. Try a partial refund.
  5. Submit again and decline in the app: the entry becomes Cancelled and the customer is told nothing was charged.

Going live

  • Paste the production partner code, access key and secret key from the MoMo Business portal, switch to Live and save.
  • Make one small real payment and refund it.
  • Your site must be reachable over https with pretty permalinks for live payment notifications.

For developers

The filter gravityextra_momo_request_fields can change the order information, the message language and the customer details. The amount, the order ID, the request type and the return and notification addresses are always set by the add-on. gravityextra_momo_max_amount lowers the largest payment and gravityextra_momo_payments_per_hour changes the hourly cap of new payments (300 by default).

// Show the class date in the order information of one form (ID 7) and use Vietnamese messages.
// The amount, order ID, request type and the return / notification addresses cannot be changed here.
add_filter( 'gravityextra_momo_request_fields', function ( $body, $feed, $entry, $form ) {
    if ( 7 !== (int) rgar( $form, 'id' ) ) {
        return $body;
    }
    $body['orderInfo'] = 'Class ' . rgar( $entry, '8' ) . ' / booking ' . rgar( $entry, 'id' );
    $body['lang']      = 'vi';
    return $body;
}, 10, 4 );

How it differs

  • It connects to your own MoMo business account directly with the MoMo payment API, so the money is settled by MoMo to your account under your own MoMo agreement.
  • It never trusts the return address or the payment notification on its own. The notification signature is checked with your secret key, and then the payment is read back from MoMo. Only a successful payment with the entry’s order ID and exact amount marks the entry Paid.
  • It adds the Vietnamese dong to Gravity Forms with no decimals and comma thousands, so a total of 1,250,000 ₫ is sent to MoMo as exactly 1250000, never 1,250 and never one hundred times too large.
  • Refunds, including several partial refunds, are made from the Gravity Forms entry and recorded once per MoMo refund, together with refunds you make in the MoMo Business portal.

Troubleshooting

What you see What to check
“MoMo did not accept these Test keys” Copy the partner code, access key and secret key again from the same store and environment: test keys for Test, production keys for Live.
“Online payment with MoMo is not available in USD” (or another code) Set the Gravity Forms currency to Vietnamese Dong (VND).
“Payment with MoMo is available for totals from 1,000 VND to 50,000,000 VND” The form total is outside MoMo’s limits for one payment.
Entries stay Processing after payment Check that the site is on https with pretty permalinks so MoMo can reach the notification address. The status check every five minutes confirms payments anyway.
“The MoMo payment does not match this entry” The amount MoMo reports differs from the entry. Check the transaction in the MoMo Business portal; the entry is not marked Paid automatically.

Uninstall

Deleting the add-on from the Plugins screen removes its settings (including the encrypted keys), schedules and temporary data. Entries, notes and payments at MoMo stay as they are.

Plans: one site $49 a year, five sites $69 a year, unlimited sites $199 a year. See the Gravity Forms MoMo Premium Add-on page for details.

Still need help?

Our support team answers tickets every day, usually within a few hours.

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