mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 15:34:39 -04:00
Stubs for form submissions
This commit is contained in:
parent
c8f7e9e250
commit
fb92f8fe9d
@ -13,43 +13,47 @@
|
|||||||
namespace App\Livewire\BillingPortal;
|
namespace App\Livewire\BillingPortal;
|
||||||
|
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
use Livewire\Attributes\Lazy;
|
||||||
use App\Services\ClientPortal\InstantPayment;
|
use App\Services\ClientPortal\InstantPayment;
|
||||||
|
|
||||||
|
#[Lazy]
|
||||||
class Submit extends Component
|
class Submit extends Component
|
||||||
{
|
{
|
||||||
public array $context;
|
public array $context;
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
// This is right place to check if everything is set up correctly.
|
|
||||||
// <input type="hidden" name="action" value="payment">
|
|
||||||
// <input type="hidden" name="invoices[]" value="{{ $context['form']['invoice_hashed_id'] ?? '' }}">
|
|
||||||
// <input type="hidden" name="payable_invoices[0][amount]" value="{{ $context['form']['payable_amount'] ?? '' }}">
|
|
||||||
// <input type="hidden" name="payable_invoices[0][invoice_id]" value="{{ $context['form']['invoice_hashed_id'] ?? '' }}">
|
|
||||||
// <input type="hidden" name="company_gateway_id" value="{{ $context['form']['company_gateway_id'] ?? '' }}"/>
|
|
||||||
// <input type="hidden" name="payment_method_id" value="{{ $context['form']['payment_method_id'] ?? '' }}"/>
|
|
||||||
//hash
|
|
||||||
//sidebar = h
|
|
||||||
|
|
||||||
// $request = new \Illuminate\Http\Request([
|
// $request = new \Illuminate\Http\Request([
|
||||||
// 'sidebar' => 'hidden',
|
// 'sidebar' => 'hidden',
|
||||||
// 'hash' => $this->context['hash'],
|
// 'hash' => $this->context['hash'],
|
||||||
// 'action' => 'payment',
|
// 'action' => 'payment',
|
||||||
// 'invoices[]' => $this->context['form']['invoice_hashed_id'],
|
// 'invoices' => [
|
||||||
// 'payable_invoices[0][amount]' => $this->context['form']['payable_amount'],
|
// $this->context['form']['invoice_hashed_id'],
|
||||||
// 'payable_invoices[0][invoice_id]' => $this->context['form']['invoice_hashed_id'],
|
// ],
|
||||||
|
// 'payable_invoices' => [
|
||||||
|
// [
|
||||||
|
// 'amount' => $this->context['form']['payable_amount'],
|
||||||
|
// 'invoice_id' => $this->context['form']['invoice_hashed_id'],
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
// 'company_gateway_id' => $this->context['form']['company_gateway_id'],
|
// 'company_gateway_id' => $this->context['form']['company_gateway_id'],
|
||||||
// 'payment_method_id' => $this->context['form']['payment_method_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'],
|
||||||
// ]);
|
// ]);
|
||||||
|
|
||||||
// return (new InstantPayment($request))->run();
|
// return redirect((new InstantPayment($request))->run());
|
||||||
|
|
||||||
|
|
||||||
$this->dispatch('purchase.submit');
|
$this->dispatch('purchase.submit');
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
|
|
||||||
return <<<'HTML'
|
return <<<'HTML'
|
||||||
<div></div>
|
<div></div>
|
||||||
HTML;
|
HTML;
|
||||||
|
@ -71,6 +71,9 @@ class InstantPayment
|
|||||||
* ['invoice_id' => xxx, 'amount' => 22.00]
|
* ['invoice_id' => xxx, 'amount' => 22.00]
|
||||||
*/
|
*/
|
||||||
$payable_invoices = collect($this->request->payable_invoices);
|
$payable_invoices = collect($this->request->payable_invoices);
|
||||||
|
|
||||||
|
nlog($payable_invoices);
|
||||||
|
|
||||||
$invoices = Invoice::query()->whereIn('id', $this->transformKeys($payable_invoices->pluck('invoice_id')->toArray()))->withTrashed()->get();
|
$invoices = Invoice::query()->whereIn('id', $this->transformKeys($payable_invoices->pluck('invoice_id')->toArray()))->withTrashed()->get();
|
||||||
|
|
||||||
$invoices->each(function ($invoice) {
|
$invoices->each(function ($invoice) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user