@param \Orm\Zed\Payone\Persistence\SpyPaymentPayone $paymentEntity

@return \SprykerEco\Zed\Payone\Business\Api\Request\Container\RefundContainer
485560
public function mapPaymentToRefund(SpyPaymentPayone $paymentEntity)
    {
        $refundContainer = new RefundContainer();

        $refundContainer->setTxid($paymentEntity->getTransactionId());
        $refundContainer->setSequenceNumber($this->getNextSequenceNumber($paymentEntity->getTransactionId()));
        $refundContainer->setCurrency($this->getStandardParameter()->getCurrency());

        $refundContainer->setBankcountry($paymentEntity->getSpyPaymentPayoneDetail()->getBankCountry());
        $refundContainer->setBankaccount($paymentEntity->getSpyPaymentPayoneDetail()->getBankAccount());
        $refundContainer->setBankcode($paymentEntity->getSpyPaymentPayoneDetail()->getBankCode());
        $refundContainer->setBankbranchcode($paymentEntity->getSpyPaymentPayoneDetail()->getBankBranchCode());
        $refundContainer->setBankcheckdigit($paymentEntity->getSpyPaymentPayoneDetail()->getBankCheckDigit());
        $refundContainer->setIban($paymentEntity->getSpyPaymentPayoneDetail()->getIban());
        $refundContainer->setBic($paymentEntity->getSpyPaymentPayoneDetail()->getBic());

        return $refundContainer;
    }
353299
public function deleteAction(Request $request, PaymentServiceProvider $paymentServiceProvider)
    {
        $form = $this->createDeleteForm($paymentServiceProvider);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->remove($paymentServiceProvider);
            $em->flush();
        }

        return $this->redirectToRoute('ecommerce_paymentserviceprovider_index');
    }
508182
public function getBarePaymentHandler($paymentHandlerId, $languageId = null)
    {
        $cacheKey = $paymentHandlerId;
        if (false === isset($this->cache[$cacheKey])) {
            $paymentHandler = $this->subject->getBarePaymentHandler($paymentHandlerId, $languageId);
            if (null === $paymentHandler) {
                return null;
            }
            $this->cache[$cacheKey] = $paymentHandler->sqlData;

            return $paymentHandler;
        }

        return TdbShopPaymentHandler::getInstanceFromDataRow($this->cache[$cacheKey], $languageId);
    }
979698
public function run(array $orderItems, SpySalesOrder $orderEntity, ReadOnlyArrayObject $data)
    {
        $paymentEntity = $orderEntity->getSpyPaymentPayones()->getFirst();
        $this->getFacade()->preAuthorizePayment($paymentEntity->getFkSalesOrder());

        return [];
    }
917689
public function mapPaymentToPreauthorization(SpyPaymentPayone $paymentEntity)
    {
        $preAuthorizationContainer = new PreAuthorizationContainer();
        $preAuthorizationContainer = $this->mapPaymentToAbstractAuthorization($paymentEntity, $preAuthorizationContainer);

        $preAuthorizationContainer->setWorkOrderId($paymentEntity->getSpyPaymentPayoneDetail()->getWorkOrderId());

        return $preAuthorizationContainer;
    }
1039749
public function refundPayment(PayoneRefundTransfer $refundTransfer)
    {
        $payonePaymentTransfer = $refundTransfer->getPayment();

        $paymentEntity = $this->getPaymentEntity($payonePaymentTransfer->getFkSalesOrder());
        $paymentMethodMapper = $this->getPaymentMethodMapper($paymentEntity);
        $requestContainer = $paymentMethodMapper->mapPaymentToRefund($paymentEntity);
        $requestContainer->setAmount(0 - $paymentEntity->getSpyPaymentPayoneDetail()->getAmount());
        $requestContainer = $this->prepareOrderItems($refundTransfer->getOrder(), $requestContainer);
        $requestContainer = $this->prepareOrderShipment($refundTransfer->getOrder(), $requestContainer);
        $requestContainer = $this->prepareOrderDiscount($refundTransfer->getOrder(), $requestContainer);

        $this->setStandardParameter($requestContainer);

        $apiLogEntity = $this->initializeApiLog($paymentEntity, $requestContainer);

        $rawResponse = $this->executionAdapter->sendRequest($requestContainer);
        $responseContainer = new RefundResponseContainer($rawResponse);

        $this->updateApiLogAfterRefund($apiLogEntity, $responseContainer);

        $responseMapper = new RefundResponseMapper();
        $responseTransfer = $responseMapper->getRefundResponseTransfer($responseContainer);

        return $responseTransfer;
    }
