HTML; } public function handleSelect(string $company_gateway_id, string $gateway_type_id, string $amount) { $this->isLoading = true; $this->dispatch( event: 'payment-method-selected', company_gateway_id: $company_gateway_id, gateway_type_id: $gateway_type_id, amount: $amount, ); } public function mount() { $this->variables = $this->getContext()['variables']; $this->amount = array_sum(array_column($this->getContext()['payable_invoices'], 'amount')); MultiDB::setDb($this->getContext()['db']); $this->methods = $this->getContext()['invitation']->contact->client->service()->getPaymentMethods($this->amount); if (count($this->methods) == 1) { $this->dispatch('singlePaymentMethodFound', company_gateway_id: $this->methods[0]['company_gateway_id'], gateway_type_id: $this->methods[0]['gateway_type_id'], amount: $this->amount); } else { $this->isLoading = false; $this->dispatch('loadingCompleted'); } } public function render(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View { return render('flow2.payment-method', ['methods' => $this->methods]); } }