Problem/Motivation
Commerce 3.x has been released, i believe it's time to add support for it.
| Comment | File | Size | Author |
|---|
Issue fork cm_commerce-3506141
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
Comment #2
gidarai commentedAdded patch. Tested and works for commerce 3.x!
Comment #3
gidarai commentedImportant note: this drops support for Commerce 2.x so maybe committing this as a 2.x release is a better idea.
Comment #4
immoreel commentedComment #6
immoreel commentedI'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