createFailedPaymentMethodData example



    public function testOrderWithInactivePaymentMethod(): void
    {
        $this->expectException(PaymentMethodNotAvailableException::class);

        $this->performOrder('', true);
    }

    public function testOrderWithFailedPaymentMethod(): void
    {
        $this->createFailedPaymentMethodData();

        $contextToken = Uuid::randomHex();

        $this->fillCart($contextToken, false, true);

        $requestDataBag = $this->createRequestDataBag('');
        $salesChannelContext = $this->createSalesChannelContext($contextToken, true);
        $request = $this->createRequest();

        /** @var RedirectResponse|Response $response */
        $response = $this->getContainer()->get(CheckoutController::class)->order($requestDataBag$salesChannelContext$request);

        
Home | Imprint | This part of the site doesn't use cookies.