OrderTransactionCaptureRefundBuilder example


        $capture = (new OrderTransactionCaptureBuilder($this->ids, 'capture', $orderTransactionId))
            ->build();

        $this->orderTransactionCaptureRepository->upsert([$capture]$this->context);

        return $this->ids->get('capture');
    }

    protected function createRefund(string $captureId): string
    {
        $refund = (new OrderTransactionCaptureRefundBuilder($this->ids, 'refund', $captureId))
            ->build();

        $this->orderTransactionCaptureRefundRepository->upsert([$refund]$this->context);

        return $this->ids->get('refund');
    }

    protected function getPaymentMethodId(string $name): string
    {
        $criteria = new Criteria();
        $criteria->addFilter(new EqualsFilter('handlerIdentifier', sprintf('app\\testPayments_%s', $name)));
        
if (!Feature::isActive('v6.6.0.0')) {
            static::expectException(UnknownRefundException::class);
        }
        static::expectException(PaymentException::class);
        static::expectExceptionMessage('The Refund process failed with following exception: Unknown refund with id ' . $this->ids->get('refund') . '.');

        $this->paymentRefundProcessor->processRefund($this->ids->get('refund'), Context::createDefaultContext());
    }

    public function testItThrowsOnNotAvailableHandler(): void
    {
        $refund = (new OrderTransactionCaptureRefundBuilder(
            $this->ids,
            'refund',
            $this->ids->get('capture')
        ))
            ->add('stateId', $this->getStateMachineState(
                OrderTransactionCaptureRefundStates::STATE_MACHINE,
                OrderTransactionCaptureRefundStates::STATE_OPEN
            ))
            ->build();

        $capture = (new OrderTransactionCaptureBuilder($this->ids, 'capture', $this->ids->get('transaction')))
            
Home | Imprint | This part of the site doesn't use cookies.