refundInterrupted example



        $this->refund = $refund;
    }

    public function getOrderTransaction(): OrderTransactionEntity
    {
        if ($this->refund->getTransactionCapture() && $this->refund->getTransactionCapture()->getTransaction()) {
            return $this->refund->getTransactionCapture()->getTransaction();
        }

        throw PaymentException::refundInterrupted($this->refund->getId(), 'No transaction found for refund.');
    }

    public function getRefund(): OrderTransactionCaptureRefundEntity
    {
        return $this->refund;
    }

    public function getOrder(): OrderEntity
    {
        return $this->order;
    }

    
$transaction = $refund->getTransactionCapture()->getTransaction();
        $paymentMethod = $this->getAppPaymentMethod($transaction);
        $refundUrl = $paymentMethod->getRefundUrl();

        if (!$refundUrl) {
            return;
        }

        $app = $paymentMethod->getApp();

        if (!$app) {
            throw PaymentException::refundInterrupted($refund->getId(), 'App not defined');
        }

        $payload = $this->buildRefundPayload($refund$refund->getTransactionCapture()->getTransaction()->getOrder());

        try {
            $response = $this->payloadService->request($refundUrl$payload$app, RefundResponse::class$context);
        } catch (ClientExceptionInterface $exception) {
            throw PaymentException::refundInterrupted($refund->getId()sprintf('App error: %s', $exception->getMessage()));
        }

        if (!$response instanceof RefundResponse) {
            
Home | Imprint | This part of the site doesn't use cookies.