Admin Payment

Description

This module adds an offline payment method named adminpayment, intended for use only in the Magento Admin Panel. The method is registered as a standard Magento payment method and includes its own checkout renderer, but its availability is restricted to the adminhtml area via the payment_method_is_active event observer.

Who it’s for

For operations and customer support teams that create orders from the Admin Panel and need a dedicated payment method that is not available to customers on the storefront.

Features

  • Registers the adminpayment payment method as offline (_isOffline = true) with the default order status set to pending and the title AdminPayment.
  • Restricts adminpayment availability to the adminhtml area via the payment_method_is_active observer.
  • Provides a checkout renderer and payment template for adminpayment on the frontend (JS + template), even though the method is disabled there by default.
  • Supports configuration options: enable/disable, title, new order status, sort order, instructions, allowed countries restriction.

Installation

Type: Composer
* = in production use the --keep-generated option

  1. Add the repository to your configuration:
    composer config repositories.module.admin.payment vcs https://github.com/kowalco/magento-2-admin-payment
  2. Add an access token for private GitHub:
    composer config --global --auth github-oauth.github.com <YOUR_TOKEN>
  3. Install the module via Composer:
    composer require kowal/module-adminpayment
  4. Enable the module:
    php bin/magento module:enable Kowal_AdminPayment
  5. Apply database updates:
    php bin/magento setup:upgrade
  6. Flush cache:
    php bin/magento cache:flush

Configuration

  • Admin path: Stores > Configuration > Sales > Payment Methods > AdminPayment.
  • Configuration scopes: default, website, store view (all fields have showInDefault/Website/Store = 1).
  • Configuration keys: payment/adminpayment/active, payment/adminpayment/title, payment/adminpayment/order_status, payment/adminpayment/allowspecific, payment/adminpayment/specificcountry, payment/adminpayment/sort_order, payment/adminpayment/instructions.

Deployment and operations

  • No patches, installers, or DB changes in the module (no Setup/* and no patches).
  • Includes frontend assets (JS + template), which require Magento’s standard static content deployment process.
  • No defined cron jobs, queues (queue), or custom indexes.

Deployment checklist

  • Install the module via Composer and enable it according to the README instructions.
  • Run setup:upgrade and cache:flush as described in the README.
  • Verify the payment method configuration in Admin (scopes: default/website/store view).
  • Check that the method is available when creating an order in the Admin Panel.

CI/CD and environments

  • The repository includes a .gitlab-ci.yml with a single test stage and SAST enabled (no additional build/test steps).

Rollback

  • No rollback procedure is described in the repository.

Requirements / notes

  • No dependencies are declared in composer.json and etc/module.xml; the module assumes standard Magento modules used by configuration and checkout are present (including Magento_Payment, Magento_Checkout, Magento_Config, Magento_Sales, Magento_Directory, Magento_Store).
  • No custom acl.xml; configuration is placed in the standard payment section.

Compatibility

  • No Magento/PHP version declarations are present in the repository.

FAQ

  • Is the method available on the storefront? No. The payment_method_is_active observer disables adminpayment outside the adminhtml area.
  • Does the module modify the database? No. No DB patches or installers were found in the repository.
  • Which Magento versions are supported? No information is provided in the code or README.