---
updatedAt: 2025-12-09T00:21:57.000Z
agentTools:
  siteIndex: https://merchants.westpac.com.au/llms.txt
  projectIndex: https://merchants.westpac.com.au/onlinepay/llms.txt
---

# Configure the Magento 2 plugin for OnlinePay

## Overview

When you have finished downloading and installing the Magento 2 plugin for OnlinePay in your Magento store, you need to configure the plugin with your OnlinePay credentials. This guide provides instructions for automatic and manual configuration.

## Automatic setup

1. In your Magento admin panel, navigate to **Stores > Configuration**.
2. In the left navigation pane, expand **Sales**, then select **Payment Methods**.
3. In the **Payment methods** section, select the **Verifone - Credit Card Hosted Payment** module.
4. The **Auto Setup Tool** wizard is located under **Verifone - Credit Card Hosted Payment > Verifone account settings**.
5. In the **Auto Setup Tool** wizard, select `Yes` or `No` next to **Test mode** to enable or disable test mode. If you are using a sandbox account, select `Yes`.
6. Provide your OnlinePay `User Id` and `API Key` in the respective fields. You can find out more about where to obtain these credentials in [Get started with the OnlinePay API](https://merchants.westpac.com.au/onlinepay/docs/get-started-with-the-onlinepay-api).
   <Callout icon="⚠️" theme="warn">
     The Merchant Supervisor role is required to create and manage API keys for plugins.
   </Callout>
7. Press **Continue**, then wait for a success or error message to appear.

If a success message appears, the configuration is complete. We recommend that you check all tabs to verify the expected payment methods and settings are enabled, then click **Update settings** to verify.

If you see an error message, your account may not be configurable automatically. In this case, you can configure the plugin manually by following the instructions in the next section.

## Manual setup

To configure the plugin manually, follow these steps:

1. In your Magento admin panel, navigate to **Stores > Configuration**.

   <Image align="center" alt="Navigation to the Stores > Configuration menu in the Magento dashboard" border={false} src="https://files.readme.io/4c4b1bd2fd154df2a2472db873b9f2074bdd291a0d67496c981ccb67b091bcc4-stores-configuration-menu.png" />
2. In the left navigation pane, expand **Sales**, then select **Payment Methods**.
3. In the **Other payment methods** section at the bottom of the page, select the **Verifone - Credit Card Hosted Payment** module.

   <Image align="center" alt="The Verifone Hosted Payment plugin listed under Other payment methods " border={false} src="https://files.readme.io/c9865e265d38bc78b44bfe51b6979cd3dcec15c28f5cd41e0f615547121a54d7-verifone-plugin.png" />
4. In the **Verifone account settings** section, provide your OnlinePay credentials:

   <Image align="center" border={false} src="https://files.readme.io/9c9f8ff5ff3a830b4c95f38a0a57ec5d1a3e897960d7539128faefd05c214a1a-config.png" />

   * **Test Mode**: select `Yes` or `No` next to **Test mode** to enable or disable test mode. If you are using a sandbox account, select `Yes`. Ensure you use credentials associated with the test environment if selecting `Yes`.
   * **Transaction Type**: are automatically configured with `Sale`. The means that authorisation and capture occur immediately when the customer places an order. The other options are `Auth` and `Pre-auth`.
     * Sale - The authorisation and capture of payment are performed in a single step.
     * Pre-auth - Authorisation and capture. Capture must be performed manually in the OnlinePay dashboard.
     * Auth - Authorisation only. This is not supported for OnlinePay.
   * **API User**: Your OnlinePay [User ID](https://merchants.westpac.com.au/onlinepay/docs/user-id).
   * **API Key**: Your OnlinePay [API key](https://merchants.westpac.com.au/onlinepay/docs/api-key).
   * **Entity ID**:  Your OnlinePay [Organisation ID/EntityID](https://merchants.westpac.com.au/onlinepay/docs/org-id).
   * **Region**: Select AU (Australia) from the drop-down list.
     <Callout icon="⚠️" theme="warn">
       The Merchant Supervisor role is required to create and manage API keys for plugins.
     </Callout>
5. In the **Display settings** section, provide the below details:

   <Image align="center" alt="Plug in display settings. " border={false} src="https://files.readme.io/6c4fe0abad4ffb1aae1e99cb900fbad2bbbedb4dc2640d95ffa1651ad25733cc-display-settings.png" />

   * **Payment type**: Hosted Payment Page / iFrame
   * **Title**: Title of the store
   * **Description**: Description of the store
   * **Theme ID**: You can add a theme to use for the checkout page. This is a custom theme that you have created in the OnlinePay dashboard. See [Customise your Checkout](https://merchants.westpac.com.au/onlinepay/docs/customise-checkout) for more information.
6. In the **Card Payment settings** section, provide your OnlinePay credentials:
   * **Enable card payment**: Select `Yes` to accept card payments
   * **Payment Contract ID**: Your OnlinePay [Payment Provider Contract](https://merchants.westpac.com.au/onlinepay/docs/ppc-id) ID.
   * **3DS**: Select `Yes` and provide your [3DS Contract](https://merchants.westpac.com.au/onlinepay/docs/3ds-id) ID.\
     3D Secure is a security protocol that provides an additional layer of security for online credit and debit card transactions.\
     We require merchants to use 3D Secure for card payments. Failing to enable 3D Secure will result in you being liable for any chargebacks. See [3D Secure](https://merchants.westpac.com.au/onlinepay/docs/3d-secure) for more information.
7. In the **Alternative payment options** section, you can add details of the wallets:

   <Image align="center" alt="Options for configuring digital wallet payments (Google Pay and Apple Pay)" border={false} src="https://files.readme.io/4ed037c83193110723e272605754e8ccb20c59adfa30b13c567926ef28a33f2e-wallets.png" />

   * **Google Pay**
     * **Google Pay enabled**: Select `Yes` to accept payments via Google Pay
     * **Google Pay Contract ID** - Provide your OnlinePay [Payment Provider Contract](https://merchants.westpac.com.au/onlinepay/docs/ppc-id) ID.
     * **SCA Compliance Type** - Set the SCA Compliance type to `Wallet`. `Wallet` transactions enforce 3D Secure on transactions that are not a tokenised card. You can enforce 3D Secure on all transactions via Google Pay by selecting `Force SCA`. Alternatively, you can disable 3D Secure by selecting `None`. Disabling 3D Secure authentication may increase the risk of fraud and chargebacks.
     * **Google Pay 3DS Contract Id** - Provide your Google Pay Contract ID
   * **Apple Pay**
     * **Apple Pay enabled**: Select `Yes` to accept payments via Apple Pay
     * **Apple Pay Contract ID** - Provide your OnlinePay [Payment Provider Contract ID](https://merchants.westpac.com.au/onlinepay/docs/ppc-id).
     * **SCA Compliance Type** - None. 3D Secure is not applicable for Apple Pay transactions.
8. Click **Save Config** to apply the settings.
9. Open the command line at the root of your Magento installation and run the following commands to clear the cache and re-index the data:
   ```bash
   php bin/magento indexer:reindex 
   php bin/magento setup:upgrade 
   php bin/magento setup:static-content:deploy -f 
   php bin/magento cache:flush
   ```
10. Perform a test transaction to verify that the plugin is working correctly.

### Troubleshooting

Checkout errors may occur, particularly when using localhost. If you encounter an error, make the following changes:

1. Open the `app/code/Verifone/Hosted/Helper/Verifone.php` file in your preferred editor.
2. Find `$checkout = $this->getCheckoutParams($quote, $paymentMethod, $currency, $customerId, $locale);`.
3. Add the following commands under that line:

```php
$checkout['return_url'] = str_replace("http:", "https:", $checkout['return_url']);
$checkout['shop_url'] = str_replace("http:", "https:", $checkout['shop_url']);
```

4. Save and close.
5. Retry the Checkout process.
6. Perform the transaction and remove the `s` from `https:` in the `return_url` after the transaction is processed to view the page.