Magento is a popular eCommerce platform. AfterPay has developed a plugin that easily integrates with a Magento-based webshop. It is a simple way to let your customers start using AfterPay at checkout.
You don't need advanced technical skills to add AfterPay to your Magento webshop!
What you need:
A Magento instance, installed on your webserver. You also need SSH access to that server.
An API key. For testing purposes, you can get one from your Account Manager at AfterPay.
When you are ready to go live, contact your Account Manager at AfterPay. They will configure your webshop in the backend, and give you the real production API key.
If you are thinking about offering AfterPay to your customers, please don't hesitate to contact our sales team. We will be happy to walk you through the setup and integration process.
The AfterPay plugin for Magento 2 is currently available in the following countries:
This document assumes that you already have a working, installed webshop that uses Magento 2 (v2.2.5 or above). If you don't, you can download the software and learn how to use it here .
Many web hosting services have a backend tool that lets you install popular software packages with just a few clicks, and Magento is often included in those.
Get the Plugin
The easiest way is to use the official AfterPay module in the Magento Marketplace: https://marketplace.magento.com/afterpay-afterpay-module.html
Note: There are two versions of the AfterPay plugin - one for Magento v1.9.x, and one for Magento 2 and later. They are not mutually compatible. If you have a Magento 2 webshop, you cannot use the Magento 1.9 plugin, and vice versa.
Manual Plugin Installation
You can also download and deploy the plugin manually, bypassing the Magento Marketplace.
To deploy the AfterPay plugin for Magento 2.x:
Connect to the webserver via SSH. You will see a command line interface (text-only).
- For Windows, we suggest using the free SSH tool PuTTY: https://putty.org/
- For MacOS, you can use its existing Terminal app.
- If you need help connecting via SSH (or finding your login and password), please contact your webserver's hosting company.
Go to the directory that contains Magento.
- The command for seeing your current directory is pwd.
- The command for seeing all files and subdirectories in your current directory is ls.
- The command for changing directories is cd. For example: cd magento2
Enter the following command and hit Enter:
composer require afterpay/afterpay-module
If you are asked for a username and password:
- Go to http://marketplace.magento.com and log in (or register a new account if you haven't done so before).
- Click on your name in the top right corner, and go to My Profile > My Products > Access Keys. (Alternatively, log in and go to https://marketplace.magento.com/customer/accessKeys/)
- Under the Magento 2 tab, click Create a New Access Key. Enter a name for the key and click OK.
- You will see a pair of character strings: a public key and a private key. You can copy these from the browser using Ctrl+C, and paste them into Putty using the right mouse button.
- In Putty, use the Public key string as your username, and the Private key as your password.
- If you are asked if you want to store the credentials, type y and hit Enter.
Type the following commands and hit Enter after each one. This will force Magento to update and recognize the AfterPay module.
php bin/magento setup:upgrade
php bin/magento cache:flush
- You are done! To verify that the install was successful, open the Magento Admin Panel and go to Stores > Configuration > Sales > Payment Methods. You should see various AfterPay options in the list.
Update the Plugin
To install a new version of the plugin, repeat the installation process.
Configure the AfterPay Plugin
Once you have your Auth keys for all the countries where you will be offering AfterPay, the next step is to configure the plugin's settings.
- Open the Magento Admin Panel.
- Go to Stores > Configuration > Sales > Payment Methods > AfterPay...
- Expand the sections, and fill them in as described below.
There is a separate section (Portfolio) for each combination of country and AfterPay payment method (Invoice, Direct Debit, etc.). There is also a special portfolio for B2B sales in the Netherlands, where business-to-business transactions are handled in a special way.
Portfolios are disabled by default, and must be enabled explicitly in their settings.
You can have more than one portfolio per country.
- You can have both Digital Invoice and Direct Debit enabled in the Netherlands. Both options will show up at checkout.
A Portfolio will only work for customers from that country.
- If you only have the AfterPay BE Digital Invoice portfolio enabled, AfterPay will not be available to customers whose address is in the Netherlands.
There are also two settings panels that are not portfolios: AfterPay Tax Settings and AfterPay Developer Settings.
These are collections of settings for different countries and AfterPay payment methods. You don't need to enable and configure all of these - only the ones that you want to offer to your customers.
There are separate portfolios for each country. These are identified by the ISO standard two-letter country code: NL - Netherlands, BE - Belgium, DE - Germany
- AfterPay XX Digital Invoice - This is the default 14-Day Invoice payment method in AfterPay. It is always available in every market where AfterPay operates. It is primarily meant for business-to-consumer sales.
- AfterPay XX Direct Debit - This is a Direct Debit version of the 14-Day Invoice payment method. Instead of receiving an invoice to be paid via their bank, the customer enters their bank details, and the money is immediately deducted from their bank account.
- AfterPay XX B2B Digital Invoice - This is a 14-Day Invoice for business-to-business sales. It is handled slightly differently in terms of tax, etc.
You can optionally enable Extra portfolios as a second portfolio for the same country and the same payment method. For example, you can have AfterPay DE Direct Debit and AfterPay DE Direct Debit Extra.
This is usually done if your store carries a mix of high-value and low-value items. For example, you might use the regular portfolio for orders under €500, and the Extra portfolio for orders over €500. The Extra portfolio would have its own API key and a different set of Risk and Fraud Check rules applied.
Contact your AfterPay Account Manager if you would like to set up additional API keys for Extra portfolios.
Each portfolio has the minimal settings (these must be filled in for the payments to work), and Advanced Settings. In addition, some settings are only available in some countries. The table below describes all possible settings. Use Ctrl+F to find a particular setting.
|Enable this Solution||
If this is set to Yes, this AfterPay payment method will be available to customers in this country.
|Maximum Order Total||
The biggest purchase that a customer can make in your webshop when paying with AfterPay.
If the total sum of the shopping cart is higher than this number, this portfolio is not displayed at checkout.
Leave empty to set no upper limit.
Select Yes to use the Test mode credentials.
Select No to use the Production mode credentials.
This is useful if you already have a working webshop, but would like to switch back to testing mode for a short time.
Test mode API key
The Auth key for test transactions. You can get this from the your Key Account Manager.
|Production mode API key||The Auth key for real transactions. You will get this from your Key Account Manager in the last stage of the process.|
|Test mode merchant ID||
You can get this from your Key Account Manager.
|Belgium and Netherlands only|
|Test mode portfolio ID||You can get this from your Key Account Manager.|
|Test mode password||You can get this from your Key Account Manager.|
|Production mode merchant ID||You will get this from your Key Account Manager in the last stage of the process.|
|Production mode portfolio ID||You will get this from your Key Account Manager in the last stage of the process.|
|Production mode password||You will get this from your Key Account Manager in the last stage of the process.|
|Payment for Applicable Customer Groups||
Select All Allowed Groups to enable this portfolio for all customers.
Select Specific Groups to enable this portfolio for only certain customer groups. Select those groups below, under Advanced Settings > Allowed Customer Groups.
To configure customer groups, go to the Magento Admin Panel's left-hand navigation menu and select Customers > Customer Groups. See Magento's documentation for more details.
Set to 1 to make this the first (top) payment option shown to customers at checkout.
If you are using several AfterPay portfolios in the same country, then you can set others to 2 or more.
The name of this payment method, as displayed to the customer at checkout.
|Description||A short description of this payment method, as displayed to the customer at checkout.|
|Enable IP restriction||
Select Yes to make AfterPay visible in checkout only when accessed from the developers' IP.
To set the developers' IP, go back to the Magento Admin Panel's left-hand navigation menu, and select Stores > Configuration > Advanced > Developer > Developer Client Restrictions.
To find your current external IP, go to google.com and type in "what is my IP".
|Exclude AfterPay for shipping methods||Select the shipping methods that cannot be used with AfterPay. If the customer selects this shipping method, this portfolio will not be available at checkout.|
|Payment from Applicable Countries||
Select All Allowed Countries to enable this portfolio for customers from any country.
Select Specific Countries to make this portfolio only visible to customers with a shipping/billing address in a specific country.
This setting is relevant to the way Magento displays payment options. AfterPay portfolios are country-specific, so you can use this setting to prevent customers from seeing a payment option that will always be rejected, since the customer is not in that country.
For example: if you have a webshop that serves Germany, Austria and Switzerland, use this setting to make the portfolio visible only to customers from Germany. If a customer from Austria tries to use an AfterPay DE Digital Invoice portfolio, their authorization will always be denied.
|Payment from Specific Countries||Select countries (hold down Shift or Ctrl to select multiple countries at once). This portfolio will only be displayed to customers whose shipping/billing address is in one of those countries.|
|Success Page URL||
The page displayed to the customer upon a successful checkout with AfterPay.
This can be a special page on your webshop, or MyAfterPay.com, or something else.
|Validation Failure Page URL||
The page displayed to the customer if the call sent by the webshop to AfterPay was rejected.
This can be a page encouraging the customer to contact the webshop for help, etc.
|Enable Terms and Conditions||
|Minimum Order Total||
The smallest purchase that a customer can make in your webshop when paying with AfterPay.
If the total sum of the shopping cart is lower than this number, this portfolio is not displayed at checkout.
Leave empty to set no bottom limit.
AfterPay's backend does a sanity check on each purchase, and may reject a purchase that is unreasonably small, even if your webshop doesn't.
|Debug Logfile||Select Yes to write AfterPay-specific application logs to a local logfile on your server. The path to the logfile is shown beneath the dropdown.|
|Debug Email||Select Yes to send AfterPay-specific application error alerts to an email address.|
|Debug Email To||Appears only if Debug Email is set to Yes. Enter the email address where alerts will be sent.|
|Allowed Customer Groups||
If Payment for Applicable Customer Groups in the portfolio's basic settings is set to Yes, select the customer groups who can see AfterPay at checkout.
To configure customer groups, go to the Magento Admin Panel's left-hand navigation menu and select Customers > Customer Groups . See Magento's documentation for more details.
AfterPay Tax Settings
These settings determine how Value-Added Tax is applied to different categories of invoice line items (such as goods, shipping fees, gift cards, downloads, subscriptions, etc.). In some countries, certain items such as books, food, event tickets, etc. may have VAT rates that are smaller than usual, or even zero.
These rules must be configured to ensure that AfterPay handles tax, invoicing and settlement correctly.
This relies on the correct configuration of taxes elsewhere in the Magento Admin Panel. For more information, please see Magento's documentation on taxes.
If you are not sure which tax rates apply to which of your products, please contact a local accountant.
|VAT category 1 (High)||Select the line item category that is charged at the full VAT rate.|
|VAT category 2 (Low)||
Select the line item category that is charged at a reduced VAT rate.
|VAT category 3 (Zero)||
Select the line item category that is charged at a VAT rate of zero.
Note: This is not the same as being exempt from VAT!
|VAT category 4 (None)||
Select the line item category that is not subject to VAT.
Note : This is not the same as being charged at a VAT rate of zero! This category is usually for things like shipping fees or gift cards.
|VAT category 5 (Middle)||
Select the line item category that is charged at the medium VAT rate.
|Fallback VAT category||Select which category will be used by default, for products that are not configured into a valid VAT category.|
|VAT category for shipping||Select which category will be applied to shipping costs.|
|VAT category for discounts||
Select which category's tax rules apply to discount amounts.
This usually depends on whether you apply discounts to a product's gross price, or net price. If you apply a discount to a price that already includes tax, the share of tax that is now in the discount must be handled correctly.
|VAT category for payment fee||Select which category's tax rules apply to the fee you charge the customer for using AfterPay.|
AfterPay Developer Settings
These settings should be left alone unless someone from AfterPay tells you to change them.
Presentation at Checkout
The AfterPlay plugin for Magento already comes with the correct Terms & Conditions, logos, etc. Everything should display correctly on your checkout page by default.
We recommend that you set the following values under the AfterPay plugin settings:
Order = 1
- If you have multiple AfterPay payment methods for the same country, give them the lowest possible (but different) sort order numbers.
- Enable Terms and Conditions = Yes
For more information, or if you want to customize your checkout page further, please see AfterPay's Display Guidelines.
Testing & Go Live
Once your webshop has been configured with test Auth keys, you can make a test purchase using AfterPay as the payment method.
- If you want to test the whole chain, ask your Key Account Manager for an Auth key to the Afterpay Client Test environment. You can use this in Test mode. You will receive confirmation emails, and will be able to see the invoices in MyAfterPay, the customer portal used for payment and invoice management.
- Once you and your Key Account Manager are happy that everything is in order, you will get a Live Auth key, and can start offering AfterPay to your customers!