Address PaymentGatewayBase Constructor Depreciation

Created on 8 July 2022, over 3 years ago
Updated 18 August 2025, about 2 months ago

Problem/Motivation

Unit tests yield the following deprecation warning:

Calling PaymentGatewayBase::__construct() with the $minor_units_converter argument is supported in commerce:2.25 and will be required before commerce:3.0. See https://www.drupal.org/project/commerce/issues/3150917 → .

Steps to reproduce

Run phpunit tests on Commerce Moneris using Lando's Drupal Contributions environment.

Proposed resolution

Update the code accordingly.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Moneris API: Code

Created by

🇨🇦Canada rbrownell Gatineau, Québec, Canada

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇷🇸Serbia lebster

    After moving to Commerce 3.x:

    ArgumentCountError: Too few arguments to function Drupal\commerce_moneris\Plugin\Commerce\PaymentGateway\Onsite::__construct(), 3 passed in /var/www/drupal/web/modules/contrib/commerce/modules/payment/src/Plugin/Commerce/PaymentGateway/PaymentGatewayBase.php on line 82 and exactly 7 expected in Drupal\commerce_moneris\Plugin\Commerce\PaymentGateway\Onsite->__construct() (line 49 of /var/www/drupal/web/modules/contrib/commerce_moneris/src/Plugin/Commerce/PaymentGateway/Onsite.php).
    

    I have attached a patch that probably could be used a temporary fix.

Production build 0.71.5 2024