Description
Card payments through Mastercard Payment Gateway Services (MPGS) Hosted Checkout, built for API version 100
(the version many acquiring banks require now that older API versions are being decommissioned).
You need a merchant account with a bank that uses MPGS. The bank gives you the gateway URL, the Merchant ID and the API password.
INITIATE_CHECKOUTsession request with all order details (amount, currency, description, merchant name/address/logo, customer, return/cancel/timeout URLs).static/checkout/checkout.min.jswithCheckout.configure({ session: { id } })only, as required from API 63.- Payment Page (redirect to the bank page) or Embedded Page (card form inside the shop page). Lightbox no longer exists from API 63.
- Server-side verification: the order is marked as paid only after Retrieve Order confirms status CAPTURED (or AUTHORIZED) for the full amount and currency.
- Live and test (MTF) credentials side by side, with a Test mode switch.
- Purchase or Authorize-only payment action.
- Debug log (WooCommerce > Status > Logs, source
mpgs-hosted-checkout) with the full request / response – the API password is never logged. - Admin order action “Check MPGS payment status” for customers who closed the browser before returning to the shop.
- Imports the settings of the old “WooCommerce MPGS” (woo-mpgs) plugin the first time it loads (new gateway stays disabled until you enable it).
- HPOS (custom order tables) and Checkout block compatible.
DBOtec Hosted Checkout is an independent plugin by DBOtec. It is not affiliated with, made or endorsed by Mastercard or WooCommerce. Mastercard, Mastercard Payment Gateway Services (MPGS) and WooCommerce are trademarks of their respective owners.
External services
This plugin connects to the Mastercard Payment Gateway Services (MPGS) gateway of your bank, at the gateway URL you enter in the settings (for example https://yourbank.gateway.mastercard.com/). Card payments cannot work without it. Nothing is sent until the gateway is enabled and configured.
What is sent and when:
- When a customer places an order with this payment method (and when the order-pay page needs a new session), the plugin sends an
INITIATE_CHECKOUTrequest to{gateway}/api/rest/version/{version}/merchant/{merchantId}/sessionwith: the order ID, amount, currency, description and order number; the return, cancel and timeout URLs of your shop; the merchant name, shop URL, logo URL and address from the settings; the customer’s billing email, first name and last name; and the WordPress user ID of a logged-in customer. The request is authenticated with your Merchant ID and API password. - On the order-pay page the customer’s browser loads the Hosted Checkout script
{gateway}/static/checkout/checkout.min.jsfrom the gateway. The customer enters the card details on the gateway page or in the gateway’s embedded form; card details never pass through your site. - When the customer returns to the shop, and when an admin runs the order action “Check MPGS payment status”, the plugin sends a Retrieve Order request to
{gateway}/api/rest/version/{version}/merchant/{merchantId}/order/{orderId}to confirm the payment.
The service is provided by Mastercard and your acquiring bank. Your merchant agreement with the bank applies, as well as:
- Mastercard Terms of Use: https://www.mastercard.com/global/en/vision/who-we-are/terms-of-use.html
- Mastercard Global Privacy Notice: https://www.mastercard.com/global/en/privacy-notice.html
Installation
- Upload the
dbotec-hosted-checkout-for-mpgsfolder to/wp-content/plugins/(or Plugins > Add New > Upload the zip). - Activate the plugin.
- WooCommerce > Settings > Payments > MPGS Hosted Checkout (API v100).
- Fill in the live gateway URL, Merchant ID and API password (and the test ones), API version, merchant name.
- Test with Test mode on, then switch it off for live payments.
- If you used the old “WooCommerce MPGS” plugin, disable its payment method when the new gateway works.
FAQ
-
The bank asks for the request and response of the session creation
-
Turn on Debug log, place a test order and open WooCommerce > Status > Logs, source
mpgs-hosted-checkout. -
The order stays “Pending payment” but the customer paid
-
Open the order and run the order action “Check MPGS payment status”.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“DBOtec Hosted Checkout for MPGS” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “DBOtec Hosted Checkout for MPGS” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.5
- Renamed to DBOtec Hosted Checkout for MPGS (slug and text domain dbotec-hosted-checkout-for-mpgs).
- Readme: trademark notice.
1.0.3
- Return URL parameters sanitized with sanitize_text_field().
1.0.2
- Payment page markup escaped with wp_kses_post() at output.
1.0.1
- Renamed for the WordPress.org directory (new slug and text domain).
- Gateway URLs have no bank-specific defaults.
- Readme: External services section.
1.0.0
- First release: MPGS Hosted Checkout API v100.