279984
public function mapPaymentToAuthorization(SpyPaymentPayone $paymentEntity, OrderTransfer $orderTransfer): AuthorizationContainerInterface
    {
        $authorizationContainer = new AuthorizationContainer();
        $authorizationContainer = $this->mapPaymentToAbstractAuthorization($paymentEntity, $authorizationContainer);
        $authorizationContainer = $this->mapEmail($paymentEntity, $authorizationContainer);
        $authorizationContainer = $this->mapBusinessRelation($authorizationContainer);
        $authorizationContainer->setAmount($orderTransfer->getTotals()->getGrandTotal());

        return $authorizationContainer;
    }
112495
public function getHppPaymentMethodFee($paymentMethod)
    {
        $paymentMethod = str_replace('adyen_hpp_', '', $paymentMethod);

        $paymentFees = $this->getHppPaymentMethodFees();

        if ($paymentFees && is_array($paymentFees) && !empty($paymentFees)) {
            foreach ($paymentFees as $paymentFee) {
                if (isset($paymentFee['code']) && $paymentFee['code'] == $paymentMethod) {
                    if (isset($paymentFee['amount'])) {
                        return $paymentFee['amount'];
                    }
                }
            }
        }

        return null;
    }
75740
public function getRefund($refundId, array $parameters = [])
    {
        return $this->client->paymentRefunds->getFor($this, $refundId, $parameters);
    }
1133647
protected function getPayment(OrderTransfer $orderTransfer)
    {
        $payment = $this->queryContainer->createPaymentByOrderId($orderTransfer->getIdSalesOrder())->findOne();
        $paymentDetail = $payment->getSpyPaymentPayoneDetail();

        $paymentDetailTransfer = new PaymentDetailTransfer();
        $paymentDetailTransfer->fromArray($paymentDetail->toArray(), true);

        $paymentTransfer = new PayonePaymentTransfer();
        $paymentTransfer->fromArray($payment->toArray(), true);
        $paymentTransfer->setPaymentDetail($paymentDetailTransfer);

        return $paymentTransfer;
    }
457814
public function refund($amount, $originalTransactionReference, $clientReference = NULL, $comment = NULL, $description = NULL, $cardHolderName = NULL, $taxAmount = NULL)
	{
		$request = Request::createFromClient($this);

		$request->setTransactionType(Request::TRANSACTION_TYPE_REFUND)
		        ->setTotalAmount($amount)
		        ->setOriginalTransactionReference($originalTransactionReference)
		        ->setClientReference($clientReference)
		        ->setComment($comment)
		        ->setMerchantDescription($description)
		        ->setMerchantCardHolderName($cardHolderName)
		        ->setTaxAmount($taxAmount);

		return $request;
	}
95210
public function get($paymentId)
    {

        $this->debugData[] = __METHOD__;

        $method = 'GET';
        $uri = $this->config['apiQueryUri'] . \sprintf('/sales/%s', $paymentId);
        $options = [
            'headers' => $this->headers
        ];

        $this->debugData[][__LINE__]['method'] = $method;
        $this->debugData[][__LINE__]['uri'] = $uri;
        $this->debugData[][__LINE__]['options'] = $uri;

        try {

            $response = $this->http()->request($method, $uri, $options);

            $this->debugData[][__LINE__]['response'] = $response;

            $result = \json_decode($response->getBody()->getContents(), true);            

            if ($response->getStatusCode() === HttpStatus::Ok) {
                return $result;
            } elseif ($response->getStatusCode() == HttpStatus::BadRequest) {
                return 'status_codex';
            }

        } catch (\Exception $e) {

            $result = array(
                'code'=>$e->getCode(),
                'message'=>$e->getMessage()
                );

            $this->debugData[][__LINE__]['exception'] = $e->getMessage();

        }

        return $result;
    }
