diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index 545652bf3a9e..93df85a4c711 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -127,7 +127,6 @@ class InvoiceController extends Controller })->map(function ($invoice){ $invoice->balance = Number::formatMoney($invoice->balance, $invoice->client); $invoice->due_date = $this->formatDate($invoice->due_date, $invoice->client->date_format()); - return $invoice; }); diff --git a/app/Http/Controllers/ClientPortal/PaymentController.php b/app/Http/Controllers/ClientPortal/PaymentController.php index 2f2779ad9887..d3346efd3f1a 100644 --- a/app/Http/Controllers/ClientPortal/PaymentController.php +++ b/app/Http/Controllers/ClientPortal/PaymentController.php @@ -75,6 +75,38 @@ class PaymentController extends Controller } + /** + * Presents the payment screen for a given + * gateway and payment method. + * The request will also contain the amount + * and invoice ids for reference + * @param int $company_gateway_id The CompanyGateway ID + * @param int $payment_method_id The PaymentMethod ID + * @return void + */ + public function process($company_gateway_id, $payment_method_id) + { + + $invoices = request()->input('ids'); + $amount = request()->input('amount'); + + //build a cache record to maintain state + + //boot the payment gateway + + //build the gateway specific views + + + $data = [ + 'redirect_url' =>, + 'amount' =>, + 'gateway_data' =>, + 'cache_hash' =>, + ]; + + return view('', $data); + } + } diff --git a/app/Models/Client.php b/app/Models/Client.php index de235a469c9a..a25068402b51 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -264,7 +264,7 @@ class Client extends BaseModel $payment_urls[] = [ 'label' => ctrans('texts.' . $gateway->type->alias) . $fee_label, - 'url' => URL::signedRoute('payments', [ + 'url' => URL::signedRoute('payments.process', [ 'company_gateway_id' => $key, 'payment_method_id' => $value]) ];