objectManager->get('AuthorizenetAcceptjsCommandPool'); $command = $commandPool->get('get_transaction_details'); $order = $this->getOrderWithIncrementId('100000002'); $payment = $order->getPayment(); $paymentDO = $this->paymentFactory->create($payment); $expectedRequest = include __DIR__ . '/../../_files/expected_request/transaction_details.php'; $response = include __DIR__ . '/../../_files/response/transaction_details_settled_capture.php'; $this->clientMock->method('setRawData') ->with(json_encode($expectedRequest), 'application/json'); $this->responseMock->method('getBody') ->willReturn(json_encode($response)); $result = $command->execute([ 'payment' => $paymentDO ]); $resultData = $result->get(); $this->assertEquals($response, $resultData); } }