Skip to content
Snippets Groups Projects
Commit ab883508 authored by Noah Siegrist's avatar Noah Siegrist Committed by András Czövek
Browse files

Automated Project Update Bot fixes from run 11-137198.

parent a489c330
No related branches found
No related tags found
1 merge request!8Automated Project Update Bot fixes from run 11-137198.
......@@ -2,6 +2,6 @@ name: Commerce Datatrans
type: module
description: 'Provides payment gateway for Datatrans.'
package: Commerce
core_version_requirement: ^8.7.7 || ^9 || ^10
core_version_requirement: ^10.1 || ^11
dependencies:
- commerce:commerce_payment
......@@ -7,7 +7,9 @@ use Drupal\commerce_payment\Exception\PaymentGatewayException;
use Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\OffsitePaymentGatewayInterface;
use Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\SupportsRefundsInterface;
use Drupal\Component\Serialization\Json;
use Drupal\Core\Logger\LoggerChannelTrait;
use Drupal\Core\Url;
use Drupal\Core\Utility\Error;
use Symfony\Component\HttpFoundation\Request;
/**
......@@ -31,11 +33,13 @@ use Symfony\Component\HttpFoundation\Request;
*/
class Datatrans extends DatatransBase implements SupportsRefundsInterface, OffsitePaymentGatewayInterface {
use LoggerChannelTrait;
/**
* {@inheritdoc}
*/
public function onReturn(OrderInterface $order, Request $request) {
$transaction_id = $request->query->get('datatransTrxId');
$transaction_id = $request->query->get('datatransTrxId');
// Check if a payment already exists to avoid an extra API request, then
// the webhook successfully processed this already.
......@@ -56,7 +60,7 @@ class Datatrans extends DatatransBase implements SupportsRefundsInterface, Offsi
throw $e;
}
catch (\Exception $e) {
\watchdog_exception('commerce_datatrans', $e);
Error::logException($this->getLogger('commerce_datatrans'), $e);
throw new PaymentGatewayException($this->t('There was a problem while processing your payment.'));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment