Skip to content

Magento 2

Last updated: 27th June 2022

From downloading the plugin to requesting your first test payment, learn how to get started with the Checkout.com for Magento 2 plugin.

This guide assumes that you have Magento (the plugin is compatible with version 2.2.8 and above) installed. You will also need to be on a dedicated server, or have the enterprise version of Magento, to use this plugin.


Supported features


Before you start

Get your API keys

To set up our Magento 2 plugin, you'll need 3 API keys: a secret key, a public key, and an authorization header key. You can create your secret and public keys in the Dashboard. The authorization header key is generated when you create a webhook for your business.

Create a webhook

Webhooks are notifications that we send when an event occurs on your account (for example, when a payment is captured). These are used by the Magento plugin to update the status of an order. Read more about webhooks.

You can configure a webhook with the default settings directly in the Magento Admin Panel account settings. If you'd like to customize the webhook settings, follow these steps:

  1. Sign in to the Dashboard.
  2. Go to Settings > Notifications.
  3. Select New notification.
  4. Enter a name for the notification.
  5. Select the events you would like to receive notifications for.
  6. Enter the following endpoint URL, replacing example.com with the URL of your shop: example.com/checkout_com/webhook/callback.
  7. Select the entities you would like to receive notifications for.
  8. Generate the authorization header key.
  9. Select Create notification.

Install the plugin

There are 2 ways to install the plugin:

Using Composer

We recommend this method, as it should install the latest version of the plugin.

  1. Go to the root directory of your Magento 2 server.
  2. Use one of the following commands:
    • composer require checkoutcom/magento2
    • composer require checkoutcom/magento2:<VERSION_NUMBER>
  3. You should get a success message confirming the installation of Checkout.com PHP SDK and our plugin.
  4. The plugin is now installed, but you need to recompile your Magento 2 installation and clear the cache before configuring it. Type the following commands in order:
    1. php bin/magento setup:upgrade
    2. rm -rf var/cache var/generation/ var/di
    3. php bin/magento setup:di:compile
    4. php bin magento cache:clean

Using Magento Marketplace

  1. Install our plugin for free from Magento Marketplace.
  2. Follow the installation instructions on the checkout page.
  3. Once you've installed the extension, sign in to your Magento Admin Panel and go to Stores > Configuration > Sales > Payment Methods. If successful, you should now see Checkout.com on the list.

You're now ready to configure the Magento 2 plugin.


Configure the plugin

  1. Sign in to your Magento Admin Panel and go to Stores > Configuration > Sales > Payment Methods.
  2. Find the Checkout.com plugin and select Configure.

Global settings

  1. In the configuration panel, go to Configuration > Global Settings.
  2. Make sure Environment is set to Test so you can start testing card payments.
  3. Select the Payment Action:
  • The Authorize and Capture option means that the charge is authorized and captured (that is, the money due from the customer's account is moved into your account) at the same time.
  • The Authorize option will only authorize the charge. You'll have to capture the payment manually.

If you're unsure, Authorize and Capture is likely the right choice.

Account settings

  1. In the configuration panel, go to Configuration > Account Settings.
  2. Set Service to NAS.
  3. Enter your Secret Key and Public Key. If you're testing, make sure you use the sandbox API keys.
  4. In the Authorization Header Key field, copy and paste the authorization header key from the Notifications section of your Dashboard account.
  5. Select Set Webhooks to automatically register your webhooks in the Checkout.com Dashboard.
  6. Select Save Config.

That's it! You're ready to start testing card payments.


Test your integration

  1. Go to your storefront and add a product to your cart.

  2. Go to your cart and proceed to checkout.

  3. Enter the required billing details. We recommend using a real email address so you can receive the order confirmation.

  4. Select Pay by Card with Checkout.com.

  5. Enter the following card details:

    • Number: 4242 4242 4242 4242
    • Expiry date: any future date
    • CVV: 100
  6. Select Place order. You'll be redirected to the order confirmation page. If you entered a real email address in the billing details, you'll also receive an order confirmation email.

  7. Sign in to your Magento Admin Panel.

  8. Go to Sales > Orders. Your test order will be displayed there with a Processing status (or Pending Payment if you choose the Authorize payment action). This indicates that the payment has been successfully captured. The transaction will also appear in the Payments section of your sandbox Dashboard account.

You can now either go live as is or extend your configuration.

Troubleshooting

If this test does not work, first check you have configured your webhooks correctly. If you have configured them properly, check your server. If it's password-protected or it restricts unfamiliar IP addresses, it may be blocking webhook notifications. Contact our Integration team at integration@checkout.com if you need help.

Further testing

You'll find more test cards and a range of scenarios to trigger in our testing guide.


Go live

If you're happy with the outcome of your testing and want to start taking payments right away, please contact our Sales team in order to move to a live account.

Before you go live, remember to:

  • Switch the Environment to Production in the plugin's settings.
  • Replace the sandbox API keys in the plugin's settings with the production API keys.
  • Configure the webhook URLs in your live Dashboard account.

Extend your configuration

You can extend your configuration to add more payment methods, use 3D Secure payments, and more.