invoice = $invoice; $this->client = $invoice->client; } public function run() { if(!$invoice->isPayable()) return $invoice; } private function getGateway($amount) { $gateway_tokens = $this->client->gateway_tokens->orderBy('is_default', 'DESC'); $gateways->filter(function ($method) use ($amount) { if ($method->min_limit !== null && $amount < $method->min_limit) { return false; } if ($method->max_limit !== null && $amount > $method->min_limit) { return false; } }); } }