commandPool = $commandPool; $this->subjectReader = $subjectReader; $this->config = $config; $this->handler = $handler; } /** * @inheritdoc */ public function execute(array $commandSubject): array { $paymentDO = $this->subjectReader->readPayment($commandSubject); $order = $paymentDO->getOrder(); $command = $this->commandPool->get('get_transaction_details'); $result = $command->execute($commandSubject); $response = $result->get(); if ($this->handler) { $this->handler->handle($commandSubject, $response); } $additionalInformationKeys = $this->config->getTransactionInfoSyncKeys($order->getStoreId()); $rawDetails = []; foreach ($additionalInformationKeys as $key) { if (isset($response['transaction'][$key])) { $rawDetails[$key] = $response['transaction'][$key]; } } return $rawDetails; } }