@param \SprykerEco\Shared\Payone\Dependency\TransactionStatusUpdateInterface $request

@return bool|\SprykerEco\Zed\Payone\Business\Api\TransactionStatus\TransactionStatusResponse
761931
protected function validate(TransactionStatusUpdateInterface $request)
    {
        $systemHashedKey = $this->hashGenerator->hash($this->standardParameter->getKey());
        if ($request->getKey() !== $systemHashedKey) {
            return $this->createErrorResponse('Payone transaction status update: Given and internal key do not match!');
        }

        if ((int)$request->getAid() !== (int)$this->standardParameter->getAid()) {
            return $this->createErrorResponse('Payone transaction status update: Invalid Aid! System: ' . $this->standardParameter->getAid() . ' Request: ' . $request->getAid());
        }

        if ((int)$request->getPortalid() !== (int)$this->standardParameter->getPortalId()) {
            return $this->createErrorResponse('Payone transaction status update: Invalid Portalid! System: ' . $this->standardParameter->getPortalId() . ' Request: ' . $request->getPortalid());
        }

        return true;
    }
1174050
public function updateReports(ServerRequestInterface $request): ResponseInterface
    {
        $modules = $this->module_service->findByInterface(ModuleReportInterface::class, true);

        $this->updateStatus($modules, $request);
        $this->updateAccessLevel($modules, ModuleReportInterface::class, $request);

        return redirect(route('reports'));
    }
818094
public function hasValidData(\Psr\Http\Message\ServerRequestInterface $request, $key = null)
    {
        if (! in_array($request->getMethod(), ['POST', 'PATCH', 'PUT', 'DELETE'])) {
            return false;
        }
        if (! $this->check($request)) {
            return false;
        }
        $data = $request->getParsedBody();
        return ! isset($key) or isset($data[$key]);
    }
350326
public function transactionsAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();

        $changeLogFilter = $this->createForm(StockChangeLogFilterType::class, null, array(
            'action' => $this->generateUrl('admin_warehouse_transactions'),
            'method' => 'GET',
        ));

        $changeLogFilter->handleRequest($request);

        $filter = array();
        $filter['product'] = $changeLogFilter->get('product')->getData();
        $filter['warehouse'] = $changeLogFilter->get('warehouse')->getData();

        $qb = $em->getRepository(StockChangeLog::class)->findAllFilteredQB($filter);
        $qb->addOrderBy('scl.id', "DESC");

        $paginator = $this->get('knp_paginator')->paginate($qb, $request->query->get('page', 1), 20);
        return array(
            'form_filter' => $changeLogFilter->createView(),
            'paginator' => $paginator,
        );
    }
587787
protected function checkTransactionStatus($status)
    {
        if ($this->transactionInfo instanceof TransactionResponse) {
            $match = (int) $this->transactionInfo->getTransactionResponseField('ResponseCode') === (int) $status;
        } else {
            $match = (int) $this->transactionResponse->responseCode === $status;
        }
        return $match;
    }
461109
public function execute(RequestInterface $request): RequestInterface
    {
        if ($request->getUri()->getPath() === self::ENDPOINT_INSTALLATION) {
            return $request;
        } else {
            $signature = $this->determineRequestSignature(
                $request->getUri(),
                $request->getMethod(),
                $request->getBody()->getContents(),
                $request->getHeaders()
            );

            return $request->withHeader(self::HEADER_CLIENT_SIGNATURE, $signature);
        }
    }
689366
public function refundTransaction($request)
    {
        $caller = $this->getCaller();
        $caller->setRequest($request);

        $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoRefund::class);
        $response->setData($caller->call('RefundTransaction'));

        return $response;
    }
371685
public function onRequest( RequestInterface $request ) {
        $schema = $this->getEndpoint()->getSchema();

        return $request->withHeader( 'X-Schema-Version', $schema );
    }
961895
public function updateFooters(ServerRequestInterface $request): ResponseInterface
    {
        $modules = $this->module_service->findByInterface(ModuleFooterInterface::class, true);

        $this->updateStatus($modules, $request);
        $this->updateOrder($modules, 'footer_order', $request);

        return redirect(route('footers'));
    }
693518
private function doSendRequest(RequestInterface $request)
    {
        try {
            $response = $this->getHttpClient()->sendRequest($request);
        } catch (HttpTransferException $e) {
            throw new TransferException(
                $e->getMessage(),
                $request,
                $e instanceof HttpException ? $e->getResponse() : null
            );
        }

        if ($response->getStatusCode() >= 400) {
            throw new InvalidResponseException('Bad response status code.', $request, $response);
        }

        $rawData = (string) $response->getBody();

        if (empty($rawData)) {
            return null;
        }

        $data = json_decode($rawData, true);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new InvalidResponseException('Could not decode the response.', $request, $response);
        }

        return $data;
    }
