Order preparation successful response handler.

@param array $aResponseData

@return bool
776991
public function handlePrepareOrderResponseOK( $aResponseData )
    {
        oxRegistry::get( 'OxpsPaymorrowLogger' )->logWithType( $aResponseData, 'PM_handlePrepareOrderResponseOK' );
        $this->setResponse( $aResponseData );

        // Trigger user profile update using normalized response data
        oxRegistry::get( 'OxpsPaymorrowModule' )->updateProfile( $aResponseData );

        return true;
    }
408969
private function _processProcessorResponse($response, $expectedType)
    {
        $transactionId = (isset($response->Header->GatewayTxnId) ? $response->Header->GatewayTxnId : null);
        $item = $response->Transaction->$expectedType;

        if ($item != null) {
            $responseCode = (isset($item->RspCode) ? $item->RspCode : null);
            $responseMessage = (isset($item->RspMessage) ? $item->RspMessage : null);

            if ($responseCode == null && isset($item->TransactionStatus->RspCode)) {
                $responseCode = $item->TransactionStatus->RspCode;
            }
            if ($responseMessage == null && isset($item->TransactionStatus->RspText)) {
                $responseMessage = $item->TransactionStatus->RspText;
            }

            HpsProcessorResponseValidation::checkResponse($transactionId, $responseCode, $responseMessage, $item);
        }
    }
743433
protected function isResponseOk()
    {
        $status = $this->rawResponse->status;
        if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
            return true;
        }
        return false;
    }
793255
public function sendData($data)
    {
        $data = parent::sendData($data);

        return $this->response = new AopTradeOrderSettleResponse($this, $data);
    }
994340
public function sendData($data)
    {
        $httpResponse = $this->sendRequest(
            'get',
            '/orders/' . $data['transactionId']
        );

        $this->response = new RestCompletePurchaseResponse(
            $this,
            json_decode($httpResponse->getBody()->getContents(), true)
        );

        return $this->response;
    }
175462
public function respond(ResponseInterface $response)
    {
        if (headers_sent()) {
            throw new HeadersAlreadySentException('Headers were already sent');
        }

        /** @var PsrResponseInterface $r */
        $r = $response;

        $status = sprintf('HTTP/%s %s %s', $r->getProtocolVersion(), $r->getStatusCode(), $r->getReasonPhrase());
        header($status, TRUE);

        foreach ($r->getHeaders() as $name => $values) {
            $header = sprintf('%s: %s', $name, $r->getHeaderLine($name));
            header($header, FALSE);
        }

        echo $r->getBody();
    }
916281
public function prepareForResponse(\n2n\web\http\Response $response) {
		$response->setStatus($this->statusCode);
		foreach ($this->headers as $header) {
			$response->setHeader($header);
		}

		$response->setHttpCacheControl($this->httpCacheControl);

	}
678495
public function response($data, $format, $is_success=true, $status_code = 200)
    {
        $this->httpCode($status_code);
        if ($is_success) {
            $data['status'] = 1;
        } else {
            $data['status'] = 0;
        }
        switch ($format) {
            case self::RESPONSE_TYPE_JSON:
                $response_content = JsonHelper::encode($data);
                break;
            case self::RESPONSE_TYPE_XML:
                header('Content-type:application/xml');
                $response_content = XMLHelper::encode($data);
                break;
            default:
                $response_content = '';
        }
        if (!$is_success) {
            Lb::app()->stop($response_content);
        } else {
            echo $response_content;
        }
    }
799806
public function prepareOrder()
    {
        $this->setPaymorrowPaymentMethodId();

        /** @var OxpsPaymorrowRequestControllerProxy $pmGateWay */
        $pmGateWay = oxNew('OxpsPaymorrowRequestControllerProxy');

        $oUtils = oxRegistry::getUtils();
        $oUtils->setHeader("Content-Type: application/json");
        $oUtils->showMessageAndExit($pmGateWay->prepareOrder($_POST));
    }
