$this->paymentService =
$this->
getContainer()->
get(PreparedPaymentService::
class);
$this->orderTransactionStateHandler =
$this->
getContainer()->
get(OrderTransactionStateHandler::
class);
$this->orderRepository =
$this->
getRepository(OrderDefinition::ENTITY_NAME
);
$this->customerRepository =
$this->
getRepository(CustomerDefinition::ENTITY_NAME
);
$this->orderTransactionRepository =
$this->
getRepository(OrderTransactionDefinition::ENTITY_NAME
);
$this->paymentMethodRepository =
$this->
getRepository(PaymentMethodDefinition::ENTITY_NAME
);
$this->context = Context::
createDefaultContext();
} public function testHandlePreOrderPayment(): void
{ $paymentMethodId =
$this->
createPaymentMethod($this->context
);
$cart = Generator::
createCart();
$salesChannelContext =
$this->
getSalesChannelContext($paymentMethodId);
$struct =
$this->paymentService->
handlePreOrderPayment($cart,
new RequestDataBag(),
$salesChannelContext);
static::
assertInstanceOf(ArrayStruct::
class,
$struct);
static::
assertSame(PreparedTestPaymentHandler::TEST_STRUCT_CONTENT,
$struct->
all());
} public function testHandlePreOrderPaymentFails(): void
{