afterpay-global / module-afterpay
afterpay-global/module-afterpay
Magento 2 Afterpay Payment Module
Afterpay for Magento 2
Installation
Install using Composer (Recommended)
- From the CLI, run the following commands to install the Afterpay module.
The right installation command is dependent on your Magento 2 version:Magento version Command to run 2.4.* composer require afterpay-global/module-afterpay:^5 2.3.* composer require afterpay-global/module-afterpay:^4 < 2.3.0 composer require afterpay-global/module-afterpay:^3 - Run Magento install/upgrade scripts:
php bin/magento setup:upgrade - Compile dependency injection:
php bin/magento setup:di:compile - Deploy static view files (production mode only):
php bin/magento setup:static-content:deploy - Flush Magento cache:
php bin/magento cache:flush
Install manually
- Download the Afterpay module for Magento 2 - Available as a .zip or tar.gz file from the Afterpay GitHub directory.
The right installation module is dependent on your Magento 2 version:Magento version Download 2.4.* Afterpay 2.3.* Afterpay:4.* < 2.3.0 Afterpay:legacy - Unzip the file
- Create directory `Afterpay/Afterpay` in: [MAGENTO]/app/code/
- Copy the files to `Afterpay/Afterpay` folder
- Run Magento install/upgrade scripts:
php bin/magento setup:upgrade - Compile dependency injection:
php bin/magento setup:di:compile - Deploy static view files (production mode only):
php bin/magento setup:static-content:deploy - Flush Magento cache:
php bin/magento cache:flush
Afterpay Merchant Setup
Complete the below steps to configure the merchant’s Afterpay Merchant Credentials in Magento Admin.
Note: Prerequisite for this section is to obtain an Afterpay Merchant ID and Secret Key from Afterpay.
- Navigate to Magento Admin/Stores/Configuration/Sales/Payment Methods/Afterpay
- Enter the Merchant ID and Merchant Key.
- Enable Afterpay plugin using the Enabled checkbox.
- Configure the Afterpay API Mode (Sandbox Mode for testing on a staging instance and Production Mode for a live website and legitimate transactions).
- Save the configuration.
- Navigate to Magento Admin/System/Tools/Cache Management
- Click Flush Magento Cache button
Upgrade
Composer Upgrade (Recommended)
This section outlines the steps to upgrade the currently installed Afterpay plugin version using composer.
Notes: Prerequisite for this section is that the module should be installed using composer. Please see section 'Install using Composer' for guidelines to install Afterpay module using composer.
[MAGENTO] refers to the root folder where Magento is installed.
- Open Command Line Interface and navigate to the Magento directory on your server
- In CLI, run the below command to update Afterpay module:
The right installation command is dependent on your Magento 2 version:Magento version Command to run 2.4.* composer require afterpay-global/module-afterpay:^5 2.3.* composer require afterpay-global/module-afterpay:^4 < 2.3.0 composer require afterpay-global/module-afterpay:^3 - Make sure that Composer finished the update without errors
- Run Magento install/upgrade scripts:
php bin/magento setup:upgrade - Compile dependency injection:
php bin/magento setup:di:compile - Deploy static view files (production mode only):
php bin/magento setup:static-content:deploy - Flush Magento cache:
php bin/magento cache:flush
Manual Upgrade
This section outlines the steps to upgrade the currently installed Afterpay plugin version.
The process of upgrading the Afterpay plugin version involves the complete removal of Afterpay plugin files.
- Remove Files in: [MAGENTO]/app/code/Afterpay/Afterpay
- Download the Magento-Afterpay plugin - Available as a .zip or tar.gz file from the Afterpay GitHub directory.
The right Afterpay module upgradation is dependent on your Magento 2 version:Magento version Download 2.4.* Afterpay:latest 2.3.* Afterpay:4.* < 2.3.0 Afterpay:legacy - Unzip the file
- Copy the files in folder to: [MAGENTO]/app/code/Afterpay/Afterpay
- Open Command Line Interface
- In CLI, run the command to enable Afterpay module:
php bin/magento module:enable Afterpay_Afterpay - Run Magento install/upgrade scripts:
php bin/magento setup:upgrade - Compile dependency injection:
php bin/magento setup:di:compile - Deploy static view files (production mode only):
php bin/magento setup:static-content:deploy - Flush Magento cache:
php bin/magento cache:flush
Uninstall
- From the CLI, run the following commands to uninstall Afterpay module:
bin/magento module:uninstall Afterpay_Afterpay - Run Magento install/upgrade scripts:
php bin/magento setup:upgrade - Compile dependency injection:
php bin/magento setup:di:compile - Deploy static view files (production mode only):
php bin/magento setup:static-content:deploy - Flush Magento cache:
php bin/magento cache:flush
Headless support
Module supports GraphQL and REST API. See GraphQL and Rest API
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 4.3.6 | stable | Not tested | Not yet tested Details | 2026-06-11 09:43:07 |
| 5.4.5 | stable | Fail | Magento 2.4.7-2.4.8 Details | 2026-06-10 10:23:08 |
| 5.4.4 | stable | Not tested | Not yet tested Details | 2025-08-11 06:24:47 |
| 4.3.5 | stable | Not tested | Not yet tested Details | 2025-08-11 06:16:40 |
| 5.4.3 | stable | Not tested | Not yet tested Details | 2025-03-14 01:51:05 |
| 4.3.4 | stable | Not tested | Not yet tested Details | 2025-03-14 01:49:04 |
| 5.4.2 | stable | Not tested | Not yet tested Details | 2024-11-08 00:09:59 |
| 4.3.3 | stable | Not tested | Not yet tested Details | 2024-11-08 00:06:24 |
| 5.4.1 | stable | Not tested | Not yet tested Details | 2024-08-27 04:38:24 |
| 5.3.2 | stable | Not tested | Not yet tested Details | 2024-08-07 09:11:40 |
| 4.3.2 | stable | Not tested | Not yet tested Details | 2024-08-07 09:10:04 |
| 5.3.1 | stable | Not tested | Not yet tested Details | 2024-03-12 09:18:58 |
| 4.3.1 | stable | Not tested | Not yet tested Details | 2024-03-12 09:17:32 |
| 5.3.0 | stable | Not tested | Not yet tested Details | 2024-02-01 01:49:16 |
| 4.3.0 | stable | Not tested | Not yet tested Details | 2024-02-01 01:47:43 |
| 4.2.2 | stable | Not tested | Not yet tested Details | 2023-11-03 04:31:30 |
| 5.2.2 | stable | Not tested | Not yet tested Details | 2023-11-03 04:29:32 |
| 4.2.1 | stable | Not tested | Not yet tested Details | 2023-10-18 06:23:20 |
| 5.2.1 | stable | Not tested | Not yet tested Details | 2023-10-18 06:21:24 |
| 4.2.0 | stable | Not tested | Not yet tested Details | 2023-09-04 04:51:58 |
| 5.2.0 | stable | Not tested | Not yet tested Details | 2023-09-04 04:50:40 |
| 5.1.4 | stable | Not tested | Not yet tested Details | 2023-08-10 03:08:32 |
| 4.1.2 | stable | Not tested | Not yet tested Details | 2023-08-10 03:02:14 |
| 5.1.2 | stable | Not tested | Not yet tested Details | 2023-07-13 08:37:36 |
| 5.1.1 | stable | Not tested | Not yet tested Details | 2023-07-06 06:22:29 |
| 4.1.0 | stable | Not tested | Not yet tested Details | 2023-06-26 07:24:21 |
| 5.1.0 | stable | Not tested | Not yet tested Details | 2023-06-26 07:18:35 |
| 5.0.5 | stable | Not tested | Not yet tested Details | 2023-03-24 01:37:28 |
| 4.0.5 | stable | Not tested | Not yet tested Details | 2023-03-24 01:36:06 |
| 3.4.5 | stable | Not tested | Not yet tested Details | 2023-02-07 02:30:05 |
| 4.0.5-beta.1 | beta | Not tested | Not yet tested Details | 2022-11-10 05:19:40 |
| 5.0.4-beta.1 | beta | Not tested | Not yet tested Details | 2022-11-10 04:53:51 |
| 4.0.4 | stable | Not tested | Not yet tested Details | 2022-08-16 02:32:58 |
| 5.0.3 | stable | Not tested | Not yet tested Details | 2022-08-16 02:07:48 |
| 5.0.1 | stable | Not tested | Not yet tested Details | 2022-05-19 01:35:08 |
| 4.0.2 | stable | Not tested | Not yet tested Details | 2022-05-18 03:31:35 |
| 4.0.1 | stable | Not tested | Not yet tested Details | 2022-01-14 02:36:30 |
| 4.0.0 | stable | Not tested | Not yet tested Details | 2022-01-12 00:27:15 |
| 5.0.0 | stable | Not tested | Not yet tested Details | 2022-01-12 00:17:02 |
| 3.4.4 | stable | Not tested | Not yet tested Details | 2022-01-12 00:01:04 |
| 3.4.3 | stable | Not tested | Not yet tested Details | 2021-09-08 02:08:44 |
| 3.4.2 | stable | Not tested | Not yet tested Details | 2021-06-16 06:35:11 |
| 3.4.1 | stable | Not tested | Not yet tested Details | 2021-05-05 04:16:06 |
| 3.4.0 | stable | Not tested | Not yet tested Details | 2021-03-24 05:34:09 |
| 3.3.0 | stable | Not tested | Not yet tested Details | 2021-01-13 02:26:55 |
| 3.2.0 | stable | Not tested | Not yet tested Details | 2020-08-19 07:36:45 |
| 3.1.4 | stable | Not tested | Not yet tested Details | 2020-06-26 10:55:33 |
| 3.1.3 | stable | Not tested | Not yet tested Details | 2020-05-20 13:59:40 |
| 3.1.2 | stable | Not tested | Not yet tested Details | 2020-01-23 21:30:10 |
| 3.1.1 | stable | Not tested | Not yet tested Details | 2019-12-24 04:23:56 |
| 3.1.0 | stable | Not tested | Not yet tested Details | 2019-12-24 04:23:34 |
Requires 8
| Package | Constraint |
|---|---|
| afterpay-global/module-cash-app-pay | ^5 |
| magento/framework | ^103.0 |
| magento/module-checkout | 100.4.* |
| magento/module-payment | 100.4.* |
| magento/module-quote-graph-ql | 100.4.* |
| magento/module-sales | 103.0.* |
| magento/module-weee | 100.4.* |
| php | >=7.4.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 405 | 405 warnings (ruleset: Magento2) — 28 auto-fixable with phpcbf |
| PHPMD | Warning | 80 | 80 rule violations (MissingImport:42, IfStatementAssignment:14, UnusedFormalParameter:14, CyclomaticComplexity:3, NPathComplexity:2) |
| Cpd | Warning | 2 | 2 duplicated chunks spanning 102 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
Integration tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.