You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
629B

  1. <?php
  2. namespace Lc\CaracoleBundle\Solver\User;
  3. use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
  4. class UserMerchantSolver
  5. {
  6. public function isCreditActive(UserMerchantInterface $userMerchant = null)
  7. {
  8. if (!$userMerchant || ($userMerchant && !$userMerchant->isCreditActive())) {
  9. return false;
  10. }
  11. return true;
  12. }
  13. public function isCreditSufficientToPay(UserMerchantInterface $userMerchant, float $amount)
  14. {
  15. if ($this->isCreditActive($userMerchant) && $userMerchant->getCredit() >= $amount) {
  16. return true;
  17. }
  18. return false;
  19. }
  20. }