Skip to main content

Webhooks & Callbacks

The MMG WooCommerce Payment Gateway uses a callback URL (webhook) to receive payment notifications from MMG after a customer completes or fails a payment on the MMG-hosted payment page.

What is the Callback URL?​

The callback URL is an endpoint on your WordPress site that MMG calls with an HTTP POST request after every transaction. This is how your WooCommerce store knows whether a payment succeeded or failed — without it, orders stay in "Pending" indefinitely.

The callback URL must be:

  • Publicly accessible (not behind a login, VPN, or IP restriction)
  • Served over HTTPS
  • Registered in your MMG merchant portal

Finding Your Callback URL​

  1. Go to WordPress Admin > MMG Checkout Control Panel > Dashboard tab.

  2. Copy the Callback URL shown — it will look like: https://yourdomain.com/wc-api/mmg-checkout/random-string

  3. Contact the MMG support team to have this URL added to your MMG Merchant Portal.

Callback Request Format​

MMG sends an HTTP POST to your callback URL with a JSON body. The exact fields are defined by MMG's API — check the MMG merchant portal documentation for the current schema. Key fields include the transaction ID, order reference, payment status, amount, and currency (GYD).

WooCommerce Order Status Mapping​

MMG Payment StatusWooCommerce Order Status
SuccessProcessing
FailedFailed
CancelledCancelled
PendingPending Payment (unchanged)

Testing Callbacks in Sandbox Mode​

In sandbox mode, use a tool like ngrok to expose your local WordPress development site to the internet so MMG can reach your callback URL:

ngrok http 80

Use the https:// ngrok URL as your sandbox callback URL in the MMG sandbox portal.

Viewing Callback Logs​

  1. Go to MMG Checkout Control Panel > Logs tab.
  2. Each entry shows the timestamp, transaction reference, received payload, and processing result.
  3. Failed callbacks (e.g., 500 error) show the error and stack trace.

Troubleshooting​

See Troubleshooting → Callback URL Not Being Received for common callback problems and fixes.