157722
protected function handleErrorResponse(string $response)
	{
		$response = substr($response, 1);

		[$type, $error] = explode(' ', $response, 2);

		switch($type)
		{
			case 'MOVED':
			case 'ASK':
				return $this->getClusterClient($error)->sendCommandAndGetResponse($this->lastCommand);
				break;
			default:
				throw new RedisException(vsprintf('%s.', [$response]));
		}
	}
801640
public static function createFromResponse($responseData)
    {
        $message = new self(null, null, null);
        $message->setRawResponseData($responseData)
            ->processResponse();

        if (isset($message['status']) && $message['status'] !== 0 && $message['status'] !== '0') {
            throw new Exception($message['err_msg']);
        }

        return $message;
    }
546556
public function getStatsTextData($aResponses)
    {
        $aOut     = [];
        $aStrings = [];

        foreach ($aResponses as $oResponse) {
            if (!empty($oResponse->text)) {
                if (!array_key_exists($oResponse->text, $aStrings)) {
                    $aStrings[$oResponse->text] = 0;
                }
                $aStrings[$oResponse->text]++;
            }
        }

        foreach ($aStrings as $sString => $iCount) {
            if ($iCount > 1) {
                $sString .= ' <span class="count" title="This item repeats ' . $iCount . ' times">' . $iCount . '</span>';
            }
            $aOut[] = $sString;
        }

        return $aOut;
    }
1338526
public static function isTaken(?array $data = [])
  {
    if (count($data) == 1) {
      foreach($data as $field => $value) {
        return self::where($field, $value)->first() == null ? false: true;
      }
    }

    $response = array();
    foreach($data as $field => $value) {
      $check = self::where($field, $value)->first();

      $response = array_merge($response, array($field => $check == null ? false : true));
    }

    return $response;
  }
155067
public function parseResponse($responseLine, $responseData)
	{
		list($code, $count) = explode(' ', $responseLine);

		return $this->_createResponse($code, array(
			'kicked' => (int)$count,
		));
	}
452400
private function __prepareResponse($exception, $options = [])
    {
        $response = $this->_getController()->response;
        $code = $this->_code($exception);
        $response->getStatusCode($this->_code($exception));

        Configure::write('apiExceptionMessage', $exception->getMessage());

        $responseFormat = $this->_getController()->responseFormat;
        $responseData = [
            $responseFormat['statusKey'] => !empty($options['responseStatus']) ? $options['responseStatus'] : $responseFormat['statusNokText'],
            $responseFormat['resultKey'] => [
                $responseFormat['errorKey'] => ($code < 500) ? 'Not Found' : 'An Internal Error Has Occurred.',
            ],
        ];

        if ((isset($options['customMessage']) && $options['customMessage']) || Configure::read('ApiRequest.debug')) {
            $responseData[$responseFormat['resultKey']][$responseFormat['errorKey']] = $exception->getMessage();
        }

        if ('xml' === Configure::read('ApiRequest.responseType')) {
            $body = $response->getBody();
            $body->write(Xml::fromArray([Configure::read('ApiRequest.xmlResponseRootNode') => $responseData], 'tags')->asXML());
            $response->withBody($body);
        } else {
            $body = $response->getBody();
            $body->write(json_encode($responseData));
            $response->withBody($body);
        }

        $this->controller->response = $response;

        return $response;
    }
773931
protected function processResponse()
    {
        if ($this->response->isSuccessful()) {
            $this->updateOrderStatus();
            $this->addTransaction();
            $this->redirectSuccess();
        } else if ($this->response->isRedirect()) {
            $this->response->redirect();
        } else {
            $this->controller->redirect('', $this->response->getMessage(), 'warning', true);
        }
    }
128111
public function decode($responseData)
    {
        switch ($this->format) {
            case 'json':
                return $this->jsonDecode($responseData);
            case 'xml':
                return $this->xmlDecode($responseData);
            default:
                return false;
        }
    }