CaptureResponse example

$this->preparedPaymentService->handlePreOrderPayment($cartnew RequestDataBag()$salesChannelContext);
    }

    public function testCapture(): void
    {
        $paymentMethodId = $this->getPaymentMethodId('prepared');
        $orderId = $this->createOrder($paymentMethodId);
        $transactionId = $this->createTransaction($orderId$paymentMethodId);
        $salesChannelContext = $this->getSalesChannelContext($paymentMethodId);
        $order = $this->loadOrder($orderId$salesChannelContext);

        $response = new CaptureResponse();
        $this->appendNewResponse($this->signResponse($response->jsonSerialize()));

        $this->preparedPaymentService->handlePostOrderPayment($ordernew RequestDataBag()$salesChannelContextnew ArrayStruct(['test' => 'test']));

        /** @var Request $request */
        $request = $this->getLastRequest();
        $body = $request->getBody()->getContents();

        $appSecret = $this->app->getAppSecret();
        static::assertNotNull($appSecret);

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