Mastercard-Hosted Card Payments for nopCommerce Checkout
MasterCardHostedCheckout connects nopCommerce checkout to the Mastercard Payment Gateway Services (MPGS) Hosted Checkout API, so customers enter card details on a Mastercard-hosted page rather than the store. It offers full-page redirect or inline lightbox presentation, authorize-only or authorize-and-capture transactions, order creation before or after payment, and multi-currency charging per store.
What It Does
- Hosted card entry — Card details are captured on the Mastercard-hosted page via CREATE_CHECKOUT_SESSION, so cardholder data never touches the store.
- Redirect or lightbox — Checkout.showPaymentPage() sends the customer to a full page, or Checkout.showLightbox() overlays the form on the storefront.
- Nine gateway endpoints — Admin dropdown selects among nine MPGS hosts, including eu-gateway, ap-gateway, na-gateway and a sandbox test-gateway.
- Authorize or capture — Transaction mode selector chooses Authorize or Authorize and capture for each order.
- Flexible order timing — Create order mode places the order before payment starts or only after the gateway confirms success.
- Multi-currency charging — Optional toggle bills the customer's working currency instead of the primary store currency.
- Capture, refund, void — Admin order page can capture, fully or partially refund, and void payments via CAPTURE, REFUND and VOID operations.
- Per-store overrides — Endpoint, merchant ID, password, transaction mode and payment mode can each be overridden per store.
- Configurable surcharge — Additional fee applied to the order as a fixed amount or a percentage.
- Server-side confirmation — Payment is verified by RETRIEVE_SESSION and RETRIEVE_ORDER calls rather than by trusting the browser callback.
- Replay protection — The success indicator from session creation is stored per customer and matched against the resultIndicator callback parameter.
- Debug logging — Toggle writes gateway activity to a plugin log file, downloadable or clearable from the configuration page.
How It Works
- Store owner enters the MPGS merchant ID, merchant name, password and endpoint on the Configure page.
- Admin chooses transaction mode, payment mode, create-order timing and any per-store overrides.
- At checkout, the view component creates an MPGS session and loads checkout.js for the selected endpoint.
- Customer completes payment on the Mastercard-hosted redirect page or the inline lightbox overlay.
- The completed callback verifies the result via RETRIEVE_SESSION and RETRIEVE_ORDER before marking the order authorized or paid.
- Admin captures, refunds or voids the payment from the order page as needed.
Specs & Requirements
- nopCommerce — 4.80, 4.70, 4.60, 4.50, 4.40, 4.30, 4.20
- Plugin type — Payment methods; a payment gateway plugin with a checkout view component and route provider
- Requires — A Mastercard Payment Gateway Services (MPGS) merchant account with merchant ID, merchant name and password
- Store setup — Additional store currencies enabled in nopCommerce if multi-currency charging is used
- Integrations — MPGS NVP API version 62 over HTTPS, plus the hosted checkout.js JavaScript library loaded from the selected gateway host