Skip to content
Snippets Groups Projects

Use minor usints converter service instead of toMinorUnits function.

Files
2
@@ -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(),
Loading