Skip to content

PrestaShop - MasterCard Payment Gateway Services

OnTap PrestaShop - MasterCard Payment Gateway Services

Installation

You can obtain the module by downloading the module zip from Github, the module is licensed using OSL 3.0.

The module has been tested with the PrestaShop 1.7.4.4 and 1.7.5.0, and PHP 7.1 and 7.2.

Please refer to official Prestashop documentation for general installation guidelines

Configuration

Once you have Mastercard Payment Gateway Service module installed, you can configure module from admin panel.

Find the relevant Configure button under your Module Manager:

OnTap PrestaShop - MasterCard Payment Gateway Services

General Settings

OnTap PrestaShop - MasterCard Payment Gateway Services

This workspace provides the basic extension configuration.

The Live Mode setting toggles between Test and Live mode. Both modes have their own set of credential fields which you need to fill separately. It gives you the ability to switch between modes without re-entering your credentials every time.

The API endpoint should be selected based on your account region.

The Send Line Items toggle allows you to choose if you want shopping cart data to be sent to MasterCard, this includes product information, grand total, etc.

The next block that includes Merchant ID, API Password and Webhook Secret should be added to allow the integration.

Credentials Configuration

Test Mode

Firstly, it’s important to configure your Merchant credentials in TEST mode and make sure that everything works

If the credentials are incorrect for any reason, there will be a warning displayed on the top of the configuration page.

If merchant credentials are not configured correctly, you can not enable any of the modules payment methods.

To find and set up the credentials, please login to your MasterCard Merchant Administration interface

API Password

To obtain an API password, you need to enable integration access via password.

Once logged in your merchant account, select Admin → Integration Settings

API - MasterCard Payment Gateway Services

Click the Edit button on the Integration Settings page:

API - MasterCard Payment Gateway Services

The Integration Authentication Passwords workspace will appear, you will need to click Generate New button next to Password 1:

API - MasterCard Payment Gateway Services

Once the password has been generated, select the Enable Integration Access Via Password checkbox, copy the password and click the Submit button.

Webhook Secret

To obtain the Webhook Secret, you need to enable integration access via password.

Once logged in in the merchant account, select Admin > Webhook Notifications

API - MasterCard Payment Gateway Services

On the Webhook Notifications page:

  1. Select the Enabled checkbox.
  2. Select JSON/REST from the Web Services API Format drop-down list.
  3. Copy the Notification Secret (it will be used for the MasterCard Payment Gateway Services extension).
  4. Click the Save button.

API - MasterCard Payment Gateway Services

The notification URL is not used for this integration.

Integration Methods

The module supports 2 different ways of integration, either Hosted Checkout or Hosted Session.

The Hosted Checkout model allows you to collect payment details from your payer through an interaction hosted and displayed by the Mastercard Payment Gateway. With this model of integration, you never see or handle payment details directly because these are collected by the hosted payment interface and submitted directly from the payer's browser to the Mastercard Payment Gateway.

OnTap PrestaShop - MasterCard Payment Gateway Services

The example of the Hosted Checkout Popup

If Hosted Checkout is integrated and enabled for Mastercard Payment Gateway module, then once user will enter required card details on popup and click on submit order, then upon successfully authorization of entered card details, funds will be deducted from user’s account and will be automatically transferred to merchant/seller’s account. It may take some time to get funds credited but this process will be automatic.

Choose the Hosted Session model if you want control over the layout and styling of your payment page, while reducing PCI compliance costs. The Hosted Session JavaScript client library enables you to collect sensitive payment details from the payer in payment form fields, sourced from and controlled by Mastercard Payment Gateway. The gateway collects the payment details in a payment session and temporarily stores them for later use. You can then include a payment session in place of payment details in the transaction request to process a payment.

OnTap PrestaShop - MasterCard Payment Gateway Services

The example of the Hosted Session integration

Hosted Checkout Integration

Below is the list of Hosted Checkout method configuration which you will find in admin:

OnTap PrestaShop - MasterCard Payment Gateway Services

To enable this option, click Yes in the Enabled configuration switch.

The text provided in the Title option will appear on front-end checkout page / payment method section.

You can apply the effects of the theme on Mastercard Payment Gateway popup by editing the Theme option.

There are two different payment flow methods under Hosted checkout integration:

1 Purchase (Pay)
If Purchase has been selected for Payment Model, then transaction will be done automatically. After user has entered card detail and submit order, amount of total order will be deducted from user’s card and will be automatically transferred to merchant’s account. It may take some time for reflecting amount into merchant’s account, but the process will be automatic.

2 Authorize & Capture
If Authorize & Capture has been selected for Payment Model, then merchant will have to manually process transactions and accept payment amount. Manually process of capturing funds can be done via Prestashop Admin as well as Merchant’s Mastercard Payment Gateway account login.

The Order Summary display option has these values to choose:

  • Hide - to not display any order and card details to user before submitting the order;
  • Show - to display order and entered card details to user before submitting the order;
  • Show (without payment details) - to display only order details to user before submitting the order.

Hosted Session integration

Same as mentioned above for Hosted Checkout Integration, there are two different payment flow methods available: Purchase (Pay) and Authorize & Capture

