public function getAmount()
{
/**
* Tweak to allow payment methods to access
* amount and currency when an order has not
* been created yet.
*
* If there is no order yet we have
* to pull the amount from the Cart
*/
if (!$this->order instanceof OrderInterface) {
return $this->cartWrapper->get()->getAmount()->getAmount();
}
$amount = $this->order->getAmount();
if ($amount instanceof Money) {
return $this->order->getAmount()->getAmount();
}
throw new LogicException(sprintf('Invalid Amount for Order [%d]', $this->getOrderId()));
}