Skip to content

Commit

Permalink
Merge pull request #44 from gelanivishal/2.3-develop-PR-port-16194
Browse files Browse the repository at this point in the history
[Forwardport] magento#16184: Fix type error in payment void method
  • Loading branch information
gelanivishal authored Jul 6, 2018
2 parents 753af31 + a1f5fa5 commit b96eedd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/code/Magento/Authorizenet/Model/Directpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,14 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = ''
{
try {
$response = $this->getResponse();
if ($voidPayment && $response->getXTransId() && strtoupper($response->getXType())
== self::REQUEST_TYPE_AUTH_ONLY
if ($voidPayment
&& $response->getXTransId()
&& strtoupper($response->getXType()) == self::REQUEST_TYPE_AUTH_ONLY
) {
$order->getPayment()->setTransactionId(null)->setParentTransactionId($response->getXTransId())->void();
$order->getPayment()
->setTransactionId(null)
->setParentTransactionId($response->getXTransId())
->void($response);
}
$order->registerCancellation($message)->save();
} catch (\Exception $e) {
Expand Down

0 comments on commit b96eedd

Please sign in to comment.