public function checkCoupon(CouponInterface $coupon)
    {
        if (!$this->IsActive($coupon)) {
            throw new CouponNotActiveException();
        }

        if (!$this->canBeUsed($coupon)) {
            throw new CouponAppliedException();
        }

        return true;
    }
public function checkCoupon(CouponInterface $coupon)
    {
        if (!$this->IsActive($coupon)) {
            throw new CouponNotActiveException();
        }

        if (!$this->canBeUsed($coupon)) {
            throw new CouponAppliedException();
        }

        return true;
    }
public function checkCoupon ( CouponInterface $ coupon ) { if ( ! $ this -> IsActive ( $ coupon ) ) { throw new CouponNotActiveException ( ) ; } if ( ! $ this -> canBeUsed ( $ coupon ) ) { throw new CouponAppliedException ( ) ; } return true ; }
Checks whether a coupon can be applied or not.

@param CouponInterface $coupon Coupon to work with

@return bool Coupon can be applied

@throws AbstractCouponException
Checks whether a coupon can be applied or not .