subjectReader = $subjectReader; $this->config = $config; } /** * @inheritdoc */ public function handle(array $handlingSubject, array $response): void { $storeId = $this->subjectReader->readStoreId($handlingSubject); $paymentDO = $this->subjectReader->readPayment($handlingSubject); $payment = $paymentDO->getPayment(); $transactionResponse = $response['transactionResponse']; if ($payment instanceof Payment) { // Add the keys that should show in the transaction details interface $additionalInformationKeys = $this->config->getAdditionalInfoKeys($storeId); $rawDetails = []; foreach ($additionalInformationKeys as $paymentInfoKey) { if (isset($transactionResponse[$paymentInfoKey])) { $rawDetails[$paymentInfoKey] = $transactionResponse[$paymentInfoKey]; $payment->setAdditionalInformation($paymentInfoKey, $transactionResponse[$paymentInfoKey]); } } $payment->setTransactionAdditionalInfo(Payment\Transaction::RAW_DETAILS, $rawDetails); } } }