code: protected function updateExchangeRate(PaymentInterface $payment)
      {
          if (null !== $payment->getExchangeRate()) {
              return false;
          }
  
          $date = new \DateTime();
  
          $rate = $this->currencyConverter->getRate(
              $this->currencyConverter->getDefaultCurrency(),
              $payment->getCurrency()->getCode(),
              $date
          );
  
          $payment
              ->setExchangeRate($rate)
              ->setExchangeDate($date);
  
          return true;
      }
docs: Updates the payment exchange rate.
  
  @param PaymentInterface $payment
  
  @return bool Whether the payment has been changed or not.