PayMongo Module

14 views Markdown

Collect payments from clients in the Philippines through PayMongo, with cards, e-wallets, QR Ph and online banking on one hosted payment page.

Reaching the Screen

Go to Settings → Financial → Payment Gateways, open All Modules and click the PayMongo card: {admin}/modules/payment?module=PayMongo

Ticking Status and saving lists the method on the payment step. Use Payment Gateways to order the methods clients see.

What Is on the Screen

The card holds your PayMongo key, the notification signing secret, the methods you offer and two presentation settings.

The client sees a PayMongo panel on the payment step with the amount and the available methods. Clicking the button opens PayMongo's own payment page, and the client returns to your site afterwards.

PayMongo charges in Philippine pesos only, so the payable total is converted into pesos before the page opens. Refunds can be sent from the panel. Subscriptions, stored cards, automatic payments and installments are not supported.

Before You Configure It

  • A PayMongo account and its secret key, read in the Dashboard under Settings → Product settings → Developers → API Keys. The key itself sets the mode, so there is no separate test switch.
  • Every method you plan to offer activated on your PayMongo account.
  • Philippine peso (PHP) defined as a currency with a current exchange rate, unless your install already prices in pesos.
  • Access to Developers → Webhooks in the PayMongo Dashboard, so you can register the notification address.

Fields

StatusTurns the module on. While it is off the other fields stay locked and clients are never offered the method.
Secret KeyRequired to take payments. It starts with sk_test_ in test mode or sk_live_ in live mode; the form refuses any other shape.
Webhook Signing SecretThe signing secret PayMongo shows when you create the webhook. It starts with whsk_ and proves a notification really came from PayMongo.
Payment MethodsThe methods offered on the PayMongo page. Card, GCash, QR Ph, Maya, GrabPay, ShopeePay, BillEase and online banking with BPI, UnionBank, BDO, Landbank and Metrobank are selectable. At least one must stay selected; the shipped set is card, GCash and QR Ph.
Email ReceiptLets PayMongo email its own receipt to the client after a successful payment. Your own invoice mail is sent either way.
Statement DescriptorOptional, up to 255 characters. The text shown on the client's card or bank statement. Empty uses the name of your PayMongo account.

Commission, accepted amount range and country lists behave the same on every gateway; see Payment Gateways. Converting Currency is absent here because the amount always goes to PayMongo in pesos. Callback URL, Success URL and Failed URL cannot be edited; the callback address is the one you register as a webhook.

Tasks

Connect your PayMongo account

  1. In the PayMongo Dashboard open Settings → Product settings → Developers → API Keys. Both key pairs are listed there; copy the one that starts with sk_test_.
  2. Open the PayMongo card under All Modules and tick Status.
  3. Paste your test key into Secret Key and pick the methods you offer under Payment Methods.
  4. Click Save Changes. The method now appears on the payment step.

Register the notification address

  1. Copy the Callback URL from the module card.
  2. In the PayMongo Dashboard, open Developers → Webhooks, click Add endpoint, paste that address and select the checkout_session.payment.paid event.
  3. Saving reveals the endpoint's signing secret. Paste it into Webhook Signing Secret and click Save Changes. You can read it again later on the endpoint, under Signing secret.
  4. Paid orders are now settled even when the client closes the browser on PayMongo's page.

Run a test payment

  1. Place a small order as a client, choose PayMongo and click Continue to PayMongo.
  2. Pay with one of PayMongo's test cards or test wallets.
  3. The client returns to your site and the invoice is marked as paid, which activates the order.
  4. Replace the key with the sk_live_ one, register a webhook on the live account too, and repeat with a real low-value payment.

Refund a payment

  1. Open the invoice from Invoice Detail.
  2. Set its status to refunded, choose Refund via payment gateway as the refund method and confirm. The other two options only record the refund and send nothing to PayMongo.
  3. The invoice's own share of the PayMongo payment is returned to the client. A bulk payment covering several invoices returns only the share of the one you refunded.

Things to Watch

The key prefix decides the mode

A payment made with an sk_test_ key marks the invoice as paid without moving money. A notification whose mode differs from the saved key is ignored, so switch the key and the webhook together.

An empty signing secret accepts unchecked notifications

With Webhook Signing Secret left empty, incoming notifications are not verified. Fill it in as soon as the webhook exists.

A short collection leaves the invoice open

If PayMongo collects less than the payable total, the invoice stays unpaid and the client sees an error. Compare the amount in your PayMongo Dashboard before you settle it by hand.

Required Privileges

Payment Module Settings (MODULES_PAYMENT_SETTINGS) is required.

Was this helpful?

Thanks for your feedback!

Still Need Help?

Our support team is here around the clock for anything you can't find above.