Problem/Motivation

Commerce 3.x has been released, i believe it's time to add support for it.

CommentFileSizeAuthor
#2 3506141-2.patch2.13 KBgidarai
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gidarai created an issue. See original summary.

gidarai’s picture

Status: Needs work » Needs review
StatusFileSize
new2.13 KB

Added patch. Tested and works for commerce 3.x!

gidarai’s picture

Important note: this drops support for Commerce 2.x so maybe committing this as a 2.x release is a better idea.

immoreel’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

immoreel’s picture

I've created a v2.0.0-beta1 which incorporates the changes noted above, it also has the fixes noted below.

## [2.0.0-beta1] - 2026-05-29

This is a major release that targets Drupal Commerce 3.x. It is **not**
backwards compatible with Commerce 2.x.

### Added
- Dependency injection for the payment gateway plugin and the offsite
redirect form (`http_client`, `logger.channel.cm_commerce`, entity type
manager), replacing all static `\Drupal::` service calls.
- A `logger.channel.cm_commerce` logger channel (`cm_commerce.services.yml`).

### Changed
- **Support Drupal Commerce 3.x** (`drupal/commerce: ^3`); the gateway plugin
constructor was updated for the Commerce 3.x property-injection pattern.
- Raised the core requirement to Drupal 10.3 or 11
(`core_version_requirement: ^10.3 || ^11`).
- The CM order amount is now calculated as a typed integer (minor units)
instead of relying on string/integer coercion.
- The offsite form now resolves the billing profile via
`OrderInterface::getBillingProfile()`.

### Removed
- **Dropped support for Drupal Commerce 2.x.**
- Removed the unused/broken `getActiveEndpointUrl()` method.

### Fixed
- Caught `GuzzleException` is now imported, so request failures in `onReturn()`
and `onNotify()` no longer cause a fatal error.
- Failed CM API calls (`pushShopper()` / `pushOrder()`) now throw a
`PaymentGatewayException` instead of returning `NULL`, preventing a fatal
error further down the checkout flow.
- The `$configuration` variable is resolved correctly inside `pushOrder()` and
`pushShopper()`.
- `processFeedback()` guards against a missing order and only writes the
optional `field_cm_order_id` / `field_cm_payment_id` fields when they exist.
- The config schema key now matches the plugin id (`cm`) and includes all
stored settings.

### Security
- The gateway configuration (including credentials) is no longer written to the
log on notifications.
- The billing address (personal data) is only logged when debugging is enabled.

[2.0.0-beta1]: https://www.drupal.org/project/cm_commerce/releases/2.0.0-beta1

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.