2017-01-02
@override
@see \Df\Payment\W\Event::statusT()
@used-by \Df\Payment\W\Handler::log()
@used-by \Df\Payment\W\Strategy\ConfirmPending::_handle()
@return string|null
968964
final function statusT() {return ($k = $this->k_statusT()) ? $this->r($k) : dftr(
		$this->status(), df_module_json($this, 'statuses', false)
	);}
733417
public function getHaving()
    {
        if (!isset($this->setHaving) or empty($this->setHaving)) {
            $this->setHaving = null;
        }

        return $this->setHaving;
    }
808286
public function getStatus() {
		if (isset($_SESSION) && isset($_SESSION[self::SESSION_FIELD_STATUS])) {
			return $_SESSION[self::SESSION_FIELD_STATUS];
		}
		else {
			return null;
		}
	}
694394
function statusName()
    {
        if ( $this->Status === null )
        {
            $this->Status = eZOrderStatus::fetchByStatus( $this->StatusID );
        }
        return $this->Status->attribute( 'name' );
    }
958185
public function getStatusString()
    {
        if (array_key_exists($this->status, TicketMessageInterface::STATUSES)) {
            return TicketMessageInterface::STATUSES[$this->status];
        }

        return TicketMessageInterface::STATUSES[0];
    }
629157
public function getTransactionString()
    {
        return sprintf(
                "Paymentmethod: %s \n| OrderID: %s \n| Status: %s \n| StatusCode: %s \n| PaymentID: %s \n| TransactionID: %s \n| Amount: %s", isset($this->data->paymentMethod) ? $this->data->paymentMethod : "", isset($this->data->orderID) ? $this->data->orderID : "", isset($this->data->status) ? $this->data->status : "", isset($this->data->statusCode) ? $this->data->statusCode : "", isset($this->data->paymentID) ? $this->data->paymentID : "", isset($this->data->transactionID) ? $this->data->transactionID : "", isset($this->data->amount) ? $this->data->amount : ""
        );
    }
340774
public function PostProcessExternalPaymentHandlerHook()
    {
        $bPaymentTransmitOk = parent::PostProcessExternalPaymentHandlerHook();
        if ($bPaymentTransmitOk) {
            $oGlobal = TGlobal::instance();
            $sStatus = $oGlobal->GetUserData('ret_status');
            if ('ERROR' == $sStatus) {
                $this->SetErrorCodesFromResponseToMessageManager();
                $bPaymentTransmitOk = false;
            }
            $this->sStorageId = $oGlobal->GetUserData('storage_id');
            $this->aPaymentUserData = $oGlobal->GetUserData();
            // the data from ipayment is not returned as iso-8859
            foreach (array_keys($this->aPaymentUserData) as $sKey) {
                if (!is_array($this->aPaymentUserData[$sKey])) {
                    $this->aPaymentUserData[$sKey] = utf8_encode($this->aPaymentUserData[$sKey]);
                }
            }
            $this->aPaymentUserData['sStorageId'] = $this->sStorageId;
        }

        if (true === $bPaymentTransmitOk) {
            $aSecuritiyCheckPostParameter = $this->GetNeedeResponsePostParameterForSecurityCheck();
            $bPaymentTransmitOk = $this->IsSecurityCheckOk($aSecuritiyCheckPostParameter['trxuser_id'], $aSecuritiyCheckPostParameter['trx_amount'], $aSecuritiyCheckPostParameter['trx_currency'], $aSecuritiyCheckPostParameter['ret_authcode'], $aSecuritiyCheckPostParameter['ret_trx_number'], $aSecuritiyCheckPostParameter['ret_param_checksum']);
            if (false === $bPaymentTransmitOk) {
                // security error - unable to validate hash
                TTools::WriteLogEntry('iPayment Error: unable to validate security hash. Either the Request is manipulated, or the "Transaktions-Security-Key" was not set in the ipayment configuration', 1, __FILE__, __LINE__);
                $oMsgManager = TCMSMessageManager::GetInstance();
                $oMsgManager->AddMessage(TShopPaymentHandlerIPaymentCreditCard::MSG_MANAGER_NAME, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => 'unable to validate security hash. Either the Request is manipulated, or the "Transaktions-Security-Key" was not set in the ipayment configuration'));
            }
        }

        return $bPaymentTransmitOk;
    }
