/**
  * Converts the order's gross total to target currency
  *
  * @param OrderInterface $order
  *
  * @return float
  */
 protected function convertAmount(OrderInterface $order)
 {
     $amount = $order->getOrderTotal()->getGrossAmount();
     $baseCurrency = $order->getCurrency();
     return $this->getCurrencyHelper()->convert($amount, $baseCurrency);
 }
 /**
  * Creates PayPal payment details from given order
  *
  * @param OrderInterface $order
  *
  * @return Details
  */
 protected function createDetails(OrderInterface $order) : Details
 {
     $details = new Details();
     $details->setShipping($order->getShippingTotal()->getNetAmount());
     $details->setTax($order->getOrderTotal()->getTaxAmount());
     $details->setSubtotal($order->getProductTotal()->getNetAmount());
     return $details;
 }