$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());
/** @var PaymentException $exception */
$exception =
$return->
getException();
static::
assertEquals(PaymentException::PAYMENT_ASYNC_FINALIZE_INTERRUPTED,
$exception->
getErrorCode());
if (!Feature::
isActive('v6.6.0.0'
)) { static::
assertInstanceOf(AsyncPaymentFinalizeException::
class,
$return->
getException());
} $this->
assertOrderTransactionState(OrderTransactionStates::STATE_FAILED,
$data['transactionId'
]);
}