@@ -119,6 +119,11 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet implements Tra
119
119
*/
120
120
protected $ transactionRepository ;
121
121
122
+ /**
123
+ * @var \Psr\Log\LoggerInterface
124
+ */
125
+ private $ psrLogger ;
126
+
122
127
/**
123
128
* @param \Magento\Framework\Model\Context $context
124
129
* @param \Magento\Framework\Registry $registry
@@ -761,7 +766,7 @@ protected function addStatusComment(\Magento\Sales\Model\Order\Payment $payment)
761
766
{
762
767
try {
763
768
$ transactionId = $ this ->getResponse ()->getXTransId ();
764
- $ data = $ payment -> getMethodInstance () ->getTransactionDetails ($ transactionId );
769
+ $ data = $ this -> transactionService ->getTransactionDetails ($ this , $ transactionId );
765
770
$ transactionStatus = (string )$ data ->transaction ->transactionStatus ;
766
771
$ fdsFilterAction = (string )$ data ->transaction ->FDSFilterAction ;
767
772
@@ -779,6 +784,7 @@ protected function addStatusComment(\Magento\Sales\Model\Order\Payment $payment)
779
784
$ payment ->getOrder ()->addStatusHistoryComment ($ message );
780
785
}
781
786
} catch (\Exception $ e ) {
787
+ $ this ->getPsrLogger ()->critical ($ e );
782
788
//this request is optional
783
789
}
784
790
return $ this ;
@@ -805,7 +811,7 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = ''
805
811
$ order ->registerCancellation ($ message )->save ();
806
812
} catch (\Exception $ e ) {
807
813
//quiet decline
808
- $ this ->logger ->critical ($ e );
814
+ $ this ->getPsrLogger () ->critical ($ e );
809
815
}
810
816
}
811
817
@@ -973,4 +979,18 @@ protected function getTransactionResponse($transactionId)
973
979
974
980
return $ response ;
975
981
}
982
+
983
+ /**
984
+ * @return \Psr\Log\LoggerInterface
985
+ *
986
+ * @deprecated
987
+ */
988
+ private function getPsrLogger ()
989
+ {
990
+ if (null === $ this ->psrLogger ) {
991
+ $ this ->psrLogger = \Magento \Framework \App \ObjectManager::getInstance ()
992
+ ->get (\Psr \Log \LoggerInterface::class);
993
+ }
994
+ return $ this ->psrLogger ;
995
+ }
976
996
}
0 commit comments