private function compareStatus($order, $payment)
    {
        if (! (in_array($order->getStatus(), [
                $this->getStatusFromPaymentKey(1),
                $this->getStatusFromPaymentKey(2)
            ]) || in_array($payment->getStatus(), [1, 2]))) {
            return false;
        }
        return true;
    }
private function compareStatus($order, $payment)
    {
        if (! (in_array($order->getStatus(), [
                $this->getStatusFromPaymentKey(1),
                $this->getStatusFromPaymentKey(2)
            ]) || in_array($payment->getStatus(), [1, 2]))) {
            return false;
        }
        return true;
    }
private function compareStatus ( $ order , $ payment ) { if ( ! ( in_array ( $ order -> getStatus ( ) , [ $ this -> getStatusFromPaymentKey ( 1 ) , $ this -> getStatusFromPaymentKey ( 2 ) ] ) || in_array ( $ payment -> getStatus ( ) , [ 1 , 2 ] ) ) ) { return false ; } return true ; }
Compare between magento status and PagSeguro transaction status

@param $order
@param $payment
@return bool
Compare between magento status and PagSeguro transaction status