Baratek Payment Gateway with MPGS for WooCommerce

Description

This file documents installation, settings, and FAQ. For architecture, request-flow diagrams, and the security design rationale, see README.md in this plugin’s repository.

A WooCommerce payment gateway for Mastercard Payment Gateway Services (MPGS) – works with any MPGS-based provider (Areeba, or others exposing the same Transaction API), not tied to one reseller:

  • Full WooCommerce Subscriptions support: automatic recurring renewals charged against a securely stored card token (no re-entering card details), subscription cancellation/suspension/reactivation, amount and date changes, payment method change (by the customer or an admin), and multiple subscriptions in one checkout – all built in, not bolted on.
  • One-off card payments via an on-site card form (MPGS session.js), with 3DS2 authentication.
  • Optional Hosted Checkout mode – redirect customers to your provider’s own hosted payment page instead. Subscription renewals work identically either way.
  • HPOS (High-Performance Order Storage) compatible.
  • Compatible with both the classic [woocommerce_checkout] shortcode checkout and the WooCommerce Checkout block.
  • Structured event log under WooCommerce > MPGS Logs – readable in the dashboard, no FTP or raw log files.
  • Admin email alert when a payment or subscription renewal fails.
  • MPGS Transaction Details meta box on the order screen (receipt, transaction ID/type, card brand/last 4/type, gateway response, API version, link to the provider’s merchant portal).
  • Common decline reasons (insufficient funds, expired card, do-not-honour, etc.) are mapped to plain-language messages instead of a generic “payment failed”.
  • Logs a hint when a request fails with HTTP 401/403 or an obviously malformed gateway URL, pointing at the likely settings mistake.
  • Nonce-protected payment callback and REST completion endpoint, with session/order ownership verification.

Refunds are handled directly in your MPGS provider’s merchant portal and are intentionally not implemented in this plugin.

Most MPGS providers have no separate “test mode” – which Merchant ID you configure determines whether the account is test or live.

Recurring/subscription payments require the separate WooCommerce Subscriptions plugin to be installed and active. Without it, this gateway still works fully for one-off card payments – the subscription-related settings and behavior simply don’t apply.

External Services

This plugin connects to your MPGS provider’s gateway (e.g. Areeba, or another bank/reseller exposing the same MPGS Transaction API) to process payments. It does not call any other third-party service.

  • Provider: whichever bank or reseller issued your MPGS Merchant ID – the specific gateway host is entered in the plugin’s settings, not hardcoded.
  • Underlying platform: Mastercard Payment Gateway Services, operated by Mastercard International Incorporated – mastercard.com.

When and what data is sent

  1. At checkout – creates a payment session with the order amount, currency, order ID/description, the recurring agreement block (for token creation), and – if present on the order – the customer’s name, email, and phone.
  2. After payment – re-verifies the transaction result directly with the gateway using the order ID (Hosted Checkout mode), or performs the final PAY call (custom checkout mode). Nothing posted by the browser is trusted on its own.
  3. On subscription renewal – charges the previously stored card token via a server-to-server call; no browser involved.

Merchant credentials (Merchant ID, Authentication Password) are sent server-side only and never exposed to the browser. Card numbers, CVV, and expiry dates are never sent to or stored on this server – they’re tokenized client-side (custom checkout mode) or entered directly on the provider’s hosted page (Hosted Checkout mode).

Privacy

This plugin does not track users, use tracking cookies, or share data with anyone other than the configured MPGS provider for payment processing. It stores a card token (not the card itself) and transaction metadata (receipt, transaction ID/type, card brand/last 4/funding type, gateway response code) as order meta, for display in the order screen’s MPGS Transaction Details box.

Screenshots

Installation

  1. Install and activate the plugin.
  2. Go to WooCommerce > Settings > Payments > MPGS.
  3. Enter your credentials:
    • MPGS Gateway URL – the gateway host given by your provider, including https:// (e.g. https://epayment.areeba.com/).
    • API Version – the MPGS API version given by your provider.
    • Merchant ID – from your provider. This also determines whether the account is test or live.
    • Authentication Password – generated in your provider’s merchant portal, usually under Admin > Integration Settings.
  4. Choose a checkout mode: leave Hosted Checkout off for an on-page card form, or enable it to redirect customers to the provider’s own payment page.
  5. Optionally enable Debug Log while testing, and configure Failure Alerts to be notified by email when a payment or renewal fails.
  6. Place a test transaction to confirm the settings work before going live.

FAQ

Why are my transactions failing?

Common causes:

  1. Wrong Merchant ID or Authentication Password – check WooCommerce > MPGS Logs for the specific error.
  2. Currency mismatch between your MPGS merchant account and your WooCommerce store.
  3. An API version your provider’s account doesn’t support.

A request that fails with HTTP 401/403, or an obviously malformed Gateway URL, is called out directly in the log with a hint pointing at the likely setting to check.

Does this plugin store credit card data?

No. In Hosted Checkout mode, customers enter card details on the provider’s own hosted page. In custom checkout mode, card details are tokenized client-side by MPGS’s session.js and never reach this server – only the resulting card token (used for subscription renewals) is stored.

Where do I find transaction details for an order?

Open any order paid through this gateway – the MPGS Transaction Details box in the sidebar shows the receipt, transaction ID/type, card brand/last 4/type, gateway response code, API version, and a link to view the order in your provider’s merchant portal.

How do subscription renewals work?

The first time a customer pays for a subscription, they enter their card as normal (on-page form or your provider’s hosted page, depending on your checkout mode). Their card is then securely saved with your MPGS provider, and WooCommerce charges it automatically on each renewal date – the customer doesn’t need to come back or re-enter anything.

If a renewal payment fails (e.g. an expired or declined card), WooCommerce Subscriptions puts the subscription on hold and emails the customer to update their payment method; if Failure Alerts is enabled, you get an email too. Once the customer updates their card, the subscription resumes normally.

Does this plugin handle refunds?

No – refunds are handled directly in your MPGS provider’s merchant portal, intentionally, to avoid duplicating the ledger your provider already maintains.

Is this plugin HPOS compatible?

Yes, along with the WooCommerce Checkout block.

Does this work with providers other than Areeba?

Yes. Anything exposing the standard MPGS Transaction API works – the gateway host, API version, Merchant ID, and Authentication Password are all settings, never hardcoded to one provider.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Baratek Payment Gateway with MPGS for WooCommerce” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.1.0

  • Add MPGS Transaction Details meta box to the order screen.
  • Add WooCommerce Checkout block compatibility.
  • Map common MPGS decline codes to plain-language customer messages.
  • Log a hint on HTTP 401/403 responses or a malformed gateway URL.
  • Send optional customer name/email/phone to MPGS with the session request.

1.0.0

  • Initial release.