mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Scaffold payments handling
This commit is contained in:
parent
39840acd1b
commit
0d2087dfc2
46
app/Livewire/BillingPortal/Payments/Methods.php
Normal file
46
app/Livewire/BillingPortal/Payments/Methods.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Livewire\BillingPortal\Payments;
|
||||||
|
|
||||||
|
use App\Models\Subscription;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class Methods extends Component
|
||||||
|
{
|
||||||
|
public Subscription $subscription;
|
||||||
|
|
||||||
|
public array $context;
|
||||||
|
|
||||||
|
public array $methods;
|
||||||
|
|
||||||
|
public function mount(): void
|
||||||
|
{
|
||||||
|
$total = collect($this->context['products'])->sum('total_raw');
|
||||||
|
|
||||||
|
$methods = auth()->guard('contact')->user()->client->service()->getPaymentMethods(
|
||||||
|
$total,
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->methods = $methods;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handleSelect(string $company_gateway_id, string $gateway_type_id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('billing-portal.v3.payments.methods');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
<div>
|
||||||
|
<h1 class="text-2xl">{{ ctrans('texts.payment_methods') }}</h1>
|
||||||
|
|
||||||
|
@foreach($methods as $method)
|
||||||
|
<button wire:click="handleSelect('{{ $method['company_gateway_id'] }}', '{{ $method['gateway_type_id'] }}')">
|
||||||
|
{{ $method['label'] }}
|
||||||
|
</button>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user