168608
public function manageMandate(PayoneManageMandateTransfer $manageMandateTransfer)
    {
        /** @var \SprykerEco\Zed\Payone\Business\Payment\MethodMapper\DirectDebit $paymentMethodMapper */
        $paymentMethodMapper = $this->getRegisteredPaymentMethodMapper(PayoneApiConstants::PAYMENT_METHOD_DIRECT_DEBIT);
        $requestContainer = $paymentMethodMapper->mapManageMandate($manageMandateTransfer);
        $this->setStandardParameter($requestContainer);

        $rawResponse = $this->executionAdapter->sendRequest($requestContainer);
        $responseContainer = new ManageMandateResponseContainer($rawResponse);

        $manageMandateTransfer->setErrorCode($responseContainer->getErrorcode());
        $manageMandateTransfer->setCustomerErrorMessage($responseContainer->getCustomermessage());
        $manageMandateTransfer->setStatus($responseContainer->getStatus());
        $manageMandateTransfer->setInternalErrorMessage($responseContainer->getErrormessage());
        $manageMandateTransfer->setMandateIdentification($responseContainer->getMandateIdentification());
        $manageMandateTransfer->setMandateText($responseContainer->getMandateText());
        $manageMandateTransfer->setIban($responseContainer->getIban());
        $manageMandateTransfer->setBic($responseContainer->getBic());

        return $manageMandateTransfer;
    }
1148537
public function getInvoice(PayoneGetInvoiceTransfer $getInvoiceTransfer)
    {
        $responseContainer = new GetInvoiceResponseContainer();
        $paymentEntity = $this->findPaymentByInvoiceTitleAndCustomerId(
            $getInvoiceTransfer->getReference(),
            $getInvoiceTransfer->getCustomerId()
        );

        if ($paymentEntity) {
            /** @var \SprykerEco\Zed\Payone\Business\Payment\MethodMapper\Invoice $paymentMethodMapper */
            $paymentMethodMapper = $this->getRegisteredPaymentMethodMapper(PayoneApiConstants::PAYMENT_METHOD_INVOICE);
            $requestContainer = $paymentMethodMapper->mapGetInvoice($getInvoiceTransfer);
            $this->setStandardParameter($requestContainer);
            $rawResponse = $this->executionAdapter->sendRequest($requestContainer);
            $responseContainer->init($rawResponse);
        } else {
            $this->setAccessDeniedError($responseContainer);
        }

        $getInvoiceTransfer->setRawResponse($responseContainer->getRawResponse());
        $getInvoiceTransfer->setStatus($responseContainer->getStatus());
        $getInvoiceTransfer->setErrorCode($responseContainer->getErrorcode());
        $getInvoiceTransfer->setInternalErrorMessage($responseContainer->getErrormessage());

        return $getInvoiceTransfer;
    }
688609
public function createEntityRequest(
        RequestInterface $request,
        ContainerInterface $container
    ): EntityRequestInterface
    {
        /** @var EntityRequestInterface $er */
        $er = new $this->entityRequest($request);
        $er->setContainer($container);

        return $er;
    }
308230
public function addPaymentTransaction(PaymentTransaction $paymentTransaction)
    {
        if (!$this->hasPaymentTransaction($paymentTransaction))
        {
            $this->paymentTransactions[] = $paymentTransaction;
        }

        if ($paymentTransaction->getPayment() !== $this)
        {
            $paymentTransaction->setPayment($this);
        }

        return $this;
    }
1303970
public function refund($paymentId, Model\Money $amount, $merchantReference = '', $requestId = '')
    {
        $request = [
            'amount' => $amount,
            'merchantReference' => $merchantReference,
            'requestId' => $requestId,
        ];

        try {
            $result = $this->getClient()->post(
                sprintf('payments/%s/refund', $paymentId),
                [
                    'auth' => [
                        $this->getAuthorization()->getMerchantId(),
                        $this->getAuthorization()->getSecret(),
                    ],
                    'headers' => [
                        'Accept' => 'application/json',
                        'Content-Type' => 'application/json',
                    ],
                    'body' => $this->getSerializer()->serialize($request, 'json'),
                ]
            );
        } catch (BadResponseException $e) {
            throw new ApiException(
                $this->getSerializer()->deserialize(
                    (string) $e->getResponse()->getBody(),
                    Model\ErrorResponse::class,
                    'json'
                ),
                $e
            );
        }

        return $this->getSerializer()->deserialize(
            (string) $result->getBody(),
            Model\Merchant\Refund::class,
            'json'
        );
    }