How is \Magento\Sales\Model\Order\Payment::update() implemented and used?

Implementation

ffea3cd/app/code/Magento/Sales/Model/Order/Payment.php#L922-L962

/**
 * Performs registered payment update.
 *
 * @param bool $isOnline
 * @return $this
 * @throws \Magento\Framework\Exception\LocalizedException
 */
public function update($isOnline = true)
{
	$transactionId = $isOnline ? $this->getLastTransId() : $this->getTransactionId();
	$invoice = $this->_getInvoiceForTransactionId($transactionId);

	if ($isOnline) {
		$method = $this->getMethodInstance();
		$method->setStore($this->getOrder()->getStoreId());
		$method->fetchTransactionInfo($this, $transactionId);
	}

	if ($this->getIsTransactionApproved()) {
		$message = $this->_appendTransactionToMessage(
			$transactionId,
			$this->prependMessage(__('Registered update about approved payment.'))
		);
		$this->updateBaseAmountPaidOnlineTotal($invoice);
		$this->setOrderStateProcessing($message);
	} elseif ($this->getIsTransactionDenied()) {
		$message = $this->_appendTransactionToMessage(
			$transactionId,
			$this->prependMessage(__('Registered update about denied payment.'))
		);
		$this->cancelInvoiceAndRegisterCancellation($invoice, $message);
	} else {
		$message = $this->_appendTransactionToMessage(
			$transactionId,
			$this->prependMessage(__('There is no update for the payment.'))
		);
		$this->setOrderStatePaymentReview($message, $transactionId);
	}

	return $this;
}

Details: How is \Magento\Sales\Model\Order\Payment::setOrderStatePaymentReview() implemented and used?

The single usage

\Magento\Sales\Controller\Adminhtml\Order\ReviewPayment::execute()

https://github.com/magento/magento2/blob/ffea3cd/app/code/Magento/Sales/Controller/Adminhtml/Order/ReviewPayment.php#L42-L51

Details: How does \Magento\Sales\Controller\Adminhtml\Order\ReviewPayment::execute() work?

See also: