Skip to content

Commit

Permalink
Fix type error in payment void method
Browse files Browse the repository at this point in the history
  • Loading branch information
xpoback authored and gelanivishal committed Jul 13, 2018
1 parent 1de3379 commit 25a71d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/code/Magento/Authorizenet/Model/Directpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,11 +820,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 25a71d5

Please sign in to comment.