MenuPlease select your page
This guide describes the steps to quickly install, configure, test and activate the AfterPay payment methods in your Magento 2 store.
AfterPay offers 5 different payment options via Magento 2:
- 14-day 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.
- Campaign invoice - During peak seasons, such as Christmas, merchants may use campaign invoicing, which allows shoppers extended payment terms per purchase or a fixed due date.
- 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.
- Instalments - This is a Part Payment invoice. The customer can split their purchase over multiple monthly payments.
- B2B invoice - This is the B2B consumer version of the default 14-day invoice payment method in AfterPay.
The available payment methods per country for Magento 2 can be found in this table:
|Country||14-day invoice||Direct Debit||Campaign invoice||Fixed instalments||Flex payment||B2B invoice|
In this chapter we will explain how you can install and configure AfterPay for your Magento webshop.
There are two ways to install our plugin. You can install the plugin via SSH through composer. This is the recommended way due to the availability of direct updates. Or you can install the plugin via the Marketplace. At the moment updates are not directly available through the marketplace as Magento is reviewing every release before they publish it. Having a magento webshop running with version 2 or above is a prerequisite.
1) Change the directory to project root/ folder, and run the following command to install and update the AfterPay module and dependencies:
composer require arvato/afterpay-magento-2-extension
2) Upgrade and flush Magento cache
php bin/magento setup:upgrade
php bin/magento cache:flush
You are also able to install the plugin via the Magento Marketplace. Due to the currently long release reviews by Magento the updates will only be available with delays. You can find the AfterPay extension here.
Please log into your Magento admin page and navigate to Stores -> Configuration -> Sales -> Payment Methods.
The AfterPay payment methods are split per country. Therefore, activate the AfterPay payment method based on the countries with the values shown below and from the mail you received from your AfterPay implementation consultant.
Important: For backwards compatibility in The Netherlands and Belgium, Legacy SOAP payment methods are still included. Please do not use those unless specified otherwise by AfterPay.
1) Enable the 14-day invoice payment method. If you want to offer other AfterPay payment methods, make sure that the 14-day invoice payment method is enabled.
2) Enter the maximum order value
3) Set Connection Mode to Test if you received a test key. If you created your own Sandbox key via the developer portal set the Connection Mode to Sandbox. You can find more information on our sandbox here.
4) Enter the API key in the Test API Key or if you are testing, use sandbox in Sandbox API Key.
5) (optional) If you are testing the connection on your production environment you need to activate the IP restriction. The payment method will only be shown to the IP address that is entered in Magento. This will prevent customers from seeing the test payment method.
Advanced settings (optional)
Advanced settings are optional. Everything is setup correctly as standard. Only for some special integrations it can be necessary to amend these settings. Be careful when changing these settings. Please contact your Implementation Manager when you are in doubt.
You will find the advanced and developer settings here.
After completing the setup the next step is to test the connection.
Standard test scenarios
Please submit the following test scenarios. To check your own test transactions proceed to paragraph check test order. Complete the table with your order numbers and send it to your AfterPay Implementation Manager. You can put multiple test cases in one order but please refer to the right order number after each testcase.
|#||Test case||Order number|
|1.||Test an order with multiple products|
|2.||Test an order with a fixed discount|
|3.||Test an order with a percentual discount|
|4.||Test an order with a shipping fee|
|5.||Test an order with an alternate delivery address|
|6.||Test an order with pick-up points (if applicable)|
|7.||Test an order with store pick-up (if applicable)|
|8.||Test an order with a house number addition|
|9.||Test and make sure the VAT is correctly received by AfterPay|
Payment method scenarios
After you tested all standard scenarios for the 14-day invoice you should start testing the other payment methods you activated. Please complete the tables with your order numbers and send them to your AfterPay Implementation Manager.
If you want to integrate Direct Debit please proceed with this test order:
|#||Test case||Order number|
|D-1.||Test an order with the Direct Debit payment method|
If you want to integrate invoice for Business to Business please proceed with this test order:
|#||Test case||Order number|
|B-1.||Test an order with the Business to Business payment method|
If you want to integrate Instalments please proceed with these test orders:
|#||Test case||Order number|
|I-1.||Test an order with 3 month instalments|
|I-2.||Test an order with 6 month instalments (if applicable)|
|I-3.||Test an order with 12 month instalments (if applicable)|
If you want to integrate a Campaign invoice please proceed with this test order:
|#||Test case||Order number|
|C-1.||Test an order with the Campaign invoice payment method|
Customer facing messages
It is also necessary to check if the error messages are correctly shown to the customer.
- Test a rejected authorize. Please make sure that the customer friendly message is displayed correctly in the check-out.
- Test validation error. Please make sure that the customer friendly message is displayed correctly in the check-out.
Check test order
You are able to verify the transactions on the AfterPay side by yourself. You can do this with the "GET ORDER" call. You can send these calls for example with Postman. The response will show you how the transactions a registered on the AfterPay side. Documentation for the "GET ORDER" call can be found below.
Returns the contents of the specified order
In this chapter we will explain the AfterPay visual guidelines you need to apply to your webshop.
Logos and banners
For convenience and a familiar customer experience, please integrate/enclose the AfterPay logo in your Checkout next to the payment method. Please refer to our Merchant Playbook for full details on how to make the customer experience smooth and frictionless.
When Implementing the AfterPay logo throughout the shopping experience please ensure you are using our URL, not by downloading the image. The AfterPay logos are hosted on a Content Delivery Network (CDN) to ensure the best performance and availability for your website. Furthermore, you do not have to care about changes, which are all done by AfterPay.
We provide two types of logos through our CDN - .svg and .png. We recommend using the AfterPay logo as a .svg file with regard to the quality and size of the file. If you prefer .png just change the end of the URL to .png. We also offer the AfterPay logo in different color schemes. Depending on your individual website background, choose the AfterPay logo that fits best.
|AfterPay Checkout Logo in SVG, 4.3Kb||https://cdn.myafterpay.com/logo/AfterPay_logo_checkout.svg|
|AfterPay Black Logo in SVG, 5.44Kb||https://cdn.myafterpay.com/logo/AfterPay_logo_black.svg|
|AfterPay White Logo in SVG, 5.61Kb||https://cdn.myafterpay.com/logo/AfterPay_logo_white.svg|
Terms and conditions
In this chapter we will explain which steps you need to take to enable the payment method on production. For the final go-live a contract between you and AfterPay is required.
Configure live mode
1) Make sure to completed the testing with your implementation consultant. Once you received the production key you can continue.
2) Make sure you configured the payment methods correctly on the production environment.
3) Enter the API key in the Production API key.
4) Set Connection Mode to Production.
5) Enable the payment method
Congratulations! You just went live with your AfterPay connection. Please notify your AfterPay Implementation Manager that you went live. If you encounter any issues in the upcoming week you can contact your AfterPay Implementation Manager. After that period you can contact our local Merchant Desk for help.
Introduction to the AfterPay Merchant Portal
You can go to the Merchant Portal here. Once logged in, you will also see an in-depth guide on how to best use it.
In the merchant portal you can:
- View and mutate your AfterPay orders
- Get financial reports
- Setup your branding in the AfterPay systems
Advanced payment method settings
2) You are able to exclude AfterPay when a certain shipping method is selected. This can be useful if you are not able to send the shipping address to AfterPay.
4) Minimum order total. This is the minimum amount you have to put in your shopping cart to display AfterPay in the check-out. Leave empty to set no minimum amount.
5) Debug logfile. Select yes to write AfterPay specific application logs to the local logfile on your server. The path is shown beneath the drop-down.
6) Debug email. Select yes to send AfterPay specific application error alerts to an email address.
7) Payment for applicable customer groups. You are able to enable this payment method for only the selected customer groups.
The following 3 settings apply to prevent validation errors due to risk checks. Please, also refer to your merchant contract and to the consumer information section.
8) Enable phone number input field. If you enable this AfterPay will request this data after you choose the payment method. This can be useful if you are not already requesting this value in your check-out fields. If you already request this please disable this field.
9) Enable Birthday input field. If you enable this AfterPay will request this data after you choose the payment method. This can be useful if you are not already requesting this value in your check-out fields. If you already request this please disable this field.
10) Enable gender input field. If you enable this AfterPay will request this data after you choose the payment method. This can be useful if you are not already requesting this value in your check-out fields. If you already request this please disable this field.
Order management settings
If you have to adjust the settings, do not forget to refresh the configuration cache in System => Cache management.
1) Capture Modes
- Manual - It will only act upon the actions of the Magento back-end or the Magento API. This will give the best consumer experience.
This is applicable if you process orders manually in the back-end of Magento, process orders with an ERP connected to Magento or use the API of Magento.
- Yes, direct (current default) - An invoice will be created and captured towards AfterPay immediately and communication will be send out three days after the automated capture was performed.
This is applicable if you have everything at stock and start processing the shipment immediately after the order is accepted.
- Off - Disable all communication regarding capturing and refunding towards AfterPay. For example an invoice will not have the option to 'online' capture the order.
This is applicable if you don't want any order management (captures / refunds) communication with AfterPay. For example if AfterPay has the auto-capture functionality enabled in the AfterPay back-end systems.
- Yes, at shipping - After authorization, the order will be created and set to processing. But no invoice is created. This will be created and captured when a shipment is created. In case you can only ship when an invoice is created, then the configuration should be set to 'manual'. Then you will get an option for 'auto invoice creation', which should be set to 'yes'. Same as for the options "Force invoice state to PAID instead of PENDING" and "Force capture to be triggered by shipment".
This is applicable if you have different processing times of the shipment. This will be the default in the next release, because this setting is applicable for the majority of merchants.
- Yes, at selected status - After authorization, the order will be created and set to processing. But no invoice is created. This will be created and captured when the order is set to the configured status.
This is applicable if you use order statuses, and want to use a specific order status to trigger capture.
2) Auto invoice creation - With this setting you can enable the automatic creation of invoice without capture being done.
3) Force invoice state to PAID instead of PENDING - This option gives the possibility to set invoices to status PAID, instead of PENDING. This is particularly useful for cases you want to export paid Magento invoices, but do not want to have the invoice captured yet.
4) Force capture to be triggered by shipment - This option gives the possibility to capture the order based on the shipment. You can create the shipment in Magento and based on that the invoice will be captured.
Important note: A full shipment will trigger a full capture on the original invoice. A partial shipment will cancel the original invoice and create a new invoice based on the items selected in the shipment. This new invoice will get the status PAID. So if you use an export of invoices with the status 'paid' it should be certain not to import these new invoices again.
5) Status Capture Request Accepted - Assign the status that will be applied to the order after successful capture
6) Status Capture Request Refused - Assign the status that will be applied to the order in case the capture is declined
7) Enable Refund - Enable refunds towards AfterPay from Magento.
8) Use Void For Cancelled Uncaptured Orders - If you Cancel and order that it is not yet captured, that will trigger a Void request to be sent towards AfterPay.
9) Calculate Discount Per Item In The Cart - With this configuration option you can choose to calculate the discount per order item line, instead of one discount order line. This is helpful if you are selling products in different VAT categories and uses discounts. In this way the correct VAT amount is discounted.
10) Error message timeout in ms - With this configuration option you can decide how long an error message should be shown in the checkout. Error messages automatically disappears quite fast in the default Magento setup with this option you can adjust this behavior.
11) Allowed Developer IP - Here the developer can fill in it's IP address if IP restriction is enabled, to make the payment methods visible only for this IP.
The AfterPay Magento 2 module is tested up until version 2.4.3 of Magento 2.
Module version 2.0 and up is up to the new standards with Magento 2, and therefore more stable and useful. But it has a dependency which requires a minimum of Magento version 2.2.4.
Merchants who use a version older than Magento 2.2.4 can use version 1.9.1 of the AfterPay module, but we advise to update your Magento environment to the latest version to be able to use the latest AfterPay module.
The compatibility is tested with the following external plugins:
Our complete release notes can be found on our repository page: https://packagist.org/packages/afterpay/afterpay-module