$response = $this->paymentService->finalizeTransaction($token, $request, $this->getSalesChannelContext($paymentMethodId)); if(!Feature::isActive('v6.6.0.0')){ static::assertInstanceof(TokenExpiredException::class, $response->getException()); } static::assertInstanceof(PaymentException::class, $response->getException()); static::assertEquals('The provided token ' . $token . ' is expired and the payment could not be processed.', $response->getException()->getMessage()); }