netlab / commerce-two
Two integration for Craft CMS
Installs: 161
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 1
Type:craft-plugin
Requires
- php: ^8.0.2|^9.0
- craftcms/cms: ^4.0.0
- craftcms/commerce: ^4.0.0
- craftcms/commerce-omnipay: ^4.0.0
Requires (Dev)
- craftcms/rector: dev-main
README
Two integration for Craft CMS
Requirements
- Craft CMS version 3.7.0 or later
- Craft Commerce version 3.4.0 or later
Installation
-
Navigate to the root directory of your Craft project in the terminal:
cd /path/to/project
-
Use composer to load the plugin:
composer require netlab/commerce-two
-
In the Control Panel, navigate to Settings > Plugins and click the “Install” button for Commerce Two.
Usage
This plugin enables integration with Two through a custom implementation of the Omnipay gateway. However, it is not a plug-and-play solution and requires implementation steps to be performed using the controller actions provided for the checkout process.
Configuration
The following steps must be taken to configure the plugin:
- Go to the plugin settings page (admin/settings/plugins/commerce-two) and add your API credentials (Merchant ID, API keys, select the appropriate environment, and language for invoice generation). Consider using environment variables for storing sensitive information.
- Create a new payment gateway in Craft Commerce (admin/commerce/settings/gateways) and set Two as the gateway. The plugin supports both Authorize Only and Purchase options. Note that for the Authorize Only option, you will need to manually capture the payment for each order.
Features
- Query companies by their names or organization numbers using the
commerce-two/company-search
action. - Retrieve the address of a desired company using
commerce-two/company-address
. - Verify that a company is allowed to use Two as a payment provider using
commerce-two/company-check
action. - If the company is accepted by Two, use
commerce-two/set-company
to save the company information to the cart object. This is a mandatory step as this information is used during API communication. - If your website uses a custom implementation to handle billing or shipping addresses, use the
commerce-two/set-customer-addresses
endpoint to attach the information to the customer object. This is also mandatory as the plugin uses the built-in Address handling provided by Craft 4.
Brought to you by Netlab