infinitum-space / module-checkmo-permission
Magento 2 module that restricts access to the Check / Money Order (checkmo) payment method based on a customer attribute 'Allow Check / Money Order'.
Package info
github.com/Infinitum-Space/m2-checkmo-permission
Type:magento2-module
pkg:composer/infinitum-space/module-checkmo-permission
Requires
- php: ^8.1 || ^8.2
- magento/framework: ^103.0
- magento/module-checkout: ^100.4
- magento/module-customer: ^103.0
- magento/module-eav: ^102.0
- magento/module-quote: ^101.1
- magento/module-ui: ^101.1
README
Magento 2 module that adds a "Allow Check / Money order" attribute to the customer entity and conditionally enables the Check / Money Order (checkmo) payment method based on that attribute.
✨ Features
-
Adds
allow_checkmoattribute tocustomerentity. -
Attribute is visible only in the Admin Panel on the customer edit page.
-
The
checkmopayment method is available only if:- it is enabled in configuration, and
- the logged-in customer has the attribute enabled.
📦 Installation
Composer (recommended)
composer require infinitum-space/module-checkmo-permission bin/magento module:enable InfinitumSpace_CheckmoPermission bin/magento setup:upgrade bin/magento cache:flush
Manual Installation (alternative)
-
Copy the module to:
app/code/InfinitumSpace/CheckmoPermission -
Run the following commands:
bin/magento module:enable InfinitumSpace_CheckmoPermission bin/magento setup:upgrade bin/magento cache:flush
-
Ensure that the Check / Money Order payment method is enabled:
- Go to:
Stores → Configuration → Sales → Payment Methods → Check / Money Order - Set
Enabled = Yes
- Go to:
📃 Customer Attribute
- Code:
allow_checkmo - Type: Boolean (Yes / No)
- Form:
adminhtml_customeronly - Default value: No
💳 checkmo Payment Visibility Logic
| Condition | checkmo available? |
|---|---|
| checkmo disabled in configuration | ❌ |
| Customer not logged in | ❌ |
| Customer attribute not enabled | ❌ |
| Customer attribute enabled + checkmo on | ✅ |
📊 Dependencies
This module depends on the following Magento components:
Magento_CustomerMagento_EavMagento_PaymentMagento_QuoteMagento_Ui
📄 License
MIT
📧 Support
Developer: unicorn.ares