- /**
- * Update transaction with HTML representation of txn_id
- *
- * @param EventObserver $observer
- * @return void
- */
- public function execute(EventObserver $observer)
- {
- /** @var \Magento\Sales\Model\Order\Payment\Transaction $transaction */
- $transaction = $observer->getDataObject();
- $order = $transaction->getOrder();
- $payment = $order->getPayment();
- $methodInstance = $payment->getMethodInstance();
- $paymentCode = $methodInstance->getCode();
- $transactionLink = $this->paypalData->getHtmlTransactionId($paymentCode, $transaction->getTxnId());
- $transaction->setData('html_txn_id', $transactionLink);
- }