From 57159ca31f05c4a13a2f328e82b5315716d628b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 21 Feb 2024 17:55:08 +0100 Subject: [PATCH] Refactor purchase submission in Submit.php --- app/Livewire/BillingPortal/Submit.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/Livewire/BillingPortal/Submit.php b/app/Livewire/BillingPortal/Submit.php index 3cdd270fac26..4779164377bc 100644 --- a/app/Livewire/BillingPortal/Submit.php +++ b/app/Livewire/BillingPortal/Submit.php @@ -43,15 +43,24 @@ class Submit extends Component // 'contact_last_name' => $this->context['contact']['last_name'], // 'contact_email' => $this->context['contact']['email'], // ]); - + // return redirect((new InstantPayment($request))->run()); - $this->dispatch('purchase.submit'); + $this->dispatch( + 'purchase.submit', + invoice_hashed_id: $this->context['form']['invoice_hashed_id'], + payable_amount: $this->context['form']['payable_amount'], + company_gateway_id: $this->context['form']['company_gateway_id'], + payment_method_id: $this->context['form']['payment_method_id'], + contact_first_name: $this->context['contact']['first_name'], + contact_last_name: $this->context['contact']['last_name'], + contact_email: $this->context['contact']['email'], + ); } public function render() { - + return <<<'HTML'