Makes a filter function to check if backends can handle given amount.

@param  int $amount

@return function
3357
public function makeBackendFilterChargeAmount($amount)
    {
        $defMin = $this['limits']['charge_amount']['min'];
        $defMax = $this['limits']['charge_amount']['max'];
        return function ($backend) use ($amount, $defMin, $defMax) {
            // temporary hack for now to correct min value for instalments to 500000
            if ($backend->type == 'installment') {
                $min = 500000;
            } else {
                $min = empty($backend->amount['min']) ? $defMin : $backend->amount['min'];
            }
            $max = empty($backend->amount['max']) ? $defMax : $backend->amount['max'];
            return $amount >= $min && $amount <= $max;
        };
    }
1110758
public function make($amount = 1, array $attributes = [])
	{
		$this->validateImplementation();

		return factory($this->model, $amount)->make($attributes);
	}
550834
public function unsharpMask($amount = 80, $radius = 1, $threshold = 1)
    {
        $this->actions_to_perform[] = ['unsharpMask', ['amount' => $amount, 'radius' => $radius, 'threshold' => $threshold]];

        return $this;
    }
712266
public function random(int $amount = 1)
    {
        $count = $this->count();
        if ($amount > $count) {
            $message = sprintf('Requested %d items with %d items present', $amount, $count);
            throw new DomainException($message);
        }

        $keys = array_rand($this->items, $amount);

        if ($amount === 1) {
            return $this->items[$keys];
        }

        return new static(array_intersect_key($this->items, array_flip($keys)));
    }
1122138
public function _creditCheck($amount)
	{
		$b = $this->balance;
		$b -= $amount;
		$c = $this->credit;
		$ccheck = $b - $c;

		if ($b >= 0 && $ccheck >= 0)
		{
			return true;
		}

		$this->setError('Not enough points in user account to process transaction.');
		return false;
	}
1302507
public function refund($amount = null)
    {
        $builder = new HpsCreditServiceRefundBuilder($this);
        return $builder
            ->withAmount($amount)
            ->withCurrency('usd');
    }
204194
protected function assertAmountFormat($amount)
    {
        if (is_float($amount)) {
            throw new InvalidArgumentException(sprintf('The provided amount "%s" must be a string, not a float.', $amount));
        }
        if (!is_numeric($amount)) {
            throw new InvalidArgumentException(sprintf('The provided amount "%s" must be a valid string.', $amount));
        }
    }
1337320
public function validateMax($amount)
    {
        $this->validator_attributes[] = 'data-parsley-max="' . (float)$amount . '"';

        $this->validator_checks['max'] = (float)$amount;

        return $this;
    }
1151945
public function setAmount($amount)
    {
        if ($amount === null) {
            $this->amount = 0;
            return $this;
        }
        
        if (!is_int($amount)) {
            throw new InvalidArgumentException(sprintf(
                'Amount must be an integer, "%s" given',
                is_object($amount) ? get_class($amount) : gettype($amount)
            ));
        }
        
        // Overflow check is not necessary because we have an integer
        $this->amount = $amount;
        return $this;
    }
109048
protected function getClosestAcceptedCashAmount($amount): int
    {
        $value = Number::fromString($amount)->getIntegerPart();
        $cent = $amount % 5;

        if ($cent <= 2) {
            $value = $value - $cent;
        } else {
            $value = $value + (5 - $cent);
        }

        return $value;
    }
367397
public function creditCardPartial($amount)
    {
        $data = new stdClass();
        $data->amount = $amount;

        return $this->execute($data);
    }
219566
public function getAmount($amount)
    {
        if (!is_float($amount) &&
            $this->getCurrencyDecimalPlaces() > 0 &&
            false === strpos((string) $amount, '.')) {
            throw new InvalidArgumentException(
                'Please specify amount as a string or float, '.
                'with decimal places (e.g. \'10.00\' to represent $10.00).'
            );
        }

        return $this->formatCurrency($amount);
    }
600027
public function setAmount($amount)
    {
        $effects = $this->unserializeEffects($this->getSerializedEffects());
        $effects['amount'] = \floatval($amount);
        $this->setEffects($effects);

        return $this;
    }
1265923
protected function parseAmountNegativeFormat($amount) {
    // An amount wrapped in parentheses.
    $amount = preg_replace('/^\((.*?)\)$/', '-\\1', $amount);
    // An amount suffixed by a minus sign.
    $amount = preg_replace('/^(.*?)-$/', '-\\1', $amount);
    // Double minus signs.
    $amount = preg_replace('/--/', '', $amount);

    return $amount;
  }
38531
public function refund($amount = null)
    {
        return (new ManagementBuilder(TransactionType::REFUND))
            ->withPaymentMethod($this->transactionReference)
            ->withAmount($amount);
    }
473172
private function setFraction($amount)
    {
        $doubleFraction = $amount * 100;
        $intFraction = ($this->round(abs($doubleFraction))) % 100;
        if($intFraction < 0)
            $intFraction = -$intFraction;
        $this->fraction = $intFraction;
    }
214297
public function capture($amount = null)
    {
        return (new ManagementBuilder(TransactionType::CAPTURE))
            ->withPaymentMethod($this->transactionReference)
            ->withAmount($amount);
    }