|
- <?php
-
- namespace Lc\CaracoleBundle\Solver\User;
-
- use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
-
- class UserMerchantSolver
- {
- public function isCreditActive(UserMerchantInterface $userMerchant = null)
- {
- if (!$userMerchant || ($userMerchant && !$userMerchant->isCreditActive())) {
- return false;
- }
-
- return true;
- }
-
- public function isCreditSufficientToPay(UserMerchantInterface $userMerchant, float $amount)
- {
- if ($this->isCreditActive($userMerchant) && $userMerchant->getCredit() >= $amount) {
- return true;
- }
-
- return false;
- }
- }
|