diff --git a/composer.json b/composer.json index cf47389f3e16cd7fc18ab6e285f90f26bc1dd8cf..526e5fd2ba810d8717ce102f8d5acc18441f282d 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,6 @@ "source": "http://cgit.drupalcode.org/commerce_datatrans" }, "require": { - "drupal/commerce": "2.*" + "drupal/commerce": "^2.25 || ^3" } } diff --git a/src/Plugin/Commerce/PaymentGateway/DatatransBase.php b/src/Plugin/Commerce/PaymentGateway/DatatransBase.php index a1b78a2ad2c39a5cafa90627a0a3d09f9b3b1cab..6f12db14fc9ec358eeb961d62cd99710aab2e5f4 100644 --- a/src/Plugin/Commerce/PaymentGateway/DatatransBase.php +++ b/src/Plugin/Commerce/PaymentGateway/DatatransBase.php @@ -288,7 +288,7 @@ class DatatransBase extends PaymentGatewayBase implements SupportsRefundsInterfa $this->assertRefundAmount($payment, $amount); $data = [ - 'amount' => $this->toMinorUnits($amount), + 'amount' => $this->minorUnitsConverter->toMinorUnits($amount), 'currency' => $amount->getCurrencyCode(), 'refno' => $payment->getOrderId(), ]; @@ -348,7 +348,7 @@ class DatatransBase extends PaymentGatewayBase implements SupportsRefundsInterfa $order = $payment->getOrder(); // Calculate the amount in the form Datatrans expects it. - $amount = $this->toMinorUnits($payment->getAmount()); + $amount = $this->minorUnitsConverter->toMinorUnits($payment->getAmount()); $data = NestedArray::mergeDeep($data, [ 'currency' => $payment->getAmount()->getCurrencyCode(), @@ -416,7 +416,7 @@ class DatatransBase extends PaymentGatewayBase implements SupportsRefundsInterfa $order = $payment->getOrder(); // Calculate the amount in the form Datatrans expects it. - $amount = $this->toMinorUnits($payment->getAmount()); + $amount = $this->minorUnitsConverter->toMinorUnits($payment->getAmount()); $data = NestedArray::mergeDeep($data, [ 'currency' => $payment->getAmount()->getCurrencyCode(),