Result Codes Reference

Checkout Result Codes

When handling the webhook response from MMG, the decrypted payload will contain a ResultCode and a ResultMessage. You must evaluate the ResultCode to determine whether to fulfill the customer’s order or mark it as failed.

Only fulfill orders when you receive a ResultCode of "0". Any other code indicates that the transaction did not complete successfully.

Status Codes Table

Use the following table to map the outcome of the checkout session:

Result CodeMessageDescriptionAction to Take
0Transaction SuccessfulPayment was successful; Merchant can release product/service/goods.Fulfill Order.
1Agent Not RegisteredUser is not registered with MMG.Mark as failed. Prompt user to register or use another method.
2Payment FailedPayment has failed.Mark as failed. Prompt user to try again.
3Invalid Secret KeySecret Key is invalid (possible phishing or configuration issue).Check your environment variables and SDK configuration.
4Merchant ID MismatchMerchant ID did not match Merchant ID in the encrypted token.Verify the merchantId passed during token generation.
5Token Decryption FailedIncoming token is invalid or cannot be decrypted.Check your PEM keys and ensure formatting is correct.
6Transaction CancelledUser clicked Cancel during Checkout.Mark order as cancelled. Return user to cart.
7Request Timed OutThe request timed out.Mark order as abandoned/failed.

Handling Edge Cases

  • Missing Webhooks: If a user closes their browser before MMG can send the webhook, or if your server experiences downtime, you may miss the callback. It is highly recommended to implement a cron job or scheduled task that uses the Transaction Lookup API to check the status of any pending orders after a certain time period (e.g., 15 minutes).
  • Duplicate Webhooks: Ensure your webhook handler is idempotent. If MMG sends the same transactionId twice, your system should recognize that the order is already paid and gracefully ignore the duplicate request while still returning a 200 OK.