Below is the list of Hosted Session method configuration which you will find in admin:

OnTap PrestaShop - MasterCard Payment Gateway Services

To enable this option, click Yes in the Enabled configuration switch.

The text provided in the Title option will appear on front-end checkout page / payment method section.

On the Payment Model you can select either:

  • Purchase - Fund will be transferred to merchant account as soon as the user’s entered card details have been successfully verified and the order is placed.

  • Authorize & Capture - 2 stage process; once the order is placed, it will only authorize user’s card details. Payment amount need to be captured manually by merchant.

The 3D Secure has two options available:

  • YES - to add extra layer of security for completing order process. After user will enter card details, it will redirect to user's bank payment gateway for verification.
  • NO - after the card details are verified, the order will be placed. No extra layer of security will be used.

Back-office Operations

As we've previously specified, if Hosted Session has been integrated for Mastercard Payment Gateway Service module and Authorize & Capture payment method has been selected, then Funds need to be captured or refund manually.

Capture Funds

Capture Payment is used for processing transaction and getting order funds into merchant’s account.

Under Order detail page, when clicking on Capture Payment button, it will process transactions and amount of order will be transferred to merchant's account.

OnTap PrestaShop - MasterCard Payment Gateway Services

After clicking on Capture Payment, page will be load and you will get success message. The order status will be changed to Payment Accept.

Void Transaction

Void Transaction is used to cancel order if merchant finds any fraud/suspect in that order.

Under Order detail page, when clicking on Void Transaction button, order will be cancelled automatically.

OnTap PrestaShop - MasterCard Payment Gateway Services

The order amount will be credited to user’s card (if payment has been captured).

Refund Payment

Refund is used to cancel order if the merchant decided to send the money back to the cardholder.

Under Order detail page, when clicking on Full Refund button, the full amount captured for that order will be sent back to the user of the card.

OnTap PrestaShop - MasterCard Payment Gateway Services

To Restock ordered product, you will need to do process of creating Prestashop Refund on top of Mastercard Payment Gateway module refund process

Advanced Configurations

Below are list of advanced configurations of the extension.

OnTap PrestaShop - MasterCard Payment Gateway Services

This module logs data into var/logs/mastercard.log - the Logging Verbosity dropdown controls how much data should be logged:

  • Errors Only is the default option, which only logs errors;

  • Everything option logs everything related to error when it occurs (Like: API Response/status, errors, warning, etc).

  • Errors and Warning Only logs only errors and warnings messages when error occured.

  • Disabled nothing will be logged when error will occured, if this option is selected.

In case one Merchant ID is used by multiple installation, then the Gateway Order ID Prefix can be used to add a prefix to order IDs so that they will not conflict in the gateway. The default state is blank.

The Custom Webhook Endpoint field is mostly used by development or with some complex web server rules, where the URL is not automatically detected correctly.

It is suggested to keep all these fields with assigned default value. If required, then do required configuration changes based on your needs but first consult your Technical team / Mastercard Payment Gateway Module support for these.

Internal Testing

Once you have successfully configured your PrestaShop Mastercard Payment Gateway Service, a few basic tests should be performed to make sure your implementation is working as expected. The scenarios that follow should be considered the minimum level of testing and MasterCard Payment Gateway Services encourage the creation of your own test scenarios that suit your specific business needs.

To access the MasterCard Payment Gateway test simulator, ensure gateway mode is set to TEST. The test simulator is configured to generate predictable results based on the transaction request and card details you supply.

You can trigger specific transaction responses, for example the MasterCard Payment Gateway Response Code and Card Security Code validation, as well as Address Verification response codes. You can also test features like Risk Management and Wallet functionality. Details of test cards can be found here.

  1. Successful Authorization including 3D Secure

    • Ensure you can perform a successful transaction through the PrestaShop checkout.
    • Ensure the transaction is showing the correct state in both PrestaShop Admin Panel and Merchant Administration
  2. Declined Authorization

    • Ensure declined transactions have the correct state in the PrestaShop Admin Panel.
  3. Create an Invoice & Capture Online

    • Create an invoice from an authorized transaction.
    • Ensure the transaction is showing the correct state in both PrestaShop Admin Panel and Merchant Administration
  4. Submit a full refund for a invoiced order

    • Ensure you can perform a successful refund for the full amount of the order.
    • Ensure the transaction is showing the correct state in both PrestaShop Admin Panel and Merchant Administration
  5. Submit a partial refund for an invoiced order

    • Ensure you can perform a successful refund for a partial amount of the full order.
    • Ensure the transaction is showing the correct state in both PrestaShop Admin Panel and Merchant Administration
  6. Refund, Capture, Void via Merchant Administration

    • In some business scenarios it may be necessary to undertake certain actions via Merchant Administration. It is possible (with the correct user privileges) to perform refunds, voids and captures via the Gateway Interface.
    • You should ensure you have sufficient business processes in place to manually update the order state in PrestaShop where necessary.

Support

If you have completed all of the configuration steps above, but are not able to successfully process transactions, you may need to contact your Integrator.