From ae02953a8fb3ffb9d44afce35585c94d4c45c12d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 4 Oct 2019 07:51:54 +1000 Subject: [PATCH] Client portal client screen --- .../ClientPortal/PaymentController.php | 5 +-- app/Models/Payment.php | 6 +++ .../PayPalExpressPaymentDriver.php | 1 + .../portal/default/payments/show.blade.php | 43 +++++++++++++++++++ 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ClientPortal/PaymentController.php b/app/Http/Controllers/ClientPortal/PaymentController.php index 88e740d80369..1d40e1f0ead7 100644 --- a/app/Http/Controllers/ClientPortal/PaymentController.php +++ b/app/Http/Controllers/ClientPortal/PaymentController.php @@ -51,7 +51,7 @@ class PaymentController extends Controller if (request()->ajax()) { return DataTables::of($payments)->addColumn('action', function ($payment) { - return ''.ctrans('texts.view').''; + return ''.ctrans('texts.view').''; })->editColumn('payment_type_id', function ($payment) { return $payment->type->name; }) @@ -82,8 +82,7 @@ class PaymentController extends Controller $data['payment'] = $payment; - print_r($payment->toArray()); - //return view('portal.default.payments.show', $data); + return view('portal.default.payments.show', $data); } diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 91d808e39646..65c773c89b87 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -13,6 +13,7 @@ namespace App\Models; use App\Models\BaseModel; use App\Models\Filterable; +use App\Utils\Number; use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; @@ -93,6 +94,11 @@ class Payment extends BaseModel return $this->hasOne(PaymentType::class,'id','payment_type_id'); } + public function formattedAmount() + { + return Number::formatMoney($this->amount, $this->client); + } + public static function badgeForStatus(int $status) { switch ($status) { diff --git a/app/PaymentDrivers/PayPalExpressPaymentDriver.php b/app/PaymentDrivers/PayPalExpressPaymentDriver.php index 986e26e59b17..43c6aa704ff1 100644 --- a/app/PaymentDrivers/PayPalExpressPaymentDriver.php +++ b/app/PaymentDrivers/PayPalExpressPaymentDriver.php @@ -92,6 +92,7 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver */ public function processPaymentView(array $data) { + $response = $this->purchase($this->paymentDetails($data), $this->paymentItems($data)); diff --git a/resources/views/portal/default/payments/show.blade.php b/resources/views/portal/default/payments/show.blade.php index e69de29bb2d1..34a2a4fea677 100644 --- a/resources/views/portal/default/payments/show.blade.php +++ b/resources/views/portal/default/payments/show.blade.php @@ -0,0 +1,43 @@ +@extends('portal.default.layouts.master') +@section('header') + +@stop +@section('body') +
+
+
+
+
+
+ {{ ctrans('texts.payment')}} +
+
+ + + + + + +
{{ctrans('texts.payment_date')}}{{$payment->payment_date}}
{{ctrans('texts.transaction_reference')}}{{$payment->transaction_reference}}
{{ctrans('texts.method')}}{{$payment->type->name}}
{{ctrans('texts.amount')}}{{$payment->formattedAmount()}}
{{ctrans('texts.status')}}{!! $payment::badgeForStatus($payment->status_id) !!}
+ + + @foreach($payment->invoices as $invoice) + + @endforeach +
{{ ctrans('texts.invoice_number')}}{{ $invoice->invoice_number }}
+
+
+
+
+
+
+ + +@endsection +@push('css') +@endpush +@push('scripts') +@endpush +@section('footer') +@endsection +