This plugin provides an Afterpay gateway for Craft Commerce (2 & 3).
- AU, NZ and US Regions (AU tested, NZ and US Pending SAT)
- Full and Partial refund support
- Authorisation and Total mismatch detection (passes Afterpay SAT)
- User-Agent headers (passes Afterpay SAT)
- Excellent Afterpay API response debugging
- Native Commerce 2 Integration (no OmniPay abstraction)
This plugin requires Craft CMS 3.1 or later and Craft Commerce 2.x or Craft Commerce 3.x.
To install Afterpay for Craft Commerce
, navigate to the Plugin Store section of your Craft control panel,
search for Afterpay for Craft Commerce
, and click the Try button.
You can also add the package to your project using Composer.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require newism/commerce-afterpay
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Afterpay.
First you'll need to setup a merchant account. This can be done by emailing Afterpay.
Once you have a merchant account you'll be provided with a Merchant ID
and Merchant Key
.
To add the Afterpay payment gateway, go to Commerce → Settings → Gateways, create a new gateway, and set the gateway type to “Afterpay”.
You may then decide to configure your Afterpay gateway using a config file. An example file looks like:
<?php
return [
'afterpayGatewayHandle' => [
'sandboxMode' => getenv('AFTERPAY_SANDBOX_MODE'),
'merchantId' => getenv('AFTERPAY_MERCHANT_ID'),
'merchantKey' => getenv('AFTERPAY_MERCHANT_KEY'),
// Must be 'AU', 'NZ' or 'US'
'region' => getenv('AFTERPAY_REGION'),
],
];
Afterpay only supports one currency per region. Due to this limitation stores must set their base currency to match their Afterpay account region. Payments will be processed in the base currency.
If you've found a bug, or would like to make a feature request, head to the GitHub Repo and file an issue. Pull requests are also most welcome!
Get our attention on Twitter by using the #craftcms
hashtag and mentioning @newism
Ask a question via the Craft Stack Exchange and tag your question with plugin-newism-commerce-afterpay
.
Any feedback, comments, questions or suggestions please email us at support at newism.com.au
.
You can try this plugin in a development environment for as long as you like.
For more information, see Craft's Commercial Plugin Licensing.
Brought to you by Newism