public function applyDiscount(OrderableInterface $order) { $amount = $order->getTotalAmount(); if ($amount->lessThan($this->minimumAmount)) { throw $this->createCouponException(sprintf('Coupon requires a minimum amount of %u.', $this->minimumAmount->getAmount())); } return $this->coupon->applyDiscount($order); }
public function applyDiscount(OrderableInterface $order) { $amount = $order->getTotalAmount(); return $amount->subtract($amount->multiply($this->rate)); }