AsyncFinalizeResponse example

if (!Feature::isActive('v6.6.0.0')) {
            $this->expectException(AsyncPaymentProcessException::class);
        }

        $this->paymentService->handlePaymentByOrder($orderIdnew RequestDataBag()$salesChannelContext);
    }

    public function testPayFinalizeWithUnsignedResponse(): void
    {
        $data = $this->prepareTransaction();

        $response = (new AsyncFinalizeResponse())->assign([
            'message' => self::ERROR_MESSAGE,
        ]);
        $json = \json_encode($response, \JSON_THROW_ON_ERROR);
        static::assertNotFalse($json);

        $this->appendNewResponse(new Response(200, ['shopware-app-signature' => 'invalid']$json));

        $return = $this->paymentService->finalizeTransaction($data['token']new \Symfony\Component\HttpFoundation\Request()$this->getSalesChannelContext($data['paymentMethodId']));

        static::assertInstanceOf(PaymentException::class$return->getException());

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