682646
public function getOrderPaymentStatusCalculator()
    {
        /** @var \OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator $statusCalculator */
        $statusCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator::class);
        $statusCalculator->setOrder($this->getEditObject()->getPayPalOrder());

        return $statusCalculator;
    }
26428
function approvePayment( $continueWorkflow=true )
    {
        if( $this->paymentObject )
        {
            $this->paymentObject->approve();
            $this->paymentObject->store();

            $this->logger->writeTimedString( 'payment was approved' );

            return ( $continueWorkflow ? $this->continueWorkflow() : null );
        }

        $this->logger->writeTimedString( "payment object is not set", 'approvePayment failed' );
        return null;
    }
819563
public function getStatus()
    {
        $status = null;

        if($entity = $this->getIterator()->current()) {
            $status = $entity->getStatus();
        }

        return $status;
    }
59998
public function PostProcessExternalPaymentHandlerHook()
    {
        $bPaymentTransmitOk = parent::PostProcessExternalPaymentHandlerHook();
        if ($bPaymentTransmitOk) {
            $oURLData = &TCMSSmartURLData::GetActive();
            // If 3D-Secure Authentification fails, the ECI value is empty
            if (!empty($oURLData->aParameters['eci']) && !empty($oURLData->aParameters['xid'])) {
                $_SESSION['3ds_payment']['eci'] = $oURLData->aParameters['eci'];
                $_SESSION['3ds_payment']['xid'] = $oURLData->aParameters['xid'];
                $_SESSION['3ds_payment']['cavv'] = $oURLData->aParameters['cavv'];
                $bPaymentTransmitOk = true;
            } else {
                $oMsgManager = TCMSMessageManager::GetInstance();
                $oMsgManager->AddMessage(self::MSG_MANAGER_NAME, 'ERROR-ORDER-RESPONSE-PAYMENTONE-ERROR', array('errorMsg' => TGlobal::Translate('chameleon_system_shop.payment_payone.error_user_abort')));
                $bPaymentTransmitOk = false;
            }
        }

        return $bPaymentTransmitOk;
    }
476019
public function isOnReturn()
	{
		if ($this->idLastReturn != null) {
			$currentStatusReturn = $this->PayReturn()->find($this->idLastReturn)->status;

			return $currentStatusReturn == 'onReturn';
		}

		return false;
	}
295674
public function status()
	{
		if ($this->status === null) {
			$stdClass = $this->decoded();
			if ( ! $stdClass instanceof stdClass)
				return null;

			$this->status = $this->resolveStatusFromStdClass($stdClass);
		}

		return $this->status;
	}
695640
public function getMessage()
    {
        $message = null;

        if (isset($this->data->transactionResponse->messages)) {
            // In case of a successful transaction, a "messages" element is present
            $message = (string)$this->data->transactionResponse->messages->message->description;
        } elseif (isset($this->data->transactionResponse->errors)) {
            // In case of an unsuccessful transaction, an "errors" element is present
            $message = (string)$this->data->transactionResponse->errors->error->errorText;
        } elseif (isset($this->data->messages->message)) {
            // In case of invalid request, the top-level message provides details.
            $message = (string)$this->data->messages->message->text;
        }

        return $message;
    }
223554
public function getOrderPaymentStatusCalculator()
    {
        if (is_null($this->orderPaymentStatusCalculator)) {
            $orderPaymentStatusCalculator = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentStatusCalculator::class);
            $this->setOrderPaymentStatusCalculator($orderPaymentStatusCalculator);
        }

        return $this->orderPaymentStatusCalculator;
    }
413377
protected function validateStatusOrder()
    {
        $field = 'status';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $statuses = $this->order->getStatuses();

        if (empty($statuses[$value])) {
            $this->setErrorUnavailable($field, $this->translation->text('Status'));
            return false;
        }

        return true;
    }
1283108
public function getOutcome()
    {
        if (isset($this->data['object']) && 'charge' === $this->data['object']) {
            if (isset($this->data['outcome']) && !empty($this->data['outcome'])) {
                return $this->data['outcome'];
            }
        }

        return null;
    }