company_gateway = $company_gateway; $this->invoice = $invoice; $this->amount = $amount; } public function run() { $gateway_fee = $this->company_gateway->calcGatewayFee($this->amount); if($gateway_fee > 0) return $this->processGatewayFee($gateway_fee); return $this->processGatewayDiscount($gateway_fee); } private function processGatewayFee($gateway_fee) { $invoice_item = new InvoiceItem; $invoice_item->type_id = 3; $invoice_item->notes = ctrans('texts.Gateway Fee Surcharge'); } private function processGatewayDiscount($gateway_fee) { } }