VibeFox PayMongo for OpenCart — Help
Requirements
OpenCart: 3.0.x (tested on 3.0.5.0) or 4.0.2 and later (tested on 4.1.0.3).
PHP: 8.0 or later.
Currency: Philippine peso (PHP). PayMongo is shown at checkout only when the customer pays in PHP and the total is at least ₱100.00. Add the currency in System > Localisation > Currencies if your store does not have it yet. If the default currency of your store is not PHP, the settings page warns you, and customers must switch to PHP to see PayMongo.
PayMongo account: you need the secret API keys of your PayMongo account and a webhook for each mode (see Configuration). Only the secret keys (sk_test_..., sk_live_...) and the webhook signing secrets (whsk_...) are used. The public keys are not needed, because the payment page is hosted by PayMongo. The payment methods you offer must be activated for your PayMongo account.
VibeFox license key: bought on vibefox.net. One key works on one domain.
Installation
The download is one zip file with the packages for both OpenCart versions. Unpack it on your computer. It contains README.txt, the OpenCart 3 package wcp_paymongo_payment_gateway-oc3-(version).ocmod.zip and the OpenCart 4 package wcp_paymongo_payment_gateway.ocmod.zip. Install only the package for your OpenCart version. The license key is the same for both versions.
OpenCart 3
1. In the admin go to Extensions > Installer, click Upload and choose the file wcp_paymongo_payment_gateway-oc3-(version).ocmod.zip. The extension has no OCMOD modifications, so Extensions > Modifications does not need a refresh. Instead of the installer you can copy the contents of the upload folder of this package into the root folder of your store.
2. Go to Extensions > Extensions and choose the type Payments. Find VibeFox PayMongo Payment Gateway and click Install (the green + button).
3. Click Edit (the pencil button) to open the settings page. Paste your VibeFox license key into License key in the license block at the top of the page and click Activate (see License key).
4. Paste your PayMongo secret keys, create the webhooks in PayMongo and paste their signing secrets (see Configuration).
5. Select the payment methods, turn on Enable/Disable and click Save. Test a payment with Test mode on, then turn it off.
OpenCart 4
1. In the admin go to Extensions > Installer, click Upload and choose the file wcp_paymongo_payment_gateway.ocmod.zip. Do not rename the file: OpenCart 4 takes the extension code from the file name, and a renamed package does not work.
2. The package appears in the list of installed extensions on the same page. Click Install (the green + button) next to it.
3. Go to Extensions > Extensions and choose the type Payments. Find VibeFox PayMongo Payment Gateway, click Install (the green + button), then Edit (the pencil button).
4. Enter the license key, the PayMongo keys, the webhooks and the payment methods as in steps 3 to 5 for OpenCart 3. The settings page and its fields are the same in both versions. Only the webhook URL is different (see Webhook).
A new install starts with the payment method turned off and test mode on.
Configuration
All settings are on the extension page: Extensions > Extensions > Payments > VibeFox PayMongo Payment Gateway > Edit. The sections are listed on the left; the Save button under the list saves the whole page. Above the settings the page warns you when the default currency of the store is not PHP, when the current mode has no secret key (PayMongo is then not shown at checkout) or no webhook secret (payments are then confirmed only when the customer returns to your store), and shows Test mode is on: no real payments are made. while test mode is on.
When you save, Title must not be empty (up to 128 characters), Sort Order must be a whole number (negative numbers are allowed), Total a number, 0 or greater, and the selected geo zone and order statuses must exist; otherwise nothing is saved and the page names the field. A key with a wrong prefix is not saved, but the other fields are (see API keys).
PayMongo
Enable/Disable: Enable PayMongo turns the payment method on or off. Default: off.
Title: the payment method name customers see at checkout. It is also the payment method name stored in the order. Default: PayMongo (Card, GCash, GrabPay, Maya). Required, up to 128 characters.
Description: the text shown to the customer on the Confirm Order step, above the confirm button. Default: You will be redirected to PayMongo to pay securely with your card, GCash, GrabPay or Maya.
Payment methods: the methods offered on the PayMongo checkout page. Select only methods that are activated for your PayMongo account, otherwise PayMongo rejects the checkout. If none is selected, the defaults are used. Default: Cards, GCash, GrabPay and Maya.
Sort Order: the position of PayMongo among the payment methods at checkout. Leave it empty or enter a whole number.
Geo Zone: offer PayMongo only for payment addresses in the selected geo zone. Default: All zones. Geo zones are set up in System > Localisation > Geo Zones.
Total: the checkout total, in the default currency of the store, that an order must reach before PayMongo is offered, on top of the PayMongo minimum of ₱100.00. Leave it empty for no extra minimum.
API keys
Copy the secret keys from PayMongo Dashboard > Developers > API keys (the section links there). Public keys are not needed. Each key must start with the expected prefix. A value with a wrong prefix, for example a live key in a test field, is not saved: the page shows that the field must start with the prefix and The previous value was kept.
Test mode: Enable test mode (no real payments). New payments use the test keys. Payments made earlier keep the mode they were made in, so status checks and refunds use the matching key. Default: on. Turn it off to take real payments. While it is on, customers see Test mode: no real payment will be made. at the Confirm Order step.
Test secret key: the secret key of the test mode. It starts with sk_test_.
Test webhook secret: the signing secret of the test-mode webhook. It starts with whsk_.
Live secret key: the secret key of the live mode. It starts with sk_live_.
Live webhook secret: the signing secret of the live-mode webhook. It starts with whsk_.
Saved keys and secrets are never shown again. The field stays empty and shows Saved — leave empty to keep it. Type a new value only to change it. To remove a saved value, tick Clear the saved value on save under the field and click Save.
Webhook
The webhook tells your store that a payment has been made, also when the customer closes the browser after paying. Create a webhook in the PayMongo Dashboard (or through the PayMongo API) for each mode, test and live, with the URL shown in Webhook URL in this section. On OpenCart 3 it looks like https://your-store/index.php?route=extension/payment/wcp_paymongo_payment_gateway/webhook, on OpenCart 4 like https://your-store/index.php?route=extension/wcp_paymongo_payment_gateway/payment/wcp_paymongo_payment_gateway.webhook. It is built from the storefront address of your OpenCart installation. Copy the URL exactly as the settings show it.
Select these events (they are also listed in this section):
Copy the signing secret (whsk_...) of each webhook into Test webhook secret or Live webhook secret. Webhooks without a valid signature are rejected. The signature is checked with the secret of its own mode, and the mode of the event must match it, so a test webhook never confirms a live payment. Every event is checked again through the PayMongo API with the secret key of the payment's mode before an order is changed. Events of payments that were not started in this store are ignored. Without the webhook, an order is confirmed only when the customer comes back to the store after paying.
Orders
OpenCart creates the order at the Confirm Order step without a status (a missing order). It gets a status only after PayMongo has confirmed the payment. OpenCart has no On hold status: by default the awaiting and the on-hold statuses are both Pending, and the PayMongo tab and the order notes tell them apart. You can create your own statuses in System > Localisation > Order Statuses and select them here. Each field below lists your OpenCart order statuses.
Order status after payment: the status set after a successful payment. Default: Processing. Complete suits virtual or downloadable goods that need no shipping.
Awaiting PayMongo payment: the customer finished on the PayMongo page, but the payment is still being processed (for example online banking). The webhook or the next check completes the order. Default: Pending.
PayMongo payment on hold: an amount or currency mismatch, a test payment on a live store, or a payment that arrived after the order was cancelled. A note explains why. Default: Pending.
Failed status: an awaiting payment failed later (payment.failed). A failed attempt of an order without a status leaves it without a status, and the customer can pay again. Default: Failed.
Cancelled status: the status you give a cancelled order. A payment that arrives later puts the order on hold instead of completing it. Default: Canceled.
Refunded status: set after the payment is fully refunded from the order tab. Default: Refunded.
Advanced
Debug log: logs PayMongo API calls and webhook events to paymongo_p_debug.log.php in the OpenCart logs folder (storage/logs). The file cannot be opened from the web. Errors and warnings are always logged, also while the switch is off. Keys and customer data are never logged. Default: off.
Log: shows the size and the latest entries of the log. Click Clear log to empty it.
Delete data on uninstall: when on, uninstalling the extension deletes the gateway settings and the log. The PayMongo IDs stored for orders and the refunds are always kept, because they are needed for refunds and accounting. Default: off.
Import / Export
Export: Download JSON saves the settings as a JSON file. Secret keys are not exported.
Import: paste previously exported JSON and click Import to restore the settings. Saved secret keys are kept.
Checkout
At the Payment Method step the customer chooses the payment method (by default PayMongo (Card, GCash, GrabPay, Maya)). At the Confirm Order step the customer sees your description and the note After you confirm the order you will be redirected to PayMongo to complete the payment. OpenCart creates the order at this step, still without a status. On OpenCart 4 the customer picks the payment method with the Choose button of the payment method block, in the window Payment method options, and clicks Confirm Order at the bottom of the checkout page.
When the customer clicks Confirm Order, the extension creates a PayMongo Checkout Session for the order total in PHP, with one line Order # and the order number, and sends the customer to the PayMongo checkout page. The customer's name, e-mail, phone and billing address are passed to PayMongo. There the customer chooses one of the selected methods and pays. A note on the order records the PayMongo checkout.
After paying, the customer returns to your store. The order is marked paid only after PayMongo confirms it: the extension asks the PayMongo API about the payment when the customer comes back and when the webhook arrives. The order then gets its status the standard OpenCart way, with the usual order e-mails and stock update, and the customer sees the OpenCart order success page with Your PayMongo payment has been received. If PayMongo is still processing the payment when the customer comes back, the order gets the awaiting status and the page shows PayMongo is still processing your payment. Your order will be updated as soon as PayMongo confirms it — please do not pay again. For an order on hold it shows Your payment was received and is being reviewed. We will update your order shortly. If PayMongo cannot be reached when the customer comes back, a Payment confirmation page says Your payment is being confirmed by PayMongo. You will receive an e-mail as soon as it is confirmed — please do not pay again. with a Check again button; the webhook sets the order status as soon as it arrives. When an order moves from the awaiting status to paid or to the payment error status, the customer is notified by the usual OpenCart order status e-mail.
If the customer cancels on the PayMongo page or does not finish the payment, the customer is back at checkout with You cancelled the PayMongo payment. You can try again or choose another payment method. or Your PayMongo payment was not completed. You can try again or choose another payment method. The cart is kept. On OpenCart 4 these messages are shown above the checkout page. A new attempt (OpenCart 3 creates a new order every time the Confirm Order step is shown, OpenCart 4 updates the order of the checkout) first checks the previous one: if it was paid in the meantime, the payment is confirmed without a new one; otherwise the previous PayMongo checkout link is expired, so the cart cannot be paid twice. While the previous payment is still being processed, the customer sees Your previous PayMongo payment for this order is still being processed. Please wait a few minutes before trying again. If another order of the same cart has already been paid or is waiting for payment, the customer is taken to the success page. A change of the cart, including a new quantity, counts as a new cart that needs its own payment.
OpenCart 4 keeps the order in the checkout until the success page is shown. If that order was closed meanwhile (for example you cancelled it), or it was paid for a different cart, the customer is sent back to the checkout with the message Your previous order is already closed. Please confirm the order again: the cart will be paid with a new order. The next Confirm Order pays a new order. A paid order is never shown as paid for a different cart.
If PayMongo cannot start the payment, the customer stays at the Confirm Order step with a short message above the button, for example The payment could not be started. Please try again or choose another payment method. or PayMongo could not be reached. Please try again in a moment. The technical reason is written to the log.
The webhook also works while the store is in maintenance mode, because OpenCart lets payment extension requests through (on OpenCart 4 the extension adds its own startup action for this, which also lets the customer return from PayMongo).
The extension takes one-time payments on the PayMongo page. It has no card fields on your own checkout page, no saved cards, no subscriptions or recurring payments, no installments and no separate authorize and capture.
Orders and refunds
Order statuses
No status (missing order): the customer was sent to PayMongo and has not paid, or PayMongo has not confirmed the payment yet. In Sales > Orders such orders are shown only with the filter Order Status set to Missing Orders.
Order status after payment (default Processing): the payment was confirmed. A note shows the PayMongo payment, the amount, the method, the mode and how it was confirmed (webhook, return or payment retry).
Awaiting PayMongo payment (default Pending): the customer came back while PayMongo was still processing the payment. The order moves to the paid status when PayMongo confirms it.
PayMongo payment on hold (default Pending): the paid amount or currency differs from the order total; or a payment was made in test mode while the store is in live mode, so no money was received; or the payment arrived after the order had been cancelled. The note explains it. Check the order and process it or refund the payment.
Failed status (default Failed): a signed payment.failed webhook reported that the latest payment attempt of an awaiting order failed. The note shows the PayMongo failure code and message. If the same payment succeeds later, the order moves to the paid status.
Refunded status (default Refunded): the payment was fully refunded through the extension.
If a second payment arrives for an order that is already paid, or for another order of an already paid cart, the paid order is not changed. A note asks you to refund the duplicate payment in the PayMongo Dashboard. An order that was paid and then cancelled or refunded is never reopened.
Notes are entries in the order History that the customer does not see.
VibeFox PayMongo Payment Gateway tab
In Sales > Orders open an order paid with PayMongo. At the bottom of the order page, next to History and Additional, the VibeFox PayMongo Payment Gateway tab shows the PayMongo payment, the PayMongo payment intent, the PayMongo checkout, the PayMongo mode with a Test mode label for test payments, the Status, the amounts Paid / refunded, the refund form, the refund history and the Notes of the order. The tab is shown to users who have access to the extension.
Refunds
In the VibeFox PayMongo Payment Gateway tab enter the Amount (the amount not refunded yet is filled in), optionally a Reason (optional), and click Refund via PayMongo. Confirm the question Refund this amount through PayMongo? This cannot be undone. Full and partial refunds are supported, with at most two decimals. You need the right to modify the extension (set in System > Users > User Groups). Refunds are limited to the amount PayMongo actually charged, so after an amount mismatch you can refund up to what the customer paid, not the order total. The refund is sent with the secret key of the mode the payment was made in (test or live), so that mode's key must be set. If PayMongo does not accept the refund, the tab shows the error and no refund is recorded. A successful refund is added to the refund history and the notes with the PayMongo refund ID and status. A full refund sets the order to Refunded status without notifying the customer and without returning products to stock, like a manual status change. A partial refund does not change the status.
Product returns in Sales > Returns do not send money back through PayMongo. Refunds made in the PayMongo Dashboard are not reported to OpenCart. Refund from the order tab instead, or update the order manually.
License key
The extension works with a VibeFox license key from vibefox.net. The license block License — VibeFox PayMongo Payment Gateway is the first block on Extensions > Extensions > Payments > VibeFox PayMongo Payment Gateway > Edit, above the settings. Paste the key into License key and click Activate. After that the block shows the key masked, the status (for example the date the license is active until and your domain) and the buttons Check now to check the status again, Change key to enter another key and Remove key to remove the key from this store. Below them are the line Product: opencart-payment-paymongo and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only admin users with the Modify permission for the extension can change the key. The texts of the block follow the admin language (English and Russian are included).
If the key is not accepted, the block says why, for example Key not found, This key belongs to another product, Domain limit reached or License expired on a date. After the store address changes, or after you free a domain slot in your account, click Check now. If the license server cannot be reached, the extension keeps working on the last known status.
One key works on one domain: the store address from the OpenCart configuration. Removing the key from the store does not free its domain slot. Free the slot in your vibefox.net account.
Without an active key, PayMongo is not shown to customers at checkout. If a payment is started anyway, the customer sees This payment method is not available. Please choose another one. An admin user who is logged in to the admin in the same browser still sees the payment method in the store, marked (unlicensed — visible to admins only), so you can set up and test the extension before you buy a key. On OpenCart 4 this preview is not available: the store does not see the admin login, so without an active key the payment method is hidden for everybody. After you have opened the Edit page once, a reminder appears on the admin Dashboard. Close it with × to hide it for 7 days. Existing orders are not affected: payments already started are still confirmed, and refunds work.
When a license expires, the extension keeps working, but updates and support need a renewal. The status is checked again automatically when you open the admin Dashboard or the Edit page: once a day for the first 14 days after the key is entered, then once a week. No cron job is needed. Uninstalling the extension always removes the license key and license status.
Troubleshooting
PayMongo does not appear at checkout: check that the license is active, Enable/Disable is on, the current mode has a secret key (Test secret key in test mode, Live secret key in live mode), the customer pays in PHP and the total is at least ₱100.00. Also check that the payment address is in the selected Geo Zone and that the order reaches the Total set in the settings.
The payment went through, but the order stays without a status: the webhook is not working and the customer did not come back to the store. In the PayMongo Dashboard check that a webhook exists in the mode you use, that its URL is exactly the one shown in Webhook URL and that the three events are selected. Check that its signing secret is in the matching field (Test webhook secret or Live webhook secret).
Webhook answers Invalid signature: the signing secret of that mode is missing or belongs to another webhook. Paste the signing secret of the webhook into the field of its mode.
Webhook answers Mode mismatch: a test event was signed as live or the other way round. Check that each webhook belongs to the right mode.
Webhook answers Temporary error: the payment could not be checked through the PayMongo API, for example because the secret key of the payment's mode is missing. PayMongo retries the webhook automatically.
Webhook answers Busy, retry: the order was being confirmed by another request at the same moment, or the order status could not be set. PayMongo retries the webhook automatically. The reason is in the Log.
Webhook answers Ignored: the event belongs to a payment that was not started in this store, or to another mode. Nothing is changed.
The webhook URL shows Method not allowed in the browser: this is normal. The URL accepts only requests from PayMongo.
The value was not saved: a key was pasted into the wrong field. Secret keys start with sk_test_ or sk_live_, webhook secrets with whsk_.
The customer sees an error after Confirm Order: look at the Log field on the extension page. A wrong secret key gives the message that the payment method is temporarily unavailable. A payment method that is not activated for your PayMongo account makes PayMongo reject the checkout; remove it from Payment methods. This payment method is not available. Please reload the checkout page. means the checkout session no longer matches the order, or the payment method was turned off meanwhile.
Test payments on a live store: a test payment that arrives while the store is in live mode puts the order in the on-hold status with a note that no money was received. Live payments are always recognised, also after switching back to test mode, and are refunded with the live key.
Order is in the on-hold status after payment: read the notes in the VibeFox PayMongo Payment Gateway tab (see Order statuses), then process the order or refund the payment.
No refund form in the tab: the payment is not confirmed yet, it is fully refunded, or your user group has no right to modify the extension.
Refund fails with a message about the mode: the payment was made in test or live mode, and the secret key of that mode is not set. Enter it and try again.
For developers: before the Checkout Session is created, the extension triggers the OpenCart event paymongo_p_checkout_session_data with the session data and the order.
Uninstall
Go to Extensions > Extensions, choose the type Payments and click Uninstall (the red − button) next to VibeFox PayMongo Payment Gateway. The license key and license status of this extension are always removed. OpenCart always removes its own settings of the extension: Enable/Disable, Sort Order, Geo Zone, Total and the order statuses of the Orders section, which return to their defaults on a re-install. The OpenCart event of the extension is removed too (on OpenCart 4 its events and its startup action, which lets the webhook and the customer's return through in maintenance mode). If Delete data on uninstall is on, the other gateway settings (title, description, payment methods, test mode, keys, webhook secrets, logging) and the log are deleted. If it is off, they are kept for a later re-install. The PayMongo IDs of orders and the refunds are always kept, so orders paid before can still be refunded after a re-install. Existing orders keep their payment notes.
On OpenCart 4, to remove the files of the extension as well, go to Extensions > Installer after the uninstall and click Uninstall (the orange − button) next to VibeFox PayMongo Payment Gateway in the list of installed extensions, then Delete (the red bin button) to remove the uploaded package.
PayMongo is a trademark of its respective owner. This extension is not affiliated with or endorsed by PayMongo.