269553
private function resolvePaymentsState(OrderInterface $order)
    {
        $capturedTotal = $authorizedTotal = $refundTotal = $failedTotal = 0;

        $payments = $order->getPayments();
        if (0 < $payments->count()) {
            // Gather state amounts
            foreach ($payments as $payment) {
                if ($payment->getState() == PaymentStates::STATE_CAPTURED) {
                    $capturedTotal += $payment->getAmount();
                } else if ($payment->getState() == PaymentStates::STATE_AUTHORIZED) {
                    $authorizedTotal += $payment->getAmount();
                } else if ($payment->getState() == PaymentStates::STATE_REFUNDED) {
                    $refundTotal += $payment->getAmount();
                } else if ($payment->getState() == PaymentStates::STATE_FAILED) {
                    $failedTotal += $payment->getAmount();
                }
            }

            // State by amounts
            if ($capturedTotal >= $order->getAtiTotal()) {
                return PaymentStates::STATE_CAPTURED;
            } elseif ($authorizedTotal + $capturedTotal >= $order->getAtiTotal()) {
                return PaymentStates::STATE_AUTHORIZED;
            } elseif ($refundTotal >= $order->getAtiTotal()) {
                return PaymentStates::STATE_REFUNDED;
            } elseif ($failedTotal >= $order->getAtiTotal()) {
                return PaymentStates::STATE_FAILED;
            }

            // Check for offline pending payment
            foreach ($payments as $payment) {
                if (in_array($payment->getState(), [PaymentStates::STATE_PENDING, PaymentStates::STATE_PENDING])
                    && $payment->getMethod()->getFactoryName() === 'offline') {
                    return PaymentStates::STATE_PENDING;
                }
            }
        }

        return PaymentStates::STATE_NEW;
    }
833887
protected function persistRequest(TransactionStatusUpdateInterface $request)
    {
        $entity = new SpyPaymentPayoneTransactionStatusLog();

        $entity->setSpyPaymentPayone($this->findPaymentByTransactionId($request->getTxid()));
        $entity->setTransactionId($request->getTxid());
        $entity->setReferenceId($request->getReference());
        $entity->setMode($request->getMode());
        $entity->setStatus($request->getTxaction());
        $entity->setTransactionTime($request->getTxtime());
        $entity->setSequenceNumber($request->getSequencenumber());
        $entity->setClearingType($request->getClearingtype());
        $entity->setPortalId($request->getPortalid());
        $entity->setPrice($request->getPrice());
        $entity->setBalance($request->getBalance());
        $entity->setReceivable($request->getReceivable());
        $entity->setReminderLevel($request->getReminderlevel());

        $entity->setRawRequest($request);

        $entity->save();
    }
244956
public function statusUpdateAction(Request $request)
    {
        //Payone always sends status updates in ISO-8859-1. We transform them to utf8.
        $requestParameters = $request->request->all();

        $map = [
            // TransferObject (internal) => POST request (external)
            'key' => 'key',
            'aid' => 'aid',
            'mode' => 'mode',
            'customerid' => null,
            'portalid' => 'portalid',
            'sequencenumber' => 'sequencenumber',
            'txaction' => 'txaction',
            'receivable' => 'receivable',
            'price' => 'price',
            'balance' => 'balance',
            'currency' => 'currency',
            'txid' => 'txid',
            'userid' => 'userid',
            'txtime' => 'txtime',
            'clearingtype' => 'clearingtype',
            'reference' => 'reference',
            'reminderlevel' => 'reminderlevel',
        ];

        $dataArray = [];
        foreach ($map as $transferObjectKey => $postDataKey) {
            if (!isset($requestParameters[$postDataKey])) {
                continue;
            }
            $dataArray[$transferObjectKey] = utf8_encode($requestParameters[$postDataKey]);
        }

        $payoneTransactionStatusUpdateTransfer = new PayoneTransactionStatusUpdateTransfer();
        $payoneTransactionStatusUpdateTransfer->fromArray($dataArray);

        $payoneTransactionStatusUpdateTransfer = $this->getFacade()->processTransactionStatusUpdate($payoneTransactionStatusUpdateTransfer);

        $this->triggerEventsOnSuccess($payoneTransactionStatusUpdateTransfer);

        $callback = function () use ($payoneTransactionStatusUpdateTransfer) {
            echo $payoneTransactionStatusUpdateTransfer->getResponse();
        };

        return $this->streamedResponse($callback);
    }
831819
public function update(OrderStatus $orderstatus, UpdateOrderStatusRequest $request)
    {
        $this->orderstatus->update($orderstatus, $request->all());

        return redirect()->route('admin.order.orderstatus.index')
            ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('order::orderstatuses.title.orderstatuses')]));
    }
1312072
public function postAction( ServerRequestInterface $request )
	{
		if( config( 'shop.authorize', true ) ) {
			$this->authorize( 'admin', [JsonadmController::class, ['admin', 'api']] );
		}

		return $this->createAdmin()->post( $request, new Response() );
	}
853992
protected function reviveRequest(ServerRequestInterface $request)
    {
        $isStale = interface_exists('Jasny\HttpMessage\GlobalEnvironmentInterface') &&
            $request instanceof GlobalEnvironmentInterface &&
            $request->isStale();
        
        return $isStale ? $request->revive() : $request;
    }
681579
function ManagePendingTransactionStatus($txnID, $action) {
    if (!in_array($action, array('Accept', 'Deny'))) return FALSE;
    $values['TRANSACTIONID'] = $txnID;
    $values['ACTION'] = $action;
    return $this->_request($values, 'ManagePendingTransactionStatus');
  }