From 59dcc6d9c5cfc296fedb74df05787b6bd5979d26 Mon Sep 17 00:00:00 2001 From: berdir <berdir@214652.no-reply.drupal.org> Date: Tue, 3 Nov 2020 11:09:47 +0100 Subject: [PATCH] Issue #3146782 by Project Update Bot, Berdir: Automated Drupal 9 compatibility fixes --- commerce_datatrans.info.yml | 2 +- src/Plugin/Commerce/PaymentGateway/Datatrans.php | 2 +- src/Plugin/Commerce/PaymentMethodType/DatatransAlias.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commerce_datatrans.info.yml b/commerce_datatrans.info.yml index a5f4266..d400469 100644 --- a/commerce_datatrans.info.yml +++ b/commerce_datatrans.info.yml @@ -2,6 +2,6 @@ name: Commerce Datatrans type: module description: 'Provides payment gateway for Datatrans.' package: Commerce -core: 8.x +core_version_requirement: ^8.7.7 || ^9 dependencies: - commerce:commerce_payment diff --git a/src/Plugin/Commerce/PaymentGateway/Datatrans.php b/src/Plugin/Commerce/PaymentGateway/Datatrans.php index e871560..cccc32e 100644 --- a/src/Plugin/Commerce/PaymentGateway/Datatrans.php +++ b/src/Plugin/Commerce/PaymentGateway/Datatrans.php @@ -241,7 +241,7 @@ class Datatrans extends OffsitePaymentGatewayBase { $post_data = $request->request->all(); if (!$this->validateResponseData($post_data, $order)) { - drupal_set_message($this->t('There was a problem while processing your payment.'), 'warning'); + $this->messenger()->addWarning($this->t('There was a problem while processing your payment.')); throw new PaymentGatewayException(); } diff --git a/src/Plugin/Commerce/PaymentMethodType/DatatransAlias.php b/src/Plugin/Commerce/PaymentMethodType/DatatransAlias.php index 2d4d921..08f1a11 100644 --- a/src/Plugin/Commerce/PaymentMethodType/DatatransAlias.php +++ b/src/Plugin/Commerce/PaymentMethodType/DatatransAlias.php @@ -2,7 +2,7 @@ namespace Drupal\commerce_datatrans\Plugin\Commerce\PaymentMethodType; -use Drupal\commerce\BundleFieldDefinition; +use Drupal\entity\BundleFieldDefinition; use Drupal\commerce_payment\Entity\PaymentMethodInterface; use Drupal\commerce_payment\Plugin\Commerce\PaymentMethodType\PaymentMethodTypeBase; -